Skip to content
Snippets Groups Projects
Commit 92a00f52 authored by Morose's avatar Morose Committed by Olivier Fourdan
Browse files

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: default avatarMorose <chenlinxiang@kylinos.cn>
Fixes: 59ad0e6a - xwayland: Fix use after free of cursors
Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
parent 9ce72648
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment