Fix unfullscreening not always updating view offset
Browse files at this commit2d16c04869a545f3aa649947f151c158a13c3a3aParent: 249f2b72 changed files +17 -5
- src/layout/tile.rs +7 -5
- src/layout/workspace.rs +10 -0
src/layout/tile.rsmodified+7 -5
| @@ -54,6 +54,13 @@ impl<W: LayoutElement> Tile<W> { | |||
| 54 | self.options = options; | 54 | self.options = options; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 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 | + | ||
| 57 | pub fn advance_animations(&mut self, _current_time: Duration, is_active: bool) { | 64 | pub fn advance_animations(&mut self, _current_time: Duration, is_active: bool) { |
| 58 | let width = self.border.width(); | 65 | let width = self.border.width(); |
| 59 | self.border.update( | 66 | self.border.update( |
| @@ -62,11 +69,6 @@ impl<W: LayoutElement> Tile<W> { | |||
| 62 | self.window.has_ssd(), | 69 | self.window.has_ssd(), |
| 63 | ); | 70 | ); |
| 64 | self.border.set_active(is_active); | 71 | 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 | - } | ||
| 70 | } | 72 | } |
| 71 | 73 | ||
| 72 | pub fn window(&self) -> &W { | 74 | pub fn window(&self) -> &W { |
src/layout/workspace.rsmodified+10 -0
| @@ -569,6 +569,7 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 569 | .enumerate() | 569 | .enumerate() |
| 570 | .find(|(_, col)| col.contains(window)) | 570 | .find(|(_, col)| col.contains(window)) |
| 571 | .unwrap(); | 571 | .unwrap(); |
| 572 | + column.update_window(window); | ||
| 572 | column.update_tile_sizes(); | 573 | column.update_tile_sizes(); |
| 573 | 574 | ||
| 574 | if idx == self.active_column_idx { | 575 | if idx == self.active_column_idx { |
| @@ -1080,6 +1081,15 @@ impl<W: LayoutElement> Column<W> { | |||
| 1080 | self.update_tile_sizes(); | 1081 | self.update_tile_sizes(); |
| 1081 | } | 1082 | } |
| 1082 | 1083 | ||
| 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 | + | ||
| 1083 | fn update_tile_sizes(&mut self) { | 1093 | fn update_tile_sizes(&mut self) { |
| 1084 | if self.is_fullscreen { | 1094 | if self.is_fullscreen { |
| 1085 | self.tiles[0].request_fullscreen(self.view_size); | 1095 | self.tiles[0].request_fullscreen(self.view_size); |