Add MoveToCursor action

This commit is contained in:
Arnaudv6 2023-10-14 14:57:44 +02:00 committed by Johan Malm
parent 5c4038493f
commit 8920e546db
4 changed files with 56 additions and 0 deletions

View file

@ -84,6 +84,7 @@ enum action_type {
ACTION_TYPE_RESIZE,
ACTION_TYPE_RESIZE_RELATIVE,
ACTION_TYPE_MOVETO,
ACTION_TYPE_MOVETO_CURSOR,
ACTION_TYPE_MOVE_RELATIVE,
ACTION_TYPE_SEND_TO_DESKTOP,
ACTION_TYPE_GO_TO_DESKTOP,
@ -122,6 +123,7 @@ const char *action_names[] = {
"Resize",
"ResizeRelative",
"MoveTo",
"MoveToCursor",
"MoveRelative",
"SendToDesktop",
"GoToDesktop",
@ -746,6 +748,11 @@ actions_run(struct view *activator, struct server *server,
view_move_relative(view, x, y);
}
break;
case ACTION_TYPE_MOVETO_CURSOR:
if (view) {
view_move_to_cursor(view);
}
break;
case ACTION_TYPE_SEND_TO_DESKTOP:
if (!view) {
break;