xwayland: Fix stuck focus on XwaylandKeyboardGrabs

This commit is contained in:
Victoria Brekenfeld 2024-03-21 12:52:43 +01:00 • committed by Victoria Brekenfeld
parent 8137b96893
commit 9f8fc6456c

View file

@ -877,13 +877,11 @@ impl State {
let serial = SERIAL_COUNTER.next_serial(); let serial = SERIAL_COUNTER.next_serial();
let button = event.button_code(); let button = event.button_code();
if event.state() == ButtonState::Pressed { if event.state() == ButtonState::Pressed {
// change the keyboard focus unless the pointer or keyboard is grabbed // change the keyboard focus unless the pointer is grabbed
// We test for any matching surface type here but always use the root // We test for any matching surface type here but always use the root
// (in case of a window the toplevel) surface for the focus. // (in case of a window the toplevel) surface for the focus.
// see: https://gitlab.freedesktop.org/wayland/wayland/-/issues/294 // see: https://gitlab.freedesktop.org/wayland/wayland/-/issues/294
if !seat.get_pointer().unwrap().is_grabbed() if !seat.get_pointer().unwrap().is_grabbed() {
&& !seat.get_keyboard().map(|k| k.is_grabbed()).unwrap_or(false)
{
let output = seat.active_output(); let output = seat.active_output();
let pos = seat.get_pointer().unwrap().current_location().as_global(); let pos = seat.get_pointer().unwrap().current_location().as_global();