layout/scrolling: Animate tiles_origin changing on un/fullscreen
Browse files at this commita3203d92ecbdf6ffa6452be6c95324215b9360b0Parent: c832bde1 changed file +13 -0
- src/layout/scrolling.rs +13 -0
src/layout/scrolling.rsmodified+13 -0
| @@ -1226,6 +1226,7 @@ impl<W: LayoutElement> ScrollingSpace<W> { | |||
| 1226 | .find(|(_, col)| col.contains(window)) | 1226 | .find(|(_, col)| col.contains(window)) |
| 1227 | .unwrap(); | 1227 | .unwrap(); |
| 1228 | let was_fullscreen = column.is_fullscreen(); | 1228 | let was_fullscreen = column.is_fullscreen(); |
| 1229 | + let prev_origin = column.tiles_origin(); | ||
| 1229 | 1230 | ||
| 1230 | let (tile_idx, tile) = column | 1231 | let (tile_idx, tile) = column |
| 1231 | .tiles | 1232 | .tiles |
| @@ -1295,6 +1296,18 @@ impl<W: LayoutElement> ScrollingSpace<W> { | |||
| 1295 | } | 1296 | } |
| 1296 | } | 1297 | } |
| 1297 | 1298 | ||
| 1299 | + // When a column goes between fullscreen and non-fullscreen, the tiles origin can change. | ||
| 1300 | + // The change comes from things like ignoring struts and hiding the tab indicator in | ||
| 1301 | + // fullscreen, so both in X and Y directions. | ||
| 1302 | + let column = &mut self.columns[col_idx]; | ||
| 1303 | + let new_origin = column.tiles_origin(); | ||
| 1304 | + let origin_delta = prev_origin - new_origin; | ||
| 1305 | + if origin_delta != Point::new(0., 0.) { | ||
| 1306 | + for (tile, _pos) in column.tiles_mut() { | ||
| 1307 | + tile.animate_move_from(origin_delta); | ||
| 1308 | + } | ||
| 1309 | + } | ||
| 1310 | + | ||
| 1298 | if col_idx == self.active_column_idx { | 1311 | if col_idx == self.active_column_idx { |
| 1299 | // If offset == 0, then don't mess with the view or the gesture. Some clients (Firefox, | 1312 | // If offset == 0, then don't mess with the view or the gesture. Some clients (Firefox, |
| 1300 | // Chromium, Electron) currently don't commit after the ack of a configure that drops | 1313 | // Chromium, Electron) currently don't commit after the ack of a configure that drops |