diff --git a/src/backend/wayland/wl_pointer_focus.c b/src/backend/wayland/wl_pointer_focus.c index e17dfcd..c0af0a7 100644 --- a/src/backend/wayland/wl_pointer_focus.c +++ b/src/backend/wayland/wl_pointer_focus.c @@ -124,6 +124,20 @@ wl_update_pointer_focus(uint32_t time_msec) if (!wl_state.seat) return; + /* Preserve implicit grab: don't change focus while buttons are held. + * Still deliver motion to the focused surface for drag/selection. */ + if (wl_state.seat->pointer_state.button_count > 0) { + struct wlr_surface *focused = wl_state.seat->pointer_state.focused_surface; + if (focused) { + double sx, sy; + struct wl_toplevel_view *v = NULL; + view_surface_at(wl_state.pointer_x, wl_state.pointer_y, &sx, &sy, &v); + wlr_seat_pointer_notify_motion(wl_state.seat, time_msec, sx, sy); + wlr_seat_pointer_notify_frame(wl_state.seat); + } + return; + } + double sx, sy; struct wl_toplevel_view *view = NULL; struct wlr_surface *surface = NULL;