raster pushed a commit to branch master.

commit 0bf55848abe19088b7546f8161d1b85e3a864ba2
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Tue May 21 21:57:05 2013 +0900

    add option to not fade backlight on suspend/resume/reboot/shutdown/logout 
etc. to keep backlight untouched.
---
 src/bin/e_comp.c                     | 26 +++++++++++++++++---------
 src/bin/e_comp_cfdata.c              |  2 ++
 src/bin/e_comp_cfdata.h              |  1 +
 src/modules/conf_comp/e_mod_config.c |  8 +++++++-
 4 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 007032e..2893907 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -3240,7 +3240,7 @@ _e_comp_fade_handle(E_Comp_Zone *cz, int out, double tim)
 {
    if (out == 1)
      {
-        if (e_backlight_exists())
+        if ((e_backlight_exists()) && (!conf->nofade))
           {
              e_backlight_update();
              cz->bloff = EINA_TRUE;
@@ -3250,7 +3250,7 @@ _e_comp_fade_handle(E_Comp_Zone *cz, int out, double tim)
      }
    else
      {
-        if (e_backlight_exists())
+        if ((e_backlight_exists()) && (!conf->nofade))
           {
              cz->bloff = EINA_FALSE;
              e_backlight_update();
@@ -3326,9 +3326,12 @@ _e_comp_screens_eval(E_Comp *c)
         evas_object_del(cz->over);
         if (cz->bloff)
           {
-             if (e_backlight_mode_get(cz->zone) != E_BACKLIGHT_MODE_NORMAL)
-               e_backlight_mode_set(cz->zone, E_BACKLIGHT_MODE_NORMAL);
-             e_backlight_level_set(cz->zone, e_config->backlight.normal, 0.0);
+             if (!conf->nofade)
+               {
+                  if (e_backlight_mode_get(cz->zone) != 
E_BACKLIGHT_MODE_NORMAL)
+                    e_backlight_mode_set(cz->zone, E_BACKLIGHT_MODE_NORMAL);
+                  e_backlight_level_set(cz->zone, e_config->backlight.normal, 
0.0);
+               }
           }
         if (cz->zone) cz->zone->comp_zone = NULL;
         free(cz);
@@ -4321,11 +4324,14 @@ _e_comp_del(E_Comp *c)
         if (cz->zone) cz->zone->comp_zone = NULL;
         evas_object_del(cz->base);
         evas_object_del(cz->over);
-        if (cz->bloff)
+        if (!conf->nofade)
           {
-             if (e_backlight_mode_get(cz->zone) != E_BACKLIGHT_MODE_NORMAL)
-               e_backlight_mode_set(cz->zone, E_BACKLIGHT_MODE_NORMAL);
-             e_backlight_level_set(cz->zone, e_config->backlight.normal, 0.0);
+             if (cz->bloff)
+               {
+                  if (e_backlight_mode_get(cz->zone) != 
E_BACKLIGHT_MODE_NORMAL)
+                    e_backlight_mode_set(cz->zone, E_BACKLIGHT_MODE_NORMAL);
+                  e_backlight_level_set(cz->zone, e_config->backlight.normal, 
0.0);
+               }
           }
         free(cz);
      }
@@ -4725,6 +4731,8 @@ _e_comp_cfg_init(void)
 
    E_CONFIGURE_OPTION_ADD(co, BOOL, nocomp_fs, conf, _("Don't composite 
fullscreen windows"), _("composite"), _("border"));
    co->funcs[1].none = co->funcs[0].none = e_comp_shadows_reset;
+   E_CONFIGURE_OPTION_ADD(co, BOOL, nofade, conf, _("Don't fade backlight"), 
_("composite"), _("border"));
+   co->funcs[1].none = co->funcs[0].none = e_comp_shadows_reset;
    E_CONFIGURE_OPTION_ADD(co, BOOL, send_flush, conf, _("Send flush when 
compositing windows"), _("composite"), _("border"));
    co->funcs[1].none = co->funcs[0].none = e_comp_shadows_reset;
    E_CONFIGURE_OPTION_ADD(co, BOOL, send_dump, conf, _("Send dump when 
compositing windows"), _("composite"), _("border"));
diff --git a/src/bin/e_comp_cfdata.c b/src/bin/e_comp_cfdata.c
index 635bc0c..99fffe6 100644
--- a/src/bin/e_comp_cfdata.c
+++ b/src/bin/e_comp_cfdata.c
@@ -52,6 +52,7 @@ e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD 
**match_edd)
    E_CONFIG_VAL(D, T, send_flush, UCHAR);
    E_CONFIG_VAL(D, T, send_dump, UCHAR);
    E_CONFIG_VAL(D, T, nocomp_fs, UCHAR);
+   E_CONFIG_VAL(D, T, nofade, UCHAR);
    E_CONFIG_VAL(D, T, smooth_windows, UCHAR);
    E_CONFIG_VAL(D, T, first_draw_delay, DOUBLE);
    E_CONFIG_VAL(D, T, disable_screen_effects, UCHAR);
@@ -102,6 +103,7 @@ e_comp_cfdata_config_new(void)
    cfg->send_flush = 1; // implement
    cfg->send_dump = 1; // implement
    cfg->nocomp_fs = 1;
+   cfg->nofade = 0;
    cfg->smooth_windows = 0; // 1 if gl, 0 if not
    cfg->first_draw_delay = 0.15;
 
diff --git a/src/bin/e_comp_cfdata.h b/src/bin/e_comp_cfdata.h
index 19c2f33..79ee038 100644
--- a/src/bin/e_comp_cfdata.h
+++ b/src/bin/e_comp_cfdata.h
@@ -27,6 +27,7 @@ struct _E_Comp_Config
    unsigned char send_dump;
    unsigned char nocomp_fs;
    unsigned char smooth_windows;
+   unsigned char nofade;
    double        first_draw_delay;
    Eina_Bool disable_screen_effects;
    // the following options add the "/fast" suffix to the normal groups
diff --git a/src/modules/conf_comp/e_mod_config.c 
b/src/modules/conf_comp/e_mod_config.c
index 12e640a..6ab265c 100644
--- a/src/modules/conf_comp/e_mod_config.c
+++ b/src/modules/conf_comp/e_mod_config.c
@@ -36,6 +36,7 @@ struct _E_Config_Dialog_Data
    int          send_flush;
    int          send_dump;
    int          nocomp_fs;
+   int          nofade;
 
    int          fps_show;
    int          fps_corner;
@@ -135,6 +136,7 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED)
    cfdata->send_flush = _comp_mod->conf->send_flush;
    cfdata->send_dump = _comp_mod->conf->send_dump;
    cfdata->nocomp_fs = _comp_mod->conf->nocomp_fs;
+   cfdata->nofade = _comp_mod->conf->nofade;
 
    cfdata->fps_show = _comp_mod->conf->fps_show;
    cfdata->fps_corner = _comp_mod->conf->fps_corner;
@@ -313,6 +315,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, 
E_Config_Dialog_Data
    e_widget_list_object_append(ol, ob, 1, 1, 0.5);
    ob = e_widget_check_add(evas, _("Don't composite fullscreen windows"), 
&(cfdata->nocomp_fs));
    e_widget_list_object_append(ol, ob, 1, 1, 0.5);
+   ob = e_widget_check_add(evas, _("Don't fade backlight"), &(cfdata->nofade));
+   e_widget_list_object_append(ol, ob, 1, 1, 0.5);
 /*   
    ob = e_widget_check_add(evas, _("Keep hidden windows"), 
&(cfdata->keep_unmapped));
    e_widget_list_object_append(ol, ob, 1, 1, 0.5);
@@ -428,6 +432,7 @@ _advanced_apply_data(E_Config_Dialog *cfd  __UNUSED__,
        (cfdata->grab != _comp_mod->conf->grab) ||
        (cfdata->keep_unmapped != _comp_mod->conf->keep_unmapped) ||
        (cfdata->nocomp_fs != _comp_mod->conf->nocomp_fs) ||
+       (cfdata->nofade != _comp_mod->conf->nofade) ||
        (cfdata->shadow_style != _comp_mod->conf->shadow_style) ||
        (cfdata->max_unmapped_pixels != _comp_mod->conf->max_unmapped_pixels) ||
        (cfdata->max_unmapped_time != _comp_mod->conf->max_unmapped_time) ||
@@ -467,6 +472,7 @@ _advanced_apply_data(E_Config_Dialog *cfd  __UNUSED__,
         _comp_mod->conf->grab = cfdata->grab;
         _comp_mod->conf->keep_unmapped = cfdata->keep_unmapped;
         _comp_mod->conf->nocomp_fs = cfdata->nocomp_fs;
+        _comp_mod->conf->nofade = cfdata->nofade;
         _comp_mod->conf->max_unmapped_pixels = cfdata->max_unmapped_pixels;
         _comp_mod->conf->max_unmapped_time = cfdata->max_unmapped_time;
         _comp_mod->conf->min_unmapped_time = cfdata->min_unmapped_time;
@@ -548,7 +554,7 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED,
 
    ob = e_widget_check_add(evas, _("Don't composite fullscreen windows"), 
&(cfdata->nocomp_fs));
    e_widget_list_object_append(ol, ob, 1, 0, 0.5);
-
+   
    cfdata->fast =
      (cfdata->fast_menus && cfdata->fast_menus && cfdata->fast_borders && 
cfdata->fast_popups && cfdata->fast_objects);
    cfdata->fast_ob = ob = e_widget_check_add(evas, _("Enable \"fast\" 
composite effects"), &(cfdata->fast));

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to