action: Add 'SnapToEdge'

Implements snap-style edge snapping that works between multiple monitors.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-10-17 00:44:24 +00:00 committed by Johan Malm
parent 6bcefc27a8
commit 8e3108c032
3 changed files with 107 additions and 0 deletions

View file

@ -42,6 +42,8 @@ action(struct server *server, const char *action, const char *command)
wl_display_terminate(server->wl_display);
} else if (!strcasecmp(action, "MoveToEdge")) {
view_move_to_edge(desktop_focused_view(server), command);
} else if (!strcasecmp(action, "SnapToEdge")) {
view_snap_to_edge(desktop_focused_view(server), command);
} else if (!strcasecmp(action, "NextWindow")) {
server->cycle_view =
desktop_cycle_view(server, server->cycle_view);