aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2013-02-19 11:01:08 +0000
committerChristopher Michael <cpmichael1@comcast.net>2013-02-19 11:01:08 +0000
commitbf6d1d43ae9a98437784ba4897f8d99369bc0785 (patch)
tree1a76ebdc4ac5b46c00edcfdbd124ea830e233eed /src
parent3ff49b211e6f1350fbc2f405f48e403f7d927250 (diff)
downloadenlightenment-bf6d1d43ae9a98437784ba4897f8d99369bc0785.tar.gz
enlightenment-bf6d1d43ae9a98437784ba4897f8d99369bc0785.tar.xz
enlightenment-bf6d1d43ae9a98437784ba4897f8d99369bc0785.zip
Start on poller code.
Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84226
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_randr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bin/e_randr.c b/src/bin/e_randr.c
index f3d47fb23..67878f293 100644
--- a/src/bin/e_randr.c
+++ b/src/bin/e_randr.c
@@ -12,11 +12,14 @@ static Eina_Bool _e_randr_event_cb_crtc_change(void *data EINA_UNUSED, int type
static Eina_Bool _e_randr_event_cb_output_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
static Eina_Bool _e_randr_event_cb_property_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
+static Eina_Bool _e_randr_poller_cb_check(void *data EINA_UNUSED);
+
/* local variables */
static Eina_List *_randr_event_handlers = NULL;
static E_Config_DD *_e_randr_edd = NULL;
static E_Config_DD *_e_randr_crtc_edd = NULL;
static E_Config_DD *_e_randr_output_edd = NULL;
+static Ecore_Poller *_e_randr_poller = NULL;
/* external variables */
EAPI E_Randr_Config *e_randr_cfg = NULL;
@@ -60,6 +63,12 @@ e_randr_init(void)
_e_randr_event_cb_property_change, NULL);
}
+ /* setup poller for when hotplug events happen and the video card
+ * may not report them */
+ _e_randr_poller =
+ ecore_poller_add(ECORE_POLLER_CORE, e_randr_cfg->poll_interval,
+ _e_randr_poller_cb_check, NULL);
+
return EINA_TRUE;
}
@@ -69,6 +78,9 @@ e_randr_shutdown(void)
/* check if randr is available */
if (!ecore_x_randr_query()) return 1;
+ /* remove the poller */
+ if (_e_randr_poller) ecore_poller_del(_e_randr_poller);
+
if (ecore_x_randr_version_get() >= E_RANDR_VERSION_1_2)
{
Ecore_X_Window root = 0;
@@ -591,3 +603,9 @@ _e_randr_event_cb_property_change(void *data EINA_UNUSED, int type EINA_UNUSED,
printf("E_RANDR Event: Property Change\n");
return ECORE_CALLBACK_RENEW;
}
+
+static Eina_Bool
+_e_randr_poller_cb_check(void *data EINA_UNUSED)
+{
+ return ECORE_CALLBACK_RENEW;
+}