xserver/hw
Olivier Fourdan 64a8365213 xwayland: Check for pointer in xwl_seat_leave_ptr()
Since commit 792758fa ("xwayland: Update lost focus on deactivation"),
in rootful mode, if we receive an "activated" state from xdg-shell
indicating that the surface is no longer active, we shall end up calling
xwl_seat_leave_ptr().

But xwl_seat_leave_ptr() does not actually check whether the seat has
pointer capabilities, and if not, get_pointer_device() will return NULL.

As a result, we would crash using a NULL pointer in GetMaster(). This
typically can happen when using Xwayland rootful on headless compositors
such as "cage" which do not advertise any capabilities for the seat.

To avoid the issue, simply check whether get_pointer_device() returns a
valid non-null device and bail out early otherwise.

Fixes: 792758fa - xwayland: Update lost focus on deactivation
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1700
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1590>
(cherry picked from commit 7203626173)
2026-01-25 10:39:55 -08:00
..
kdrive kdrive: drop Solaris specific hack 2026-01-25 10:39:53 -08:00
vfb Xvfb: Support up to 13 mouse buttons 2024-01-08 11:16:11 +00:00
xfree86 modesetting: Fix hang when all probed cursor sizes fail to find a minimum one 2026-01-25 10:39:54 -08:00
xnest rename remaining RT_* defines to X11_RESTYPE_* 2026-01-19 12:48:30 -08:00
xquartz xquartz: Remove invalid Unicode sequence 2026-01-25 10:39:53 -08:00
xwayland xwayland: Check for pointer in xwl_seat_leave_ptr() 2026-01-25 10:39:55 -08:00
xwin rename remaining RT_* defines to X11_RESTYPE_* 2026-01-19 12:48:30 -08:00
meson.build Drop DMX DDX 2021-09-07 09:34:31 +00:00