[PATCH xserver 3/5] xwayland: process Wayland events after adding screen

Olivier Fourdan ofourdan at redhat.com
Tue Jun 5 17:37:56 UTC 2018


When we're done adding a new screen, we need to process any pending
Wayland events again.

Hence we don't end up processing xdg_output events unexpectedly when
glamor is disabled. Be that because "-shm" was passed or "-eglstream"
has failed.

Failing to do that could lead to a crash at startup:

    Xwayland: dixGetPrivateAddr: Assertion `key->initialized' failed.
    (EE)
    (EE) Backtrace:
    (EE) 0: Xwayland (OsSigHandler)
    (EE) 1: libpthread.so.0 (funlockfile)
    (EE) 2: libc.so.6 (gsignal)
    (EE) 3: libc.so.6 (abort)
    (EE) 4: libc.so.6 (?+0x0)
    (EE) 5: libc.so.6 (__assert_fail)
    (EE) 6: Xwayland (dixGetPrivateAddr)
    (EE) 7: Xwayland (_fbGetWindowPixmap)
    (EE) 8: Xwayland (getDrawableDamageRef)
    (EE) 9: Xwayland (damageRegionProcessPending)
    (EE) 10: Xwayland (damagePolyFillRect)
    (EE) 11: Xwayland (miPaintWindow)
    (EE) 12: Xwayland (miWindowExposures)
    (EE) 13: Xwayland (miHandleValidateExposures)
    (EE) 14: Xwayland (SetRootClip)
    (EE) 15: Xwayland (update_screen_size)
    (EE) 16: Xwayland (apply_output_change)
    (EE) 17: libffi.so.6 (ffi_call_unix64)
    (EE) 18: libffi.so.6 (ffi_call)
    (EE) 19: libwayland-client.so.0 (wl_log_set_handler_client)
    (EE) 20: libwayland-client.so.0 (_init)
    (EE) 21: libwayland-client.so.0 (wl_display_dispatch_queue_pending)
    (EE) 22: libwayland-client.so.0 (wl_display_roundtrip_queue)
    (EE) 23: Xwayland (InitInput)
    (EE) 24: Xwayland (dix_main)
    (EE) 25: libc.so.6 (__libc_start_main)
    (EE) 26: Xwayland (_start)
    (EE)
    (EE)
    Fatal server error:
    (EE) Caught signal 6 (Aborted). Server aborting
    (EE)
    Aborted (core dumped)

Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Reviewed-by: Lyude Paul <lyude at redhat.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
---
 hw/xwayland/xwayland.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index d9548a874..9121ef666 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1132,6 +1132,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
 
     AddCallback(&PropertyStateCallback, xwl_property_callback, pScreen);
 
+    wl_display_roundtrip(xwl_screen->display);
+    while (xwl_screen->expecting_event)
+        wl_display_roundtrip(xwl_screen->display);
+
     return ret;
 }
 
-- 
2.17.1



More information about the xorg-devel mailing list