forge
Explore
Log in

Don't you dare go Hollow

Fix unfullscreening not always updating view offset

Browse files at this commit

2d16c04869a545f3aa649947f151c158a13c3a3aIvan MolodetskikhParent: 249f2b7
src/layout/tile.rsmodified+7 -5
@@ -54,6 +54,13 @@ impl<W: LayoutElement> Tile<W> {
5454 self.options = options;
5555 }
5656
57+ pub fn update_window(&mut self) {
58+ // FIXME: remove when we can get a fullscreen size right away.
59+ if self.fullscreen_size != Size::from((0, 0)) {
60+ self.is_fullscreen = self.window.is_fullscreen();
61+ }
62+ }
63+
5764 pub fn advance_animations(&mut self, _current_time: Duration, is_active: bool) {
5865 let width = self.border.width();
5966 self.border.update(
@@ -62,11 +69,6 @@ impl<W: LayoutElement> Tile<W> {
6269 self.window.has_ssd(),
6370 );
6471 self.border.set_active(is_active);
65-
66- // FIXME: remove when we can get a fullscreen size right away.
67- if self.fullscreen_size != Size::from((0, 0)) {
68- self.is_fullscreen = self.window.is_fullscreen();
69- }
7072 }
7173
7274 pub fn window(&self) -> &W {
src/layout/workspace.rsmodified+10 -0
@@ -569,6 +569,7 @@ impl<W: LayoutElement> Workspace<W> {
569569 .enumerate()
570570 .find(|(_, col)| col.contains(window))
571571 .unwrap();
572+ column.update_window(window);
572573 column.update_tile_sizes();
573574
574575 if idx == self.active_column_idx {
@@ -1080,6 +1081,15 @@ impl<W: LayoutElement> Column<W> {
10801081 self.update_tile_sizes();
10811082 }
10821083
1084+ fn update_window(&mut self, window: &W) {
1085+ let tile = self
1086+ .tiles
1087+ .iter_mut()
1088+ .find(|tile| tile.window() == window)
1089+ .unwrap();
1090+ tile.update_window();
1091+ }
1092+
10831093 fn update_tile_sizes(&mut self) {
10841094 if self.is_fullscreen {
10851095 self.tiles[0].request_fullscreen(self.view_size);