devilhorns pushed a commit to branch master.

commit a233f23c2f62eabe7cfb946fbe4c40a4dadd5e71
Author: Chris Michael <[email protected]>
Date:   Thu Jul 18 11:03:53 2013 +0100

    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 <[email protected]>
---
 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 8d28947..ee2f16e 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)

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to