From a233f23c2f62eabe7cfb946fbe4c40a4dadd5e71 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 18 Jul 2013 11:03:53 +0100 Subject: [PATCH] Remove call to display_iterate during init (this stalls our compositor due to code reuse and is not needed from the client side anyway). Add function for setting "server mode" (this will allow us to avoid any display_iterate calls which would block our compositor). Signed-off-by: Chris Michael --- src/lib/ecore_wayland/ecore_wl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index 8d28947a5a..ee2f16e1c6 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c @@ -26,6 +26,7 @@ static void _ecore_wl_signal_exit_free(void *data EINA_UNUSED, void *event); static int _ecore_wl_init_count = 0; static Eina_Bool _ecore_wl_animator_busy = EINA_FALSE; static Eina_Bool _ecore_wl_fatal_error = EINA_FALSE; +static Eina_Bool _ecore_wl_server_mode = EINA_FALSE; static const struct wl_registry_listener _ecore_wl_registry_listener = { @@ -164,8 +165,6 @@ ecore_wl_init(const char *name) wl_registry_add_listener(_ecore_wl_disp->wl.registry, &_ecore_wl_registry_listener, _ecore_wl_disp); - ecore_wl_display_iterate(); - if (!_ecore_wl_xkb_init(_ecore_wl_disp)) { ERR("Could not initialize XKB"); @@ -293,7 +292,8 @@ ecore_wl_dpi_get(void) EAPI void ecore_wl_display_iterate(void) { - wl_display_dispatch(_ecore_wl_disp->wl.display); + if (!_ecore_wl_server_mode) + wl_display_dispatch(_ecore_wl_disp->wl.display); } /* @since 1.8 */ @@ -337,6 +337,12 @@ ecore_wl_cursor_get(const char *cursor_name) cursor_name); } +EAPI void +ecore_wl_server_mode_set(Eina_Bool on) +{ + _ecore_wl_server_mode = on; +} + /* local functions */ static Eina_Bool _ecore_wl_shutdown(Eina_Bool close)