xserver: Branch 'xwayland-24.1'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 10 11:39:27 UTC 2024


 hw/xwayland/xwayland-input.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 8130fa083c535f5debcde5130283288aa7fac1e7
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Jul 4 13:29:58 2024 +0200

    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 at redhat.com>
    (cherry picked from commit 72036261738c10d718cb42696289ae85b7f6f703)
    
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1592>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 7447de102..4b8f22a03 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -595,6 +595,9 @@ xwl_seat_leave_ptr(struct xwl_seat *xwl_seat, Bool focus_lost)
 {
     DeviceIntPtr dev = get_pointer_device(xwl_seat);
 
+    if (!dev)
+        return;
+
     if (focus_lost)
         CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT));
 


More information about the xorg-commit mailing list