mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
layout: Move toggle_fullscreen() impl to Workspace
This commit is contained in:
@@ -2140,16 +2140,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn toggle_fullscreen(&mut self, window: &W::Id) {
|
||||
let col = self
|
||||
.columns
|
||||
.iter_mut()
|
||||
.find(|col| col.contains(window))
|
||||
.unwrap();
|
||||
let value = !col.is_fullscreen;
|
||||
self.set_fullscreen(window, value);
|
||||
}
|
||||
|
||||
pub fn render_above_top_layer(&self) -> bool {
|
||||
// Render above the top layer if we're on a fullscreen window and the view is stationary.
|
||||
if self.columns.is_empty() {
|
||||
|
||||
@@ -985,10 +985,12 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
}
|
||||
|
||||
pub fn toggle_fullscreen(&mut self, window: &W::Id) {
|
||||
if self.floating.has_window(window) {
|
||||
self.toggle_window_floating(Some(window));
|
||||
}
|
||||
self.scrolling.toggle_fullscreen(window);
|
||||
let tile = self
|
||||
.tiles()
|
||||
.find(|tile| tile.window().id() == window)
|
||||
.unwrap();
|
||||
let current = tile.window().is_pending_fullscreen();
|
||||
self.set_fullscreen(window, !current);
|
||||
}
|
||||
|
||||
pub fn toggle_window_floating(&mut self, id: Option<&W::Id>) {
|
||||
|
||||
Reference in New Issue
Block a user