mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-25 06:59:50 -05:00
fix: click empty desktop focus to the last client
This commit is contained in:
parent
a59716a8f4
commit
122502a84d
1 changed files with 5 additions and 1 deletions
6
main.c
6
main.c
|
|
@ -1586,6 +1586,7 @@ buttonpress(struct wl_listener *listener, void *data) {
|
||||||
uint32_t mods;
|
uint32_t mods;
|
||||||
Client *c;
|
Client *c;
|
||||||
const Button *b;
|
const Button *b;
|
||||||
|
struct wlr_surface *surface;
|
||||||
|
|
||||||
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
|
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
|
||||||
|
|
||||||
|
|
@ -1597,10 +1598,13 @@ buttonpress(struct wl_listener *listener, void *data) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Change focus if the button was _pressed_ over a client */
|
/* 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)))
|
if (c && (!client_is_unmanaged(c) || client_wants_focus(c)))
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
|
|
||||||
|
if (!surface)
|
||||||
|
wlr_seat_pointer_notify_clear_focus(seat);
|
||||||
|
|
||||||
keyboard = wlr_seat_get_keyboard(seat);
|
keyboard = wlr_seat_get_keyboard(seat);
|
||||||
mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
|
mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
|
||||||
for (b = buttons; b < END(buttons); b++) {
|
for (b = buttons; b < END(buttons); b++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue