raster pushed a commit to branch master.

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

commit cf90b84a4246db03b10a0645c8e28535b5a8f291
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Thu Apr 17 13:55:39 2014 +0900

    fix screensaver/blanking issue where a ss on/off events come in together
---
 src/bin/e_comp_x.c | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index ca621a0..b47fbe1 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -4276,13 +4276,14 @@ _e_comp_x_screensaver_idle_timer_cb(void *d __UNUSED__)
    return EINA_FALSE;
 }
 
+static Ecore_Timer *screensaver_eval_timer = NULL;
+static Eina_Bool saver_on = EINA_FALSE;
+
 static Eina_Bool
-_e_comp_x_screensaver_notify_cb(void *data __UNUSED__, int type __UNUSED__, 
Ecore_X_Event_Screensaver_Notify *ev)
+_e_comp_x_screensaver_eval_cb(void *d __UNUSED__)
 {
-   static Eina_Bool saver_on = EINA_FALSE;
-   if ((ev->on) && (!saver_on))
+  if (saver_on)
      {
-        saver_on = EINA_TRUE;
         if (e_config->backlight.idle_dim)
           {
              double t = e_config->screensaver_timeout -
@@ -4305,9 +4306,8 @@ _e_comp_x_screensaver_notify_cb(void *data __UNUSED__, 
int type __UNUSED__, Ecor
                ecore_event_add(E_EVENT_SCREENSAVER_ON, NULL, NULL, NULL);
           }
      }
-   else if ((!ev->on) && (saver_on))
+   else if (saver_on)
      {
-        saver_on = EINA_FALSE;
         if (screensaver_idle_timer)
           {
              E_FREE_FUNC(screensaver_idle_timer, ecore_timer_del);
@@ -4329,6 +4329,25 @@ _e_comp_x_screensaver_notify_cb(void *data __UNUSED__, 
int type __UNUSED__, Ecor
                ecore_event_add(E_EVENT_SCREENSAVER_OFF, NULL, NULL, NULL);
           }
      }
+   screensaver_eval_timer = NULL;
+   return EINA_FALSE;
+}
+
+static Eina_Bool
+_e_comp_x_screensaver_notify_cb(void *data __UNUSED__, int type __UNUSED__, 
Ecore_X_Event_Screensaver_Notify *ev)
+{
+   if ((ev->on) && (!saver_on))
+     {
+        saver_on = EINA_TRUE;
+       E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
+       screensaver_eval_timer = ecore_timer_add(0.3, 
_e_comp_x_screensaver_eval_cb, NULL);
+     }
+   else if ((!ev->on) && (saver_on))
+     {
+        saver_on = EINA_FALSE;
+       E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
+       screensaver_eval_timer = ecore_timer_add(0.3, 
_e_comp_x_screensaver_eval_cb, NULL);
+     }
    return ECORE_CALLBACK_PASS_ON;
 }
 

-- 


Reply via email to