discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=e33c01cdce843367bcbd5846d5d33181159c37a4

commit e33c01cdce843367bcbd5846d5d33181159c37a4
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Feb 24 14:15:42 2017 -0500

    add new explicit method for enabling backlight depending on output type
    
    ensure that nested compositors don't mess with backlight
---
 src/bin/e_backlight.c           | 4 +---
 src/bin/e_comp.h                | 1 +
 src/bin/e_comp_x_randr.c        | 1 +
 src/modules/wl_drm/e_mod_main.c | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c
index c379ba9..2bced67 100644
--- a/src/bin/e_backlight.c
+++ b/src/bin/e_backlight.c
@@ -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;
diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h
index 8b21fea..f0c9737 100644
--- a/src/bin/e_comp.h
+++ b/src/bin/e_comp.h
@@ -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
diff --git a/src/bin/e_comp_x_randr.c b/src/bin/e_comp_x_randr.c
index a37d562..ee80856 100644
--- a/src/bin/e_comp_x_randr.c
+++ b/src/bin/e_comp_x_randr.c
@@ -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
diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index e943a75..657eb93 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -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

-- 


Reply via email to