diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 6fae10e..73db25a 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -5846,11 +5846,26 @@ wl_update_pointer_focus(uint32_t time_msec) struct wlr_surface *surface = NULL; /* If pointer is over an internal frame_buf (menu, titlebar, etc.), - * don't send pointer events to any client surface. */ + * don't send pointer events to any client surface — UNLESS the + * pointer is actually over the client content area within the frame. */ struct wl_frame_buf *fb = frame_buf_at(wl_state.pointer_x, wl_state.pointer_y); - if (!fb) + if (fb) { + /* Check if this frame_buf has a client surface (toplevel view) + * and the pointer is over the client area, not the decorations. */ + double sx, sy; + struct wl_toplevel_view *v = NULL; + struct wlr_surface *cs = view_surface_at( + wl_state.pointer_x, wl_state.pointer_y, &sx, &sy, &v); + if (cs) { + surface = cs; + view = v; + fb = NULL; /* not over decorations */ + } + } + if (!fb && !surface) { surface = view_surface_at( wl_state.pointer_x, wl_state.pointer_y, &sx, &sy, &view); + } static struct wlr_surface *last_focused_surface = NULL; if (surface) {