discomfitor pushed a commit to branch master.

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

commit 9efb05a865ad63b89305d5864641bcf7fbaeb12c
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Jul 27 16:54:01 2015 -0400

    add E_EVENT_SCREENSAVER_OFF_PRE
    
    for hooking dpms changes which occur before animations play
---
 src/bin/e_screensaver.c | 15 ++++++++++-----
 src/bin/e_screensaver.h |  1 +
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/bin/e_screensaver.c b/src/bin/e_screensaver.c
index aabd4f5..634ff51 100644
--- a/src/bin/e_screensaver.c
+++ b/src/bin/e_screensaver.c
@@ -31,12 +31,13 @@ static Ecore_Timer *_e_screensaver_timer;
 
 E_API int E_EVENT_SCREENSAVER_ON = -1;
 E_API int E_EVENT_SCREENSAVER_OFF = -1;
+E_API int E_EVENT_SCREENSAVER_OFF_PRE = -1;
 
 #ifdef HAVE_WAYLAND
 static Eina_Bool
-_e_screensaver_idle_timeout_cb(void *d EINA_UNUSED)
+_e_screensaver_idle_timeout_cb(void *d)
 {
-   e_screensaver_eval(1);
+   e_screensaver_eval(!!d);
    _e_screensaver_timer = NULL;
    return EINA_FALSE;
 }
@@ -111,7 +112,7 @@ e_screensaver_update(void)
    if (changed && (e_comp->comp_type == E_PIXMAP_TYPE_WL))
      {
         E_FREE_FUNC(_e_screensaver_timer, ecore_timer_del);
-        _e_screensaver_timer = ecore_timer_add(timeout, 
_e_screensaver_idle_timeout_cb, NULL);
+        _e_screensaver_timer = ecore_timer_add(timeout, 
_e_screensaver_idle_timeout_cb, (void*)1);
      }
 #endif
 }
@@ -284,7 +285,7 @@ _e_screensaver_handler_screensaver_off_cb(void *data 
EINA_UNUSED, int type EINA_
    else if (_e_screensaver_ask_presentation_count)
      _e_screensaver_ask_presentation_count = 0;
 #ifdef HAVE_WAYLAND
-   _e_screensaver_timer = ecore_timer_add(_e_screensaver_timeout, 
_e_screensaver_idle_timeout_cb, NULL);
+   _e_screensaver_timer = ecore_timer_add(_e_screensaver_timeout, 
_e_screensaver_idle_timeout_cb, (void*)1);
 #endif
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -323,6 +324,7 @@ e_screensaver_preinit(void)
 {
    E_EVENT_SCREENSAVER_ON = ecore_event_type_new();
    E_EVENT_SCREENSAVER_OFF = ecore_event_type_new();
+   E_EVENT_SCREENSAVER_OFF_PRE = ecore_event_type_new();
 }
 
 EINTERN int
@@ -538,7 +540,10 @@ e_screensaver_notidle(void)
    if (_e_screensaver_timer)
      ecore_timer_reset(_e_screensaver_timer);
    if (e_screensaver_on_get())
-     e_screensaver_eval(0);
+     {
+        ecore_event_add(E_EVENT_SCREENSAVER_OFF_PRE, NULL, NULL, NULL);
+        _e_screensaver_timer = ecore_timer_add(1.0, 
_e_screensaver_idle_timeout_cb, NULL);
+     }
 #endif
 }
 
diff --git a/src/bin/e_screensaver.h b/src/bin/e_screensaver.h
index feab949..281e5c0 100644
--- a/src/bin/e_screensaver.h
+++ b/src/bin/e_screensaver.h
@@ -19,6 +19,7 @@ E_API void e_screensaver_eval(Eina_Bool saver_on);
 E_API void e_screensaver_notidle(void);
 
 E_API extern int E_EVENT_SCREENSAVER_ON;
+E_API extern int E_EVENT_SCREENSAVER_OFF_PRE;
 E_API extern int E_EVENT_SCREENSAVER_OFF;
 
 #endif

-- 


Reply via email to