event->time_msec, dx, dy);
}
-static bool
+static void
handle_release_mousebinding(struct server *server,
struct cursor_context *ctx, uint32_t button)
{
if (server->osd_state.cycle_view) {
- return false;
+ return;
}
struct mousebind *mousebind;
- bool consumed_by_frame_context = false;
uint32_t modifiers = wlr_keyboard_get_modifiers(
&server->seat.keyboard_group->keyboard);
break;
}
continue;
- case MOUSE_ACTION_DRAG:
- if (mousebind->pressed_in_context) {
- /*
- * Swallow the release event as well as
- * the press one
- */
- consumed_by_frame_context |=
- mousebind->context == LAB_SSD_FRAME;
- consumed_by_frame_context |=
- mousebind->context == LAB_SSD_ALL;
- }
- continue;
default:
continue;
}
- consumed_by_frame_context |= mousebind->context == LAB_SSD_FRAME;
- consumed_by_frame_context |= mousebind->context == LAB_SSD_ALL;
actions_run(ctx->view, server, &mousebind->actions, ctx);
}
}
-
- return consumed_by_frame_context;
}
static bool
* counted as a DOUBLECLICK.
*/
if (!double_click) {
- /*
- * Swallow the press event as well as
- * the release one
- */
+ /* Swallow the press event */
consumed_by_frame_context |=
mousebind->context == LAB_SSD_FRAME;
consumed_by_frame_context |=
* so subsequent release always closes menu or selects menu item.
*/
press_msec = 0;
+ lab_set_add(&seat->bound_buttons, button);
return false;
}
* Note: This does not work for XWayland clients
*/
wlr_seat_pointer_end_grab(seat->seat);
+ lab_set_add(&seat->bound_buttons, button);
return false;
}
return true;
}
+ lab_set_add(&seat->bound_buttons, button);
return false;
}
struct cursor_context ctx = get_cursor_context(server);
struct wlr_surface *pressed_surface = seat->pressed.surface;
+ /* Always notify button release event when it's not bound */
+ const bool notify = !lab_set_contains(&seat->bound_buttons, button);
+
seat_reset_pressed(seat);
if (server->input_mode == LAB_INPUT_STATE_MENU) {
/*cursor_has_moved*/ false, &sx, &sy);
}
}
- return false;
+ return notify;
}
if (server->input_mode != LAB_INPUT_STATE_PASSTHROUGH) {
- if (pressed_surface) {
- /* Ensure CSD clients see the release event */
- return true;
- }
- return false;
+ return notify;
}
if (pressed_surface && ctx.surface != pressed_surface) {
* Button released but originally pressed over a different surface.
* Just send the release event to the still focused surface.
*/
- return true;
+ return notify;
}
- /* Bindings to the Frame context swallow mouse events if activated */
- bool consumed_by_frame_context =
- handle_release_mousebinding(server, &ctx, button);
+ handle_release_mousebinding(server, &ctx, button);
- if (!consumed_by_frame_context) {
- /* Notify client with pointer focus of button release */
- return true;
- }
-
- return false;
+ return notify;
}
bool
}
}
+ lab_set_remove(&seat->bound_buttons, button);
+
if (server->input_mode == LAB_INPUT_STATE_MOVE
|| server->input_mode == LAB_INPUT_STATE_RESIZE) {
if (resize_outlines_enabled(server->grabbed_view)) {