summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-08-26 15:34:40 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-08-26 15:34:40 +0000
commit3faee27bd87d56814cb657e94146eb4b8b7fde55 (patch)
tree2d0e6d84ec2e110aa0a5070c98fea09e366c9788 /legacy
parent3b197e9a545c4ecb9486390a3f3a4408749deb0e (diff)
add in custom screen blank enable/disable in ecore-x so we can do e17
based on this release of efl. SVN revision: 75714
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/ChangeLog5
-rw-r--r--legacy/ecore/src/lib/ecore_x/Ecore_X.h4
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c3
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c35
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c3
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c33
6 files changed, 78 insertions, 5 deletions
diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog
index d9896cd063..e8d0ff1876 100644
--- a/legacy/ecore/ChangeLog
+++ b/legacy/ecore/ChangeLog
@@ -865,3 +865,8 @@
8652012-08-18 Carsten Haitzler (The Rasterman) 8652012-08-18 Carsten Haitzler (The Rasterman)
866 866
867 * Add xkb change events patch from trac. 867 * Add xkb change events patch from trac.
868
8692012-08-27 Carsten Haitzler (The Rasterman)
870
871 * Add ecore_x custom blanker screensaver enable/disable - cant
872 do e17 properly without so add in even in freeze.
diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h
index 0af377f186..17cc0f42f7 100644
--- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h
+++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h
@@ -1707,7 +1707,9 @@ EAPI int ecore_x_screensaver_expose_get(void);
1707EAPI void ecore_x_screensaver_interval_set(int timeout); 1707EAPI void ecore_x_screensaver_interval_set(int timeout);
1708EAPI int ecore_x_screensaver_interval_get(void); 1708EAPI int ecore_x_screensaver_interval_get(void);
1709EAPI void ecore_x_screensaver_event_listen_set(Eina_Bool on); 1709EAPI void ecore_x_screensaver_event_listen_set(Eina_Bool on);
1710 1710EAPI Eina_Bool ecore_x_screensaver_custom_blanking_enable(void); /** @since 1.7 */
1711EAPI Eina_Bool ecore_x_screensaver_custom_blanking_disable(void); /** @since 1.7 */
1712
1711/* FIXME: these funcs need categorising */ 1713/* FIXME: these funcs need categorising */
1712 1714
1713typedef struct _Ecore_X_Window_Attributes 1715typedef struct _Ecore_X_Window_Attributes
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c
index 46fc2b0313..5722b46c52 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c
@@ -1995,7 +1995,8 @@ _ecore_xcb_event_handle_screensaver_notify(xcb_generic_event_t *event)
1995 1995
1996 e->win = ev->window; 1996 e->win = ev->window;
1997 e->on = EINA_FALSE; 1997 e->on = EINA_FALSE;
1998 if (ev->state == XCB_SCREENSAVER_STATE_ON) e->on = EINA_TRUE; 1998 if ((ev->state == XCB_SCREENSAVER_STATE_ON) ||
1999 (ev->state == XCB_SCREENSAVER_STATE_CYCLE)) e->on = EINA_TRUE;
1999 e->time = ev->time; 2000 e->time = ev->time;
2000 2001
2001 ecore_event_add(ECORE_X_EVENT_SCREENSAVER_NOTIFY, e, NULL, NULL); 2002 ecore_event_add(ECORE_X_EVENT_SCREENSAVER_NOTIFY, e, NULL, NULL);
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c
index cb7249f4f1..b48cb9a205 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c
@@ -324,7 +324,9 @@ ecore_x_screensaver_event_listen_set(Eina_Bool on)
324 root = ((xcb_screen_t *)_ecore_xcb_screen)->root; 324 root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
325 if (on) 325 if (on)
326 xcb_screensaver_select_input(_ecore_xcb_conn, root, 326 xcb_screensaver_select_input(_ecore_xcb_conn, root,
327 XCB_SCREENSAVER_EVENT_NOTIFY_MASK); 327 XCB_SCREENSAVER_EVENT_NOTIFY_MASK |
328 XCB_SCREENSAVER_EVENT_CYCLE_MASK
329 );
328 else 330 else
329 xcb_screensaver_select_input(_ecore_xcb_conn, root, 0); 331 xcb_screensaver_select_input(_ecore_xcb_conn, root, 0);
330#endif 332#endif
@@ -336,3 +338,34 @@ ecore_x_screensaver_event_available_get(void)
336 return _screensaver_avail; 338 return _screensaver_avail;
337} 339}
338 340
341EAPI Eina_Bool
342ecore_x_screensaver_custom_blanking_enable(void)
343{
344#ifdef ECORE_XCB_SCREENSAVER
345 uint32_t mask_list[9];
346
347 xcb_screensaver_set_attributes_checked
348 (_ecore_xcb_conn,
349 ((xcb_screen_t *)_ecore_xcb_screen)->root,
350 -9999, -9999, 1, 1, 0,
351 XCB_WINDOW_CLASS_INPUT_ONLY.
352 XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,
353 0, mask_list);
354 return EINA_TRUE;
355#else
356 return EINA_FALSE;
357#endif
358}
359
360EAPI Eina_Bool
361ecore_x_screensaver_custom_blanking_disable(void)
362{
363#ifdef ECORE_XCB_SCREENSAVER
364 xcb_screensaver_unset_attributes_checked
365 (_ecore_xcb_conn,
366 ((xcb_screen_t *)_ecore_xcb_screen)->root);
367 return EINA_TRUE;
368#else
369 return EINA_FALSE;
370#endif
371}
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
index 9d0179302d..7d685cf83f 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -2007,7 +2007,8 @@ _ecore_x_event_handle_screensaver_notify(XEvent *xevent)
2007 return; 2007 return;
2008 2008
2009 e->win = screensaver_event->window; 2009 e->win = screensaver_event->window;
2010 if (screensaver_event->state == ScreenSaverOn) 2010 if ((screensaver_event->state == ScreenSaverOn) ||
2011 (screensaver_event->state == ScreenSaverCycle))
2011 e->on = EINA_TRUE; 2012 e->on = EINA_TRUE;
2012 else 2013 else
2013 e->on = EINA_FALSE; 2014 e->on = EINA_FALSE;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
index 40dd738b72..3688a44c56 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
@@ -162,7 +162,8 @@ ecore_x_screensaver_event_listen_set(Eina_Bool on)
162 LOGFN(__FILE__, __LINE__, __FUNCTION__); 162 LOGFN(__FILE__, __LINE__, __FUNCTION__);
163 root = DefaultRootWindow(_ecore_x_disp); 163 root = DefaultRootWindow(_ecore_x_disp);
164 if (on) 164 if (on)
165 XScreenSaverSelectInput(_ecore_x_disp, root, ScreenSaverNotifyMask); 165 XScreenSaverSelectInput(_ecore_x_disp, root,
166 ScreenSaverNotifyMask | ScreenSaverCycle);
166 else 167 else
167 XScreenSaverSelectInput(_ecore_x_disp, root, 0); 168 XScreenSaverSelectInput(_ecore_x_disp, root, 0);
168#else 169#else
@@ -171,3 +172,33 @@ ecore_x_screensaver_event_listen_set(Eina_Bool on)
171#endif /* ifdef ECORE_XSS */ 172#endif /* ifdef ECORE_XSS */
172} 173}
173 174
175
176EAPI Eina_Bool
177ecore_x_screensaver_custom_blanking_enable(void)
178{
179#ifdef ECORE_XSS
180 XSetWindowAttributes attr;
181
182 XScreenSaverSetAttributes(_ecore_x_disp,
183 DefaultRootWindow(_ecore_x_disp),
184 -9999, -9999, 1, 1, 0,
185 CopyFromParent, InputOnly, CopyFromParent,
186 0, &attr);
187 return EINA_TRUE;
188#else
189 return EINA_FALSE;
190#endif /* ifdef ECORE_XSS */
191}
192
193EAPI Eina_Bool
194ecore_x_screensaver_custom_blanking_disable(void)
195{
196#ifdef ECORE_XSS
197 XScreenSaverUnsetAttributes(_ecore_x_disp,
198 DefaultRootWindow(_ecore_x_disp));
199 return EINA_TRUE;
200#else
201 return EINA_FALSE;
202#endif /* ifdef ECORE_XSS */
203}
204