dpms, screensaver and desklock now respect "presentation" mode.
authorGustavo Sverzut Barbieri <barbieri@gmail.com>
Sat, 25 Apr 2009 16:49:53 +0000 (16:49 +0000)
committerGustavo Sverzut Barbieri <barbieri@gmail.com>
Sat, 25 Apr 2009 16:49:53 +0000 (16:49 +0000)
Wow, no need to go to "Settings" and then 3 dialogs to do my presentations!

SVN revision: 40381

src/bin/e_desklock.c
src/bin/e_dpms.c
src/bin/e_screensaver.c

index 544195a..6452c8e 100644 (file)
@@ -865,7 +865,7 @@ _e_desklock_cb_custom_desklock_exit(void *data, int type, void *event)
 static int 
 _e_desklock_cb_idle_poller(void *data)
 {
-   if (e_config->desklock_autolock_idle)
+   if ((e_config->desklock_autolock_idle) && (!e_config->mode.presentation))
      {
        /* If a desklock is already up, bail */
         if ((_e_custom_desklock_exe) || (edd)) return 1;
index d8c8e01..5450b0d 100644 (file)
@@ -2,13 +2,29 @@
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
 #include "e.h"
+
+static Ecore_Event_Handler *_e_dpms_handler_config_mode = NULL;
+
+static int
+_e_dpms_handler_config_mode_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
+{
+   e_dpms_init();
+   return 1;
+}
+
 EAPI int
 e_dpms_init(void)
 {
    int standby=0, suspend=0, off=0;
-    
-   ecore_x_dpms_enabled_set(e_config->dpms_enable);
+   int enabled = ((e_config->dpms_enable) && (!e_config->mode.presentation));
+
+   if (!_e_dpms_handler_config_mode)
+     _e_dpms_handler_config_mode = ecore_event_handler_add
+       (E_EVENT_CONFIG_MODE_CHANGED, _e_dpms_handler_config_mode_cb, NULL);
+
+   ecore_x_dpms_enabled_set(enabled);
+   if (!enabled)
+     return 1;
 
    if (e_config->dpms_standby_enable)
      standby = e_config->dpms_standby_timeout;
index 01a61ed..6ed2b08 100644 (file)
@@ -2,13 +2,26 @@
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
 #include "e.h"
+
+static Ecore_Event_Handler *_e_screensaver_handler_config_mode = NULL;
+
+static int
+_e_screensaver_handler_config_mode_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
+{
+   e_screensaver_init();
+   return 1;
+}
+
 EAPI int
 e_screensaver_init(void)
 {
    int timeout=0, interval=0, blanking=0, expose=0;
-    
-   if (e_config->screensaver_enable)
+
+   if (!_e_screensaver_handler_config_mode)
+     _e_screensaver_handler_config_mode = ecore_event_handler_add
+       (E_EVENT_CONFIG_MODE_CHANGED, _e_screensaver_handler_config_mode_cb, NULL);
+
+   if ((e_config->screensaver_enable) && (!e_config->mode.presentation))
      timeout = e_config->screensaver_timeout;
    
    interval = e_config->screensaver_interval;