mirror of
https://github.com/labwc/labwc.git
synced 2026-03-30 11:10:41 -04:00
xwayland: flush X11 connection after focus/activate
This mitigates a race where the XWayland server may generate an unwanted FocusOut event for the newly activated window, if it receives mouse/ pointer events over the parallel wayland connection first. In particular, this fixes an issue with certain fullscreen applications (such as Minecraft) that self-minimize when receiving FocusOut. Also limit a previous similar workaround to apply only to XWayland views. Fixes: #3344 See also: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/4044
This commit is contained in:
parent
12b6d05481
commit
81778a16bb
2 changed files with 11 additions and 1 deletions
|
|
@ -2242,7 +2242,9 @@ view_move_to_front(struct view *view)
|
||||||
* to an incorrect X window depending on timing. To mitigate the
|
* to an incorrect X window depending on timing. To mitigate the
|
||||||
* race, perform an explicit flush after restacking.
|
* race, perform an explicit flush after restacking.
|
||||||
*/
|
*/
|
||||||
xwayland_flush(view->server);
|
if (view->type == LAB_XWAYLAND_VIEW) {
|
||||||
|
xwayland_flush(view->server);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
cursor_update_focus(view->server);
|
cursor_update_focus(view->server);
|
||||||
desktop_update_top_layer_visibility(view->server);
|
desktop_update_top_layer_visibility(view->server);
|
||||||
|
|
|
||||||
|
|
@ -946,6 +946,14 @@ xwayland_view_set_activated(struct view *view, bool activated)
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_xwayland_surface_activate(xwayland_surface, activated);
|
wlr_xwayland_surface_activate(xwayland_surface, activated);
|
||||||
|
/*
|
||||||
|
* Make sure that the X11-protocol messages (SetInputFocus etc.)
|
||||||
|
* are sent immediately. This mitigates a race where the XWayland
|
||||||
|
* server may generate an unwanted FocusOut event for the newly
|
||||||
|
* activated window, if it receives mouse/pointer events over the
|
||||||
|
* parallel wayland connection first.
|
||||||
|
*/
|
||||||
|
xwayland_flush(view->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue