forge
Explore
Log in

Don't you dare go Hollow

layout: Move toggle_fullscreen() impl to Workspace

Browse files at this commit

965619d0964973966bbd1d9d8087d1e8e8ff4867Ivan MolodetskikhParent: 9f017e8
src/layout/scrolling.rsmodified+0 -10
@@ -2140,16 +2140,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
21402140 }
21412141 }
21422142
2143- pub fn toggle_fullscreen(&mut self, window: &W::Id) {
2144- let col = self
2145- .columns
2146- .iter_mut()
2147- .find(|col| col.contains(window))
2148- .unwrap();
2149- let value = !col.is_fullscreen;
2150- self.set_fullscreen(window, value);
2151- }
2152-
21532143 pub fn render_above_top_layer(&self) -> bool {
21542144 // Render above the top layer if we're on a fullscreen window and the view is stationary.
21552145 if self.columns.is_empty() {
src/layout/workspace.rsmodified+6 -4
@@ -985,10 +985,12 @@ impl<W: LayoutElement> Workspace<W> {
985985 }
986986
987987 pub fn toggle_fullscreen(&mut self, window: &W::Id) {
988- if self.floating.has_window(window) {
989- self.toggle_window_floating(Some(window));
990- }
991- self.scrolling.toggle_fullscreen(window);
988+ let tile = self
989+ .tiles()
990+ .find(|tile| tile.window().id() == window)
991+ .unwrap();
992+ let current = tile.window().is_pending_fullscreen();
993+ self.set_fullscreen(window, !current);
992994 }
993995
994996 pub fn toggle_window_floating(&mut self, id: Option<&W::Id>) {