interactive: allow moving horizontally/vertically maximized window

Applies drag resistance unidirectionally for horizontally/vertically
maximized windows, allowing them to be dragged without being untiled
immediately. When the distance of cursor movement orthogonal to the
maximized direction exceeds <resistance><unMaximizeThreshold>.

While dragging a horizontally/vertically maximized window, edge/region
snapping is disabled to prevent unintentional snapping and overlays.

This commit also includes some refactoring to simplify the logic.
This commit is contained in:
tokyo4j 2024-08-07 09:17:25 +09:00 committed by Consolatis
parent 2e19bd4d5b
commit 1f1bdad087
11 changed files with 137 additions and 120 deletions

View file

@ -1043,6 +1043,8 @@ entry(xmlNode *node, char *nodename, char *content)
rc.window_edge_strength = atoi(content);
} else if (!strcasecmp(nodename, "unSnapThreshold.resistance")) {
rc.unsnap_threshold = atoi(content);
} else if (!strcasecmp(nodename, "unMaximizeThreshold.resistance")) {
rc.unmaximize_threshold = atoi(content);
} else if (!strcasecmp(nodename, "range.snapping")) {
rc.snap_edge_range = atoi(content);
} else if (!strcasecmp(nodename, "enabled.overlay.snapping")) {
@ -1370,6 +1372,7 @@ rcxml_init(void)
rc.screen_edge_strength = 20;
rc.window_edge_strength = 20;
rc.unsnap_threshold = 20;
rc.unmaximize_threshold = 150;
rc.snap_edge_range = 1;
rc.snap_overlay_enabled = true;