raster pushed a commit to branch master.

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

commit 591a3752e6f11904641c80cd73b36d61d0d7ecd5
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sat May 16 23:18:32 2015 +0900

    e randr2 - add some logic for knowing when to ask to configure a screen
    
    start of a "what do you want to do with this screen (clone, extend etc.)"
    feature
---
 src/modules/conf_randr/e_mod_main.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/modules/conf_randr/e_mod_main.c 
b/src/modules/conf_randr/e_mod_main.c
index 9cb09b3..8aa8e20 100644
--- a/src/modules/conf_randr/e_mod_main.c
+++ b/src/modules/conf_randr/e_mod_main.c
@@ -7,6 +7,25 @@ E_API E_Module_Api e_modapi =
    E_MODULE_API_VERSION, "Settings - Screen Setup"
 };
 
+static Ecore_Event_Handler *randr_event_hand = NULL;
+
+static Eina_Bool
+_cb_randr(void *data EINA_UNUSED, int type EINA_UNUSED, void *info EINA_UNUSED)
+{
+   Eina_List *l;
+   E_Randr2_Screen *s;
+
+   EINA_LIST_FOREACH(e_randr2->screens, l, s)
+     {
+        if (!s->config.configured)
+          {
+             // XXX: we should put up a dialog asking to configure screen s
+             printf("RRR: New unconfigured screen on %s\n", s->info.name);
+          }
+     }
+   return EINA_TRUE;
+}
+
 E_API void *
 e_modapi_init(E_Module *m)
 {
@@ -21,6 +40,8 @@ e_modapi_init(E_Module *m)
    e_configure_registry_item_add("screen/screen_setup", 20, _("Screen Setup"),
                                  NULL, "preferences-system-screen-resolution",
                                  e_int_config_randr2);
+   randr_event_hand = ecore_event_handler_add(E_EVENT_RANDR_CHANGE,
+                                              _cb_randr, NULL);
    return m;
 }
 
@@ -29,6 +50,12 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
 {
    E_Config_Dialog *cfd;
 
+   if (randr_event_hand)
+     {
+        ecore_event_handler_del(randr_event_hand);
+        randr_event_hand = NULL;
+     }
+
    while ((cfd = e_config_dialog_get("E", "screen/screen_setup")))
      e_object_del(E_OBJECT(cfd));
 

-- 


Reply via email to