xserver-multidpi/hw
Lyude Paul e96bd47739 xwayland: Don't process cursor warping without an xwl_seat
Unfortunately, on my machine Xwayland immediately crashes when I try to
start it. gdb backtrace:

 #0  0x00007ffff74f0e79 in wl_proxy_marshal () from target:/lib64/libwayland-client.so.0
 #1  0x0000000000413172 in zwp_confined_pointer_v1_destroy (zwp_confined_pointer_v1=0x700000000)
     at hw/xwayland/Xwayland@exe/pointer-constraints-unstable-v1-client-protocol.h:612
 #2  0x0000000000418bc0 in xwl_seat_destroy_confined_pointer (xwl_seat=0x8ba2a0)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2839
 #3  0x0000000000418c09 in xwl_seat_unconfine_pointer (xwl_seat=0x8ba2a0)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2849
 #4  0x0000000000410d97 in xwl_cursor_confined_to (device=0xa5a000, screen=0x8b9d80, window=0x9bdb70)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland.c:328
 #5  0x00000000004a8571 in ConfineCursorToWindow (pDev=0xa5a000, pWin=0x9bdb70, generateEvents=1,
     confineToScreen=0) at /home/lyudess/Projects/xserver/dix/events.c:900
 #6  0x00000000004a94b7 in ScreenRestructured (pScreen=0x8b9d80)
     at /home/lyudess/Projects/xserver/dix/events.c:1387
 #7  0x0000000000502386 in RRScreenSizeNotify (pScreen=0x8b9d80)
     at /home/lyudess/Projects/xserver/randr/rrscreen.c:160
 #8  0x000000000041a83c in update_screen_size (xwl_output=0x8e7670, width=3840, height=2160)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:203
 #9  0x000000000041a9f0 in apply_output_change (xwl_output=0x8e7670)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:252
 #10 0x000000000041aaeb in xdg_output_handle_done (data=0x8e7670, xdg_output=0x8e7580)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:307
 #11 0x00007ffff50e9d1e in ffi_call_unix64 () at ../src/x86/unix64.S:76
 #12 0x00007ffff50e968f in ffi_call (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>,
     avalue=<optimized out>) at ../src/x86/ffi64.c:525
 #13 0x00007ffff74f3d8b in wl_closure_invoke () from target:/lib64/libwayland-client.so.0
 #14 0x00007ffff74f0928 in dispatch_event.isra () from target:/lib64/libwayland-client.so.0
 #15 0x00007ffff74f1be4 in wl_display_dispatch_queue_pending () from target:/lib64/libwayland-client.so.0
 #16 0x00007ffff74f200b in wl_display_roundtrip_queue () from target:/lib64/libwayland-client.so.0
 #17 0x0000000000418cad in InitInput (argc=12, argv=0x7fffffffd9c8)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2867
 #18 0x00000000004a20e3 in dix_main (argc=12, argv=0x7fffffffd9c8, envp=0x7fffffffda30)
     at /home/lyudess/Projects/xserver/dix/main.c:250
 #19 0x0000000000420cb2 in main (argc=12, argv=0x7fffffffd9c8, envp=0x7fffffffda30)
    at /home/lyudess/Projects/xserver/dix/stubmain.c:34

This appears to be the result of xwl_cursor_confined_to() and
xwl_screen_get_default_seat(). While not against protocol, mutter ends
up sending xdg_output before wl_seat. xwl_screen_get_default_seat()
makes the naïve assumption that we always have a valid seat, we end up
returning a pointer to the empty list itself instead of an actual seat
and causing ourselves to segfault.

So, actually return NULL in xwl_screen_get_default_seat() if the seat
list is empty, and skip any pointer confinement processing in
xwl_cursor_confined_to() when we don't have a seat setup yet.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 98edb9a35e)
2018-02-12 14:53:36 -05:00
..
dmx Unvalidated lengths 2017-10-12 12:25:02 -04:00
kdrive xephyr: Check for host XVideo support before trying to use it 2017-09-22 18:45:59 +02:00
vfb Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xfree86 xf86XvMCScreenInit: Clear pScreenPriv->dixinfo when freeing pAdapt 2018-02-12 14:49:50 -05:00
xnest Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xquartz glx: Fix glXQueryContext for GLX_FBCONFIG_ID and GLX_RENDER_TYPE (v2) 2017-12-13 10:08:40 -05:00
xwayland xwayland: Don't process cursor warping without an xwl_seat 2018-02-12 14:53:36 -05:00
xwin hw/xwin: Add 'dri' to DIST_SUBDIRS 2016-09-16 10:57:23 -07:00
Makefile.am Xwayland DDX 2014-04-03 15:19:22 -07:00