forge
Explore
Log in

Don't you dare go Hollow

Disable double-resize-click for floating windows

Browse files at this commit

d1998ae3fa28d8c7034f0b3ba188c355fc146e5cIvan MolodetskikhParent: 3c2e155
src/handlers/xdg_shell.rsmodified+9 -1
@@ -209,8 +209,16 @@ impl XdgShellHandler for State {
209 // See if we got a double resize-click gesture.209 // See if we got a double resize-click gesture.
210 let time = get_monotonic_time();210 let time = get_monotonic_time();
211 let last_cell = mapped.last_interactive_resize_start();211 let last_cell = mapped.last_interactive_resize_start();
212- let last = last_cell.get();212+ let mut last = last_cell.get();
213 last_cell.set(Some((time, edges)));213 last_cell.set(Some((time, edges)));
214+
215+ // Floating windows don't have either of the double-resize-click gestures, so just allow it
216+ // to resize.
217+ if mapped.is_floating() {
218+ last = None;
219+ last_cell.set(None);
220+ }
221+
214 if let Some((last_time, last_edges)) = last {222 if let Some((last_time, last_edges)) = last {
215 if time.saturating_sub(last_time) <= DOUBLE_CLICK_TIME {223 if time.saturating_sub(last_time) <= DOUBLE_CLICK_TIME {
216 // Allow quick resize after a triple click.224 // Allow quick resize after a triple click.
src/input/mod.rsmodified+9 -1
@@ -1697,8 +1697,16 @@ impl State {
1697 // FIXME: deduplicate with resize_request in xdg-shell somehow.1697 // FIXME: deduplicate with resize_request in xdg-shell somehow.
1698 let time = get_monotonic_time();1698 let time = get_monotonic_time();
1699 let last_cell = mapped.last_interactive_resize_start();1699 let last_cell = mapped.last_interactive_resize_start();
1700- let last = last_cell.get();1700+ let mut last = last_cell.get();
1701 last_cell.set(Some((time, edges)));1701 last_cell.set(Some((time, edges)));
1702+
1703+ // Floating windows don't have either of the double-resize-click
1704+ // gestures, so just allow it to resize.
1705+ if mapped.is_floating() {
1706+ last = None;
1707+ last_cell.set(None);
1708+ }
1709+
1702 if let Some((last_time, last_edges)) = last {1710 if let Some((last_time, last_edges)) = last {
1703 if time.saturating_sub(last_time) <= DOUBLE_CLICK_TIME {1711 if time.saturating_sub(last_time) <= DOUBLE_CLICK_TIME {
1704 // Allow quick resize after a triple click.1712 // Allow quick resize after a triple click.
wiki/Gestures.mdmodified+2 -2
@@ -24,7 +24,7 @@ You can resize windows by holding <kbd>Mod</kbd> and the right mouse button.
24 24
25 <sup>Since: 0.1.6</sup>25 <sup>Since: 0.1.6</sup>
26 26
27-If you double-click on a top or bottom window resize edge, the window height will reset to automatic.27+If you double-click on a top or bottom tiled window resize edge, the window height will reset to automatic.
28 28
29 This works with both window-initiated resizes (when using client-side decorations), and niri-initiated <kbd>Mod</kbd> + right click resizes.29 This works with both window-initiated resizes (when using client-side decorations), and niri-initiated <kbd>Mod</kbd> + right click resizes.
30 30
@@ -32,7 +32,7 @@ This works with both window-initiated resizes (when using client-side decoration
32 32
33 <sup>Since: 0.1.6</sup>33 <sup>Since: 0.1.6</sup>
34 34
35-If you double-click on a left or right window resize edge, the column will expand to the full workspace width.35+If you double-click on a left or right tiled window resize edge, the column will expand to the full workspace width.
36 36
37 This works with both window-initiated resizes (when using client-side decorations), and niri-initiated <kbd>Mod</kbd> + right click resizes.37 This works with both window-initiated resizes (when using client-side decorations), and niri-initiated <kbd>Mod</kbd> + right click resizes.
38 38