From c2d4ef40870dc2a16a02249e132428a2f2c1716e Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sun, 4 May 2025 12:52:30 +0200 Subject: [PATCH 1/2] Revert "fix: panel items being grabbed by keyboard seat" This reverts commit a58ab46f4a2606530ffbf3d2ba35cc09204bc229. --- src/wayland/seat.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wayland/seat.rs b/src/wayland/seat.rs index 53fcba8..b525f33 100644 --- a/src/wayland/seat.rs +++ b/src/wayland/seat.rs @@ -240,7 +240,6 @@ impl SeatWrapper { 0, |_, _, _| FilterResult::Forward::<()>, ); - keyboard.set_focus(&mut state.lock(), None, SERIAL_COUNTER.next_serial()); } pub fn touch_down(&self, surface: WlSurface, id: u32, position: Vector2) { -- 2.49.1 From 9cc3a603c9d4f3d203bf27f98c3d0edfd9f441cc Mon Sep 17 00:00:00 2001 From: Schmarni Date: Tue, 6 May 2025 00:31:01 +0200 Subject: [PATCH 2/2] fix(wayland): fix keyboard holding onto surfaces without causing visual or functional issues Signed-off-by: Schmarni --- src/wayland/seat.rs | 6 ++++++ src/wayland/xdg_shell.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/wayland/seat.rs b/src/wayland/seat.rs index b525f33..d8d85f2 100644 --- a/src/wayland/seat.rs +++ b/src/wayland/seat.rs @@ -108,6 +108,12 @@ impl SeatWrapper { touches: Mutex::new(FxHashMap::default()), } } + pub fn unfocus_internal_state(&self, surface: &WlSurface) { + let Some(state) = self.wayland_state.upgrade() else { + return; + }; + self.unfocus(surface, &mut state.lock()); + } pub fn unfocus(&self, surface: &WlSurface, state: &mut WaylandState) { let pointer = self.seat.get_pointer().unwrap(); if pointer.current_focus() == Some(surface.clone()) { diff --git a/src/wayland/xdg_shell.rs b/src/wayland/xdg_shell.rs index e50561b..70d6656 100644 --- a/src/wayland/xdg_shell.rs +++ b/src/wayland/xdg_shell.rs @@ -472,6 +472,7 @@ impl Backend for XdgBackend { fn close_toplevel(&self) { if let Some(toplevel) = self.toplevel.lock().clone() { + self.seat.unfocus_internal_state(toplevel.wl_surface()); toplevel.send_close(); } } -- 2.49.1