diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-28 11:40:16 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 6c52077d922dce3a9b57c6785647b6befb700ac9 (patch) | |
| tree | edc2edb081630600c95e9356be9e43d5a2eea240 /src/input | |
| parent | 73bf7b1730e6911adb09d8253035f4510d83dbe0 (diff) | |
| download | niri-6c52077d922dce3a9b57c6785647b6befb700ac9.tar.gz niri-6c52077d922dce3a9b57c6785647b6befb700ac9.tar.bz2 niri-6c52077d922dce3a9b57c6785647b6befb700ac9.zip | |
Add move-floating-window action
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index d874ee34..83336fb3 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1361,6 +1361,22 @@ impl State { // FIXME: granular self.niri.queue_redraw_all(); } + Action::MoveFloatingWindowById { id, x, y } => { + let window = if let Some(id) = id { + let window = self.niri.layout.windows().find(|(_, m)| m.id().get() == id); + let window = window.map(|(_, m)| m.window.clone()); + if window.is_none() { + return; + } + window + } else { + None + }; + + self.niri.layout.move_floating_window(window.as_ref(), x, y); + // FIXME: granular + self.niri.queue_redraw_all(); + } } } |
