From 3e6bbc6e5964dd92e6587a3bd7202b11113fc1ee Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 15 Feb 2025 11:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB=E7=A9=BA?= =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E8=BF=94=E5=9B=9E=E6=97=A7=E7=9A=84=E8=81=9A?= =?UTF-8?q?=E7=84=A6=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 89f15481..91c27c33 100644 --- a/main.c +++ b/main.c @@ -1586,6 +1586,7 @@ buttonpress(struct wl_listener *listener, void *data) { uint32_t mods; Client *c; const Button *b; + struct wlr_surface *surface; wlr_idle_notifier_v1_notify_activity(idle_notifier, seat); @@ -1597,10 +1598,13 @@ buttonpress(struct wl_listener *listener, void *data) { break; /* Change focus if the button was _pressed_ over a client */ - xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL); + xytonode(cursor->x, cursor->y, &surface, &c, NULL, NULL, NULL); if (c && (!client_is_unmanaged(c) || client_wants_focus(c))) focusclient(c, 1); + if (!surface) + wlr_seat_pointer_notify_clear_focus(seat); + keyboard = wlr_seat_get_keyboard(seat); mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0; for (b = buttons; b < END(buttons); b++) {