From 8fba9ee71f8daf4d6bbcc43bcaa178a7a40724cc Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Mon, 5 Jan 2026 22:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=88=87=E6=8D=A2=20tag=20?= =?UTF-8?q?=E5=90=8E=20client=20=E7=9A=84=E7=84=A6=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/monitor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/monitor.c b/src/monitor.c index 5864489..09e9e8c 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -49,7 +49,10 @@ uint32_t monitor_initialize_tag(monitor_t *monitor, const char **tags, } void monitor_deal_focus(monitor_t *monitor) { - if (!monitor->selected_tag->task_list) return; + if (!monitor->selected_tag->task_list) { + client_focus(nullptr); + return; + } client_t *client = nullptr; for (client_t *c = wm.client_stack_list; c; c = c->stack_next) { @@ -69,12 +72,12 @@ void monitor_select_tag(monitor_t *monitor, uint32_t tag_mask) { monitor->selected_tag = tag; monitor_arrange(monitor); monitor_draw_bar(monitor); - xcb_flush(wm.xcb_conn); break; } } monitor_deal_focus(monitor); + xcb_flush(wm.xcb_conn); } static void tag_clean(tag_t *tag) {