forked from enlightenment/efl
Do not call ecore_x_init() when not using X display.
Summary: On some systems (e.g. OS X), both Apple's windows manager and X11 can cohabit, therefore we need to check for the DISPLAY environment variable only when ELM_DISPLAY is not specified. Reviewers: cedric, devilhorns, seoz, raster Reviewed By: raster Differential Revision: https://phab.enlightenment.org/D1721
This commit is contained in:
parent
49b60d746c
commit
ab0a1bda94
|
@ -3226,9 +3226,34 @@ void
|
||||||
_elm_config_sub_init(void)
|
_elm_config_sub_init(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ELEMENTARY_X
|
#ifdef HAVE_ELEMENTARY_X
|
||||||
|
Eina_Bool init_x;
|
||||||
const char *ev = getenv("ELM_DISPLAY");
|
const char *ev = getenv("ELM_DISPLAY");
|
||||||
if (((ev) && (!strcmp(ev, "x11")) && (getenv("DISPLAY"))) ||
|
Eina_Bool have_display = !!getenv("DISPLAY");
|
||||||
(getenv("DISPLAY")))
|
|
||||||
|
if (ev) /* If ELM_DISPLAY is specified */
|
||||||
|
{
|
||||||
|
if (!strcmp(ev, "x11")) /* and it is X11 */
|
||||||
|
{
|
||||||
|
if (!have_display) /* if there is no $DISPLAY */
|
||||||
|
{
|
||||||
|
ERR("$ELM_DISPLAY is set to x11 but $DISPLAY is not set");
|
||||||
|
init_x = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else /* if there is */
|
||||||
|
init_x = EINA_TRUE;
|
||||||
|
}
|
||||||
|
else /* not X11 */
|
||||||
|
init_x = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else /* ELM_DISPLAY not specified */
|
||||||
|
{
|
||||||
|
if (have_display) /* If there is a $DISPLAY */
|
||||||
|
init_x = EINA_TRUE;
|
||||||
|
else /* No $DISPLAY */
|
||||||
|
init_x = EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (init_x)
|
||||||
{
|
{
|
||||||
if (ecore_x_init(NULL))
|
if (ecore_x_init(NULL))
|
||||||
{
|
{
|
||||||
|
|
|
@ -957,9 +957,34 @@ elm_quicklaunch_fork(int argc,
|
||||||
_elm_config_sub_init();
|
_elm_config_sub_init();
|
||||||
# ifdef HAVE_ELEMENTARY_X
|
# ifdef HAVE_ELEMENTARY_X
|
||||||
{
|
{
|
||||||
|
Eina_Bool init_x;
|
||||||
const char *ev = getenv("ELM_DISPLAY");
|
const char *ev = getenv("ELM_DISPLAY");
|
||||||
if (((ev) && (!strcmp(ev, "x11")) && (getenv("DISPLAY"))) ||
|
Eina_Bool have_display = !!getenv("DISPLAY");
|
||||||
(getenv("DISPLAY")))
|
|
||||||
|
if (ev) /* If ELM_DISPLAY is specified */
|
||||||
|
{
|
||||||
|
if (!strcmp(ev, "x11")) /* and it is X11 */
|
||||||
|
{
|
||||||
|
if (!have_display) /* if there is no $DISPLAY */
|
||||||
|
{
|
||||||
|
ERR("$ELM_DISPLAY is set to x11 but $DISPLAY"
|
||||||
|
" is not set");
|
||||||
|
init_x = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else /* if there is */
|
||||||
|
init_x = EINA_TRUE;
|
||||||
|
}
|
||||||
|
else /* not X11 */
|
||||||
|
init_x = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else /* ELM_DISPLAY not specified */
|
||||||
|
{
|
||||||
|
if (have_display) /* If there is a $DISPLAY */
|
||||||
|
init_x = EINA_TRUE;
|
||||||
|
else /* No $DISPLAY */
|
||||||
|
init_x = EINA_FALSE;
|
||||||
|
}
|
||||||
|
if (init_x)
|
||||||
ecore_x_init(NULL);
|
ecore_x_init(NULL);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Reference in New Issue