add new explicit method for enabling backlight depending on output type

ensure that nested compositors don't mess with backlight
This commit is contained in:
Mike Blumenkrantz 2017-02-24 14:15:42 -05:00
parent 5d875e6a3d
commit e33c01cdce
4 changed files with 4 additions and 3 deletions

View File

@ -121,9 +121,7 @@ e_backlight_level_set(E_Zone *zone, double val, double tim)
// set backlight associated with zone to val over period of tim
// if tim == 0.0 - then do it instantnly, if time == -1 use some default
// transition time
if (eina_streq(ecore_evas_engine_name_get(e_comp->ee), "buffer") ||
strstr(ecore_evas_engine_name_get(e_comp->ee), "wayland"))
return;
if ((!e_comp->screen) || (!e_comp->screen->backlight_enabled)) return;
if (val < 0.0) val = 0.0;
else if (val > 1.0)
val = 1.0;

View File

@ -76,6 +76,7 @@ typedef struct E_Comp_Screen_Iface
/* is key event eaten */
Eina_Bool (*key_up)(Ecore_Event_Key *ev);
Eina_Bool relative_motion : 1;
Eina_Bool backlight_enabled : 1;
} E_Comp_Screen_Iface;
/* struct to hold canvas objects so that abi doesn't break

View File

@ -23,6 +23,7 @@ E_Comp_Screen_Iface xiface =
.create = e_comp_x_randr_create,
.apply = e_comp_x_randr_config_apply,
.relative_motion = EINA_FALSE,
.backlight_enabled = EINA_TRUE,
};
static void

View File

@ -821,6 +821,7 @@ static E_Comp_Screen_Iface drmiface =
.key_down = _drm2_key_down,
.key_up = _drm2_key_up,
.relative_motion = EINA_TRUE,
.backlight_enabled = EINA_TRUE,
};
static Eina_Bool