mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
action: add UnSnap action
Same untiling behavior as ToggleSnapToEdge/Region, but unconditionally. Co-authored-by: tokyo4j <hrak1529@gmail.com>
This commit is contained in:
parent
cb2e2c1016
commit
694c5a7469
2 changed files with 13 additions and 0 deletions
|
|
@ -102,6 +102,7 @@ enum action_type {
|
|||
ACTION_TYPE_GO_TO_DESKTOP,
|
||||
ACTION_TYPE_TOGGLE_SNAP_TO_REGION,
|
||||
ACTION_TYPE_SNAP_TO_REGION,
|
||||
ACTION_TYPE_UNSNAP,
|
||||
ACTION_TYPE_TOGGLE_KEYBINDS,
|
||||
ACTION_TYPE_FOCUS_OUTPUT,
|
||||
ACTION_TYPE_MOVE_TO_OUTPUT,
|
||||
|
|
@ -165,6 +166,7 @@ const char *action_names[] = {
|
|||
"GoToDesktop",
|
||||
"ToggleSnapToRegion",
|
||||
"SnapToRegion",
|
||||
"UnSnap",
|
||||
"ToggleKeybinds",
|
||||
"FocusOutput",
|
||||
"MoveToOutput",
|
||||
|
|
@ -1169,6 +1171,13 @@ actions_run(struct view *activator, struct server *server,
|
|||
wlr_log(WLR_ERROR, "Invalid SnapToRegion id: '%s'", region_name);
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_UNSNAP:
|
||||
if (view && view->maximized == VIEW_AXIS_NONE && !view->fullscreen
|
||||
&& view_is_tiled(view)) {
|
||||
view_set_untiled(view);
|
||||
view_apply_natural_geometry(view);
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_TOGGLE_KEYBINDS:
|
||||
if (view) {
|
||||
view_toggle_keybinds(view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue