mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Disable double-resize-click for floating windows
This commit is contained in:
@@ -209,8 +209,16 @@ impl XdgShellHandler for State {
|
||||
// See if we got a double resize-click gesture.
|
||||
let time = get_monotonic_time();
|
||||
let last_cell = mapped.last_interactive_resize_start();
|
||||
let last = last_cell.get();
|
||||
let mut last = last_cell.get();
|
||||
last_cell.set(Some((time, edges)));
|
||||
|
||||
// Floating windows don't have either of the double-resize-click gestures, so just allow it
|
||||
// to resize.
|
||||
if mapped.is_floating() {
|
||||
last = None;
|
||||
last_cell.set(None);
|
||||
}
|
||||
|
||||
if let Some((last_time, last_edges)) = last {
|
||||
if time.saturating_sub(last_time) <= DOUBLE_CLICK_TIME {
|
||||
// Allow quick resize after a triple click.
|
||||
|
||||
+9
-1
@@ -1697,8 +1697,16 @@ impl State {
|
||||
// FIXME: deduplicate with resize_request in xdg-shell somehow.
|
||||
let time = get_monotonic_time();
|
||||
let last_cell = mapped.last_interactive_resize_start();
|
||||
let last = last_cell.get();
|
||||
let mut last = last_cell.get();
|
||||
last_cell.set(Some((time, edges)));
|
||||
|
||||
// Floating windows don't have either of the double-resize-click
|
||||
// gestures, so just allow it to resize.
|
||||
if mapped.is_floating() {
|
||||
last = None;
|
||||
last_cell.set(None);
|
||||
}
|
||||
|
||||
if let Some((last_time, last_edges)) = last {
|
||||
if time.saturating_sub(last_time) <= DOUBLE_CLICK_TIME {
|
||||
// Allow quick resize after a triple click.
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ You can resize windows by holding <kbd>Mod</kbd> and the right mouse button.
|
||||
|
||||
<sup>Since: 0.1.6</sup>
|
||||
|
||||
If you double-click on a top or bottom window resize edge, the window height will reset to automatic.
|
||||
If you double-click on a top or bottom tiled window resize edge, the window height will reset to automatic.
|
||||
|
||||
This works with both window-initiated resizes (when using client-side decorations), and niri-initiated <kbd>Mod</kbd> + right click resizes.
|
||||
|
||||
@@ -32,7 +32,7 @@ This works with both window-initiated resizes (when using client-side decoration
|
||||
|
||||
<sup>Since: 0.1.6</sup>
|
||||
|
||||
If you double-click on a left or right window resize edge, the column will expand to the full workspace width.
|
||||
If you double-click on a left or right tiled window resize edge, the column will expand to the full workspace width.
|
||||
|
||||
This works with both window-initiated resizes (when using client-side decorations), and niri-initiated <kbd>Mod</kbd> + right click resizes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user