xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 27 13:09:50 UTC 2022


 hw/xwayland/xwayland-input.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 92a00f52217b71107dcdc39cfaf56f77a41b42b1
Author: Morose <chenlinxiang at kylinos.cn>
Date:   Thu Jun 23 09:52:24 2022 +0800

    xwayland: Fix check logic in sprite_check_lost_focus()
    
    When the pointer leaves an X11 window, and enters a Wayland native
    window, Xwayland has no idea about Wayland native windows and may
    generate the wrong crossing events to another X11 window instead.
    
    To avoid that issue, Xwayland implements its own XYToWindow() handler to
    compare the Wayland focused surface with the X11 window found in the
    window tree.
    
    Commit 59ad0e6a ("xwayland: Fix use after free of cursors") changed the
    logic in sprite_check_lost_focus() to use IsParent() to compare the
    windows, which works when the X11 window is reparented by the window
    manager, but fails in the case of an override redirect window.
    
    To fix the issue, also check whether last_xwindow is the window itself.
    
    Signed-off-by: Morose <chenlinxiang at kylinos.cn>
    Fixes: 59ad0e6a - xwayland: Fix use after free of cursors
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 672647f71..eda69a193 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -2935,7 +2935,7 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
 
     if (xwl_seat->focus_window == NULL &&
         xwl_seat->last_xwindow != NullWindow &&
-        IsParent(xwl_seat->last_xwindow, window))
+        (IsParent(xwl_seat->last_xwindow, window) || xwl_seat->last_xwindow == window))
         return TRUE;
 
     return FALSE;


More information about the xorg-commit mailing list