do not start xwayland repeatedly

ref 0534c7ae6f
This commit is contained in:
Mike Blumenkrantz 2017-03-10 15:57:15 -05:00
parent 45683d3fcd
commit 1ab1d82904
1 changed files with 10 additions and 10 deletions

View File

@ -10,7 +10,7 @@ EINTERN void dnd_init(void);
EINTERN void dnd_shutdown(void);
static Ecore_Event_Handler *sync_handler;
static E_Module *xwl_init(E_Module *m);
static Eina_Bool xwl_init(void *d EINA_UNUSED);
static void xwl_shutdown(void);
/* local structures */
@ -350,25 +350,25 @@ _cb_sync_done(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNU
return EINA_FALSE;
}
static E_Module *
xwl_init(E_Module *m)
static Eina_Bool
xwl_init(void *d EINA_UNUSED)
{
char disp[8];
/* make sure it's a wayland compositor */
if (e_comp->comp_type == E_PIXMAP_TYPE_X) return NULL;
if (e_comp->comp_type == E_PIXMAP_TYPE_X) return EINA_FALSE;
if (getenv("DISPLAY"))
{
sync_handler = ecore_event_handler_add(ECORE_WL2_EVENT_SYNC_DONE, _cb_sync_done, NULL);
return NULL;
return EINA_FALSE;
}
DBG("LOAD XWAYLAND MODULE");
/* alloc space for server struct */
if (!(exs = calloc(1, sizeof(E_XWayland_Server))))
return NULL;
return EINA_FALSE;
#ifdef HAVE_PULSE
#ifdef EFL_VERSION_1_19
@ -386,7 +386,7 @@ xwl_init(E_Module *m)
do
{
if (!setup_lock()) return NULL;
if (!setup_lock()) return EINA_FALSE;
/* try to bind abstract socket */
exs->abs_fd = _abstract_socket_bind(exs->disp);
@ -404,7 +404,7 @@ xwl_init(E_Module *m)
unlink(exs->lock);
close(exs->abs_fd);
free(exs);
return NULL;
return EINA_FALSE;
}
break;
} while (1);
@ -425,7 +425,7 @@ xwl_init(E_Module *m)
/* setup listener for SIGUSR1 */
exs->sig_hdlr =
ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _cb_signal_event, exs);
return m;
return EINA_FALSE;
}
static void
@ -459,7 +459,7 @@ E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "XWayland" };
E_API void *
e_modapi_init(E_Module *m)
{
ecore_timer_loop_add(2.0, (Ecore_Task_Cb)xwl_init, m);
ecore_timer_loop_add(2.0, xwl_init, NULL);
return m;
}