From f9d5af7f060ada6f224861967e31bb74a0d24e18 Mon Sep 17 00:00:00 2001 From: tcmal Date: Tue, 13 Aug 2024 21:49:34 +0100 Subject: Fix focus flickering bug --- src/focus.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/focus.rs') diff --git a/src/focus.rs b/src/focus.rs index da3b81a..7a4b348 100644 --- a/src/focus.rs +++ b/src/focus.rs @@ -18,11 +18,11 @@ impl WM<'_> { } } - /// When a new window requests focus, focus it. + /// When a window attempts to focus in, refocus the actually focused window to deal with some broken clients. pub fn handle_focus_in(&mut self, e: &FocusInEvent) { if !self.clients.is_focused(e.event()) { - if let Some((mon, pos)) = self.clients.find_client_pos(e.event()) { - self.clients.refocus(&self.conn, mon, pos); + if let Some(pos) = self.clients.focused_pos() { + self.clients.refocus(&self.conn, pos.0, pos.1); } } } -- cgit v1.2.3