summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-05-22 12:12:36 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-05-22 12:12:36 +0900
commit86d650c3ab5f079ed4028ff55901c042960e35d4 (patch)
tree2115ef13280cbb477dbc68547523549c04d62e9e
parentb16ab94b37d1c06eea05e4b8c124ec1a2f1d0b07 (diff)
elm config - init wl if env vars indicate we should
this ensures event id's are initted and more if we are in wl mode like in x11 mode @fix
-rw-r--r--src/lib/elm_config.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index fce54ee74..9e90f59cb 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -3264,9 +3264,12 @@ _elm_config_sub_shutdown(void)
3264void 3264void
3265_elm_config_sub_init(void) 3265_elm_config_sub_init(void)
3266{ 3266{
3267#ifdef HAVE_ELEMENTARY_X 3267#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WAYLAND)
3268 Eina_Bool init_x;
3269 const char *ev = getenv("ELM_DISPLAY"); 3268 const char *ev = getenv("ELM_DISPLAY");
3269#endif
3270
3271#ifdef HAVE_ELEMENTARY_X
3272 Eina_Bool init_x = EINA_FALSE;
3270 Eina_Bool have_display = !!getenv("DISPLAY"); 3273 Eina_Bool have_display = !!getenv("DISPLAY");
3271 3274
3272 if (ev) /* If ELM_DISPLAY is specified */ 3275 if (ev) /* If ELM_DISPLAY is specified */
@@ -3346,6 +3349,37 @@ _elm_config_sub_init(void)
3346 else ERR("Cannot connect to X11 display. check $DISPLAY variable"); 3349 else ERR("Cannot connect to X11 display. check $DISPLAY variable");
3347 } 3350 }
3348#endif 3351#endif
3352#ifdef HAVE_ELEMENTARY_WAYLAND
3353 Eina_Bool init_wl = EINA_FALSE;
3354 Eina_Bool have_wl_display = !!getenv("WAYLAND_DISPLAY");
3355
3356 if (ev) /* If ELM_DISPLAY is specified */
3357 {
3358 if (!strcmp(ev, "wl")) /* and it is X11 */
3359 {
3360 if (!have_wl_display) /* if there is no $DISPLAY */
3361 {
3362 ERR("$ELM_DISPLAY is set to wl but $WAYLAND_DISPLAY is not set");
3363 init_wl = EINA_FALSE;
3364 }
3365 else /* if there is */
3366 init_wl = EINA_TRUE;
3367 }
3368 else /* not wl */
3369 init_wl = EINA_FALSE;
3370 }
3371 else /* ELM_DISPLAY not specified */
3372 {
3373 if (have_wl_display) /* If there is a $WAYLAND_DISPLAY */
3374 init_wl = EINA_TRUE;
3375 else /* No $WAYLAND_DISPLAY */
3376 init_wl = EINA_FALSE;
3377 }
3378 if (init_wl)
3379 {
3380 ecore_wl_init(NULL);
3381 }
3382#endif
3349 _config_sub_apply(); 3383 _config_sub_apply();
3350} 3384}
3351 3385