diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-03-17 14:56:29 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-03-17 22:31:19 -0700 |
| commit | 39f52b75856936db01325aa1c7f15fe8f379485d (patch) | |
| tree | 08fcbf8c938aa2b10a9be3014bf292f17225063d /src/input/mod.rs | |
| parent | b447b1f4de65ee706bdbbdb9b650ab030459c0fb (diff) | |
| download | niri-39f52b75856936db01325aa1c7f15fe8f379485d.tar.gz niri-39f52b75856936db01325aa1c7f15fe8f379485d.tar.bz2 niri-39f52b75856936db01325aa1c7f15fe8f379485d.zip | |
Implement toggle-windowed-fullscreen
Windowed, or fake, or detached, fullscreen, is when a window thinks that it's
fullscreen, but the compositor treats it as a normal window.
Diffstat (limited to 'src/input/mod.rs')
| -rw-r--r-- | src/input/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 08bebe40..c9677ba2 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -690,6 +690,23 @@ impl State { self.niri.queue_redraw_all(); } } + Action::ToggleWindowedFullscreen => { + let focus = self.niri.layout.focus().map(|m| m.window.clone()); + if let Some(window) = focus { + self.niri.layout.toggle_windowed_fullscreen(&window); + // FIXME: granular + self.niri.queue_redraw_all(); + } + } + Action::ToggleWindowedFullscreenById(id) => { + let window = self.niri.layout.windows().find(|(_, m)| m.id().get() == id); + let window = window.map(|(_, m)| m.window.clone()); + if let Some(window) = window { + self.niri.layout.toggle_windowed_fullscreen(&window); + // FIXME: granular + self.niri.queue_redraw_all(); + } + } Action::FocusWindow(id) => { let window = self.niri.layout.windows().find(|(_, m)| m.id().get() == id); let window = window.map(|(_, m)| m.window.clone()); |
