implement Resize as an action

this requires action() to know the resize edges to use, so thread them through
This commit is contained in:
bi4k8 2021-12-01 02:38:53 +00:00 committed by Johan Malm
parent 8eab1e8132
commit 031ced85ef
5 changed files with 24 additions and 13 deletions

View file

@ -20,7 +20,7 @@ show_menu(struct server *server, const char *menu)
}
void
action(struct server *server, const char *action, const char *command)
action(struct server *server, const char *action, const char *command, uint32_t resize_edges)
{
if (!action)
return;
@ -77,6 +77,11 @@ action(struct server *server, const char *action, const char *command)
if (view) {
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
}
} else if (!strcasecmp(action, "Resize")) {
struct view *view = desktop_view_at_cursor(server);
if (view) {
interactive_begin(view, LAB_INPUT_STATE_RESIZE, resize_edges);
}
} else {
wlr_log(WLR_ERROR, "action (%s) not supported", action);
}