From 123fe77bbbb00af28ffd1a39e6445749fc112834 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Wed, 11 Mar 2026 06:46:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20focus=5Fin=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除独立的 focus_in 事件处理器 - 在 enter_notify 中直接调用 wm_set_current_monitor --- src/event.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/event.c b/src/event.c index 77195bb..f148e3b 100644 --- a/src/event.c +++ b/src/event.c @@ -317,12 +317,7 @@ static void enter_notify(xcb_enter_notify_event_t *ev) { if (!client || wm.client_focused == client) return; client_focus(client); -} - -static void focus_in(xcb_focus_in_event_t *ev) { - client_t *client = client_get_by_window(ev->event); - if (!client) return; - wm_set_current_monitor(client->monitor, ev->mode != XCB_NOTIFY_MODE_NORMAL); + wm_set_current_monitor(client->monitor, false); } static void selection_clear(xcb_selection_clear_event_t *ev) { @@ -353,7 +348,6 @@ static void handle_xcb_event(xcb_generic_event_t *event) { EVENT(XCB_UNMAP_NOTIFY, unmap_notify); EVENT(XCB_DESTROY_NOTIFY, destroy_notify); EVENT(XCB_ENTER_NOTIFY, enter_notify); - EVENT(XCB_FOCUS_IN, focus_in); EVENT(XCB_SELECTION_CLEAR, selection_clear); #undef EVENT