Improved handling of XWayland grabs

A solution for https://github.com/Smithay/smithay/issues/1714.

With this, the lock screen is able to get keyboard focus normally, but
focus then reverts to the XWayland grab surface. This can be tested with
the example client from the issue.

Adding a new variant of `KeyboardFocusTarget` is annoying. Maybe it
could map to a different variant of the enum. But it presumably needs to
handle any `wl_surface` XWayland uses. (Override redirect surfaces?
Subsurfaces?) This seems as good as anything for now.
This commit is contained in:
Ian Douglas Scott 2025-05-05 19:40:56 -07:00 committed by Victoria Brekenfeld
parent 791bcac2fd
commit 30d68af051
5 changed files with 78 additions and 4 deletions

View file

@ -344,6 +344,7 @@ fn format_keyboard_focus(focus: Option<KeyboardFocusTarget>) -> String {
Some(Popup(x)) => format!("Popup {}", x.wl_surface().id().protocol_id()),
Some(Group(_)) => format!("Window Group"),
Some(LockSurface(x)) => format!("LockSurface {}", x.wl_surface().id().protocol_id()),
Some(XWaylandGrab(x)) => format!("XWayland Grab {}", x.id().protocol_id()),
None => format!("None"),
}
}