diff --git a/src/maomao.c b/src/maomao.c index 4f2a634..f2daacd 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -2737,6 +2737,7 @@ buttonpress(struct wl_listener *listener, void *data) { Client *tmpc; int ji; const MouseBinding *b; + struct wlr_surface *old_pointer_focus_surface = seat->pointer_state.focused_surface; handlecursoractivity(); wlr_idle_notifier_v1_notify_activity(idle_notifier, seat); @@ -2753,6 +2754,11 @@ buttonpress(struct wl_listener *listener, void *data) { if (c && (!client_is_unmanaged(c) || client_wants_focus(c))) focusclient(c, 1); + if (surface != old_pointer_focus_surface) { + wlr_seat_pointer_notify_clear_focus(seat); + motionnotify(0, NULL, 0, 0, 0, 0); + } + if (l && l->layer_surface->current.keyboard_interactive) { focusclient(NULL, 0); client_notify_enter(l->layer_surface->surface,