diff --git a/src/backend/wayland/wl_handlers.c b/src/backend/wayland/wl_handlers.c index 923d750..c95e088 100644 --- a/src/backend/wayland/wl_handlers.c +++ b/src/backend/wayland/wl_handlers.c @@ -329,8 +329,27 @@ handle_pointer_button(struct wl_listener *listener, void *data) * wlr_seat_pointer_notify_button to be a no-op. */ wl_update_pointer_focus(ev->time_msec); - wlr_seat_pointer_notify_button(wl_state.seat, ev->time_msec, - ev->button, ev->state); + /* Suppress forwarding to the client when the WM modifier key is held + * on a button press over a client surface. In this case frameMouseDown + * will handle the event (move or resize), and the app must not see it. */ + Bool forward_to_client = True; + if (ev->state == WLR_BUTTON_PRESSED && wl_state.seat) { + struct wlr_keyboard *_kb = wl_state.seat->keyboard_state.keyboard; + unsigned int _mods = _kb ? _kb->modifiers.depressed : 0; + if (_mods & wPreferences.modifier_mask) { + double _sx, _sy; + struct wl_toplevel_view *_tv = NULL; + struct wlr_surface *_surf = view_surface_at( + wl_state.pointer_x, wl_state.pointer_y, &_sx, &_sy, &_tv); + if (_surf && _tv) + forward_to_client = False; + } + } + + if (forward_to_client) { + wlr_seat_pointer_notify_button(wl_state.seat, ev->time_msec, + ev->button, ev->state); + } wlr_seat_pointer_notify_frame(wl_state.seat); }