e backlight - restructure to have real per screen backlight

now it really does look for the right way to control per screen and
only use the new e_system back-end to query/list devices etc. ...

this now opens the door to adding ddc support to e_system then using
it from e_backlight.

i can't test this... yet - but this means in theory the backlight
gadget will control the backlight of the screen it is on...
This commit is contained in:
Carsten Haitzler 2020-02-01 11:01:22 +00:00
parent 1d7041b6ad
commit ee393a201f
4 changed files with 541 additions and 459 deletions

File diff suppressed because it is too large Load Diff

View File

@ -75,7 +75,6 @@ static Ecore_X_Randr_Screen_Size screen_size = { -1, -1 };
static int screen_size_index = -1; static int screen_size_index = -1;
static Ecore_X_Atom backlight_atom = 0; static Ecore_X_Atom backlight_atom = 0;
extern double e_bl_val;
static Ecore_Timer *mouse_in_fix_check_timer = NULL; static Ecore_Timer *mouse_in_fix_check_timer = NULL;
@ -5293,17 +5292,8 @@ _e_comp_x_screensaver_notify_cb(void *data EINA_UNUSED, int type EINA_UNUSED, Ec
static Eina_Bool static Eina_Bool
_e_comp_x_backlight_notify_cb(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Randr_Output_Property_Notify *ev) _e_comp_x_backlight_notify_cb(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Randr_Output_Property_Notify *ev)
{ {
double x_bl;
if (ev->property != backlight_atom) return ECORE_CALLBACK_RENEW; if (ev->property != backlight_atom) return ECORE_CALLBACK_RENEW;
x_bl = ecore_x_randr_output_backlight_level_get(0, ev->output); e_backlight_update();
if (x_bl >= 0.0)
{
if (fabs(e_bl_val - x_bl) < DBL_EPSILON)
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);;
e_bl_val = x_bl;
}
return ECORE_CALLBACK_RENEW; return ECORE_CALLBACK_RENEW;
} }

View File

@ -372,7 +372,6 @@ struct _E_Config
double battery_timer; // GUI double battery_timer; // GUI
const char *sysdev; // GUI const char *sysdev; // GUI
unsigned char idle_dim; // GUI unsigned char idle_dim; // GUI
E_Backlight_Mode mode; /* not saved, display-only */
} backlight; } backlight;
struct struct

View File

@ -62,6 +62,8 @@ struct _E_Zone
/* formerly E_Comp_Zone */ /* formerly E_Comp_Zone */
Evas_Object *base; Evas_Object *base;
Evas_Object *over; Evas_Object *over;
E_Backlight_Mode bl_mode;
double bl; double bl;
Eina_Bool bloff; Eina_Bool bloff;