double ly, struct wlr_surface **surface, double *sx, double *sy,
int *view_area);
+struct view *desktop_view_at_cursor(struct server *server);
+
void cursor_init(struct seat *seat);
void keyboard_init(struct seat *seat);
if (view) {
view_minimize(view, true);
}
+ } else if (!strcasecmp(action, "Move")) {
+ struct view *view = desktop_view_at_cursor(server);
+ if (view) {
+ interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
+ }
} else {
wlr_log(WLR_ERROR, "action (%s) not supported", action);
}
static struct {
const char *context, *button, *event, *action, *command;
} mouse_combos[] = {
+ { "TitleBar", "Left", "Press", "Move", NULL },
{ "TitleBar", "Left", "DoubleClick", "ToggleMaximize", NULL },
{ "Close", "Left", "Click", "Close", NULL },
{ "Iconify", "Left", "Click", "Iconify", NULL},
mousebindings:
if (event->state == WLR_BUTTON_RELEASED) {
handle_release_mousebinding(server, event->button, view_area);
- return;
} else if (event->state == WLR_BUTTON_PRESSED) {
- if (handle_press_mousebinding(server, event->button, view_area)) {
- return;
- }
- }
-
- if (view_area == LAB_SSD_PART_TITLEBAR) {
- interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
+ handle_press_mousebinding(server, event->button, view_area);
}
}
}
return NULL;
}
+
+struct view *
+desktop_view_at_cursor(struct server *server) {
+ double sx, sy;
+ struct wlr_surface *surface;
+ int view_area = LAB_SSD_NONE;
+
+ return desktop_surface_and_view_at(server,
+ server->seat.cursor->x, server->seat.cursor->y,
+ &surface, &sx, &sy, &view_area);
+}