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. Commit59ad0e6a
("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@kylinos.cn> Fixes:59ad0e6a
- xwayland: Fix use after free of cursors Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
parent
9ce7264889
commit
92a00f5221
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue