[PATCH xserver 4/4] xwayland: sync event queue to check compositor reply

Olivier Fourdan ofourdan at redhat.com
Wed Mar 9 09:42:32 UTC 2016


----- Original Message -----
> Read and dispatch pending Wayland events to make sure we do nto miss a
> possible reply from the compositor prior to discard a key repeat.
> 
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> ---
>  hw/xwayland/xwayland-input.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
> index 28d8b54..89f6faf 100644
> --- a/hw/xwayland/xwayland-input.c
> +++ b/hw/xwayland/xwayland-input.c
> @@ -546,6 +546,9 @@ keyboard_check_repeat (DeviceIntPtr dev, XkbSrvInfoPtr
> xkbi, unsigned key)
>      struct xwl_screen *xwl_screen = xwl_seat->xwl_screen;
>      struct wl_callback *callback;
>  
> +    /* Make sure we didn't miss a possible reply from the compositor */
> +    xwl_sync_events (xwl_screen);
> +

Unfortunately it still cause a deadlock apprently:

#0  0x00007fab4b6f93a0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fab4df3249b in read_events (display=0x17f7b80) at src/wayland-client.c:1326
#2  wl_display_read_events (display=0x17f7b80) at src/wayland-client.c:1396
#3  0x0000000000423e34 in xwl_read_events (xwl_screen=<optimized out>, xwl_screen=<optimized out>) at xwayland.c:465
#4  0x0000000000424adf in xwl_sync_events (xwl_screen=xwl_screen at entry=0x17f7910) at xwayland.c:524
#5  0x0000000000424e15 in keyboard_check_repeat (dev=<optimized out>, xkbi=<optimized out>, key=<optimized out>) at xwayland-input.c:536
#6  0x0000000000525417 in AccessXRepeatKeyExpire (timer=<optimized out>, now=<optimized out>, arg=0x22c61f0) at xkbAccessX.c:321
#7  0x000000000058b6c3 in DoTimer (timer=0x2923510, now=now at entry=3317763, prev=prev at entry=0x81f6f8 <timers>) at WaitFor.c:420
#8  0x000000000058c36a in WaitForSomething (pClientsReady=pClientsReady at entry=0x17efab0) at WaitFor.c:291
#9  0x00000000005572ee in Dispatch () at dispatch.c:359
#10 0x000000000055b503 in dix_main (argc=10, argv=0x7ffca1cbd528, envp=<optimized out>) at main.c:300
#11 0x00007fab4bfaa0c1 in __libc_start_main () from /lib64/libc.so.6
#12 0x0000000000423599 in _start ()

And that will freeze both the Xwayland server and the compositor, so not good.



>      if (!xwl_seat->sync_pending) {
>          callback = wl_display_sync (xwl_screen->display);
>          wl_callback_add_listener(callback, &sync_listener, xwl_seat);
> --
> 2.5.0



More information about the xorg-devel mailing list