egl/wayland: Don't block on EGL_DEFAULT_DISPAY under wayland
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 26 Feb 2013 17:49:40 +0000 (12:49 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 26 Feb 2013 17:49:49 +0000 (12:49 -0500)
Normally the application will own the main event queue and be responsible
for moving events.  In case of EGL_DEFAULT_DISPLAY, EGL opens the display
and has to own the main queue so it can move the events itself.
Call wl_display_dispatch_pending() to take ownership.

src/egl/drivers/dri2/platform_wayland.c

index 99d8729cfc19f03e4a6c702d7687fcef730e7efb..6e702abe8957a54fcd23388a7bf841f22dd10e0a 100644 (file)
@@ -679,6 +679,10 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
    }
 
    dri2_dpy->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
+
+   if (dri2_dpy->own_device)
+      wl_display_dispatch_pending(dri2_dpy->wl_dpy);
+
    dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy);
    wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_registry,
                       dri2_dpy->wl_queue);