Remove jumps on consume/expel animation start
Browse files at this commit21ef5aded81309bc9ab57c15f4e92a438271a5acParent: b2881024 changed files +104 -41
- src/layout/mod.rs +3 -1
- src/layout/monitor.rs +9 -6
- src/layout/tile.rs +1 -1
- src/layout/workspace.rs +91 -33
src/layout/mod.rsmodified+3 -1
| @@ -1426,7 +1426,9 @@ impl<W: LayoutElement> Layout<W> { | |||
| 1426 | let column = &ws.columns[ws.active_column_idx]; | 1426 | let column = &ws.columns[ws.active_column_idx]; |
| 1427 | let width = column.width; | 1427 | let width = column.width; |
| 1428 | let is_full_width = column.is_full_width; | 1428 | let is_full_width = column.is_full_width; |
| 1429 | - let window = ws.remove_window_by_idx(ws.active_column_idx, column.active_tile_idx); | 1429 | + let window = ws |
| 1430 | + .remove_tile_by_idx(ws.active_column_idx, column.active_tile_idx) | ||
| 1431 | + .into_window(); | ||
| 1430 | 1432 | ||
| 1431 | let workspace_idx = monitors[new_idx].active_workspace_idx; | 1433 | let workspace_idx = monitors[new_idx].active_workspace_idx; |
| 1432 | self.add_window_by_idx(new_idx, workspace_idx, window, true, width, is_full_width); | 1434 | self.add_window_by_idx(new_idx, workspace_idx, window, true, width, is_full_width); |
src/layout/monitor.rsmodified+9 -6
| @@ -346,8 +346,9 @@ impl<W: LayoutElement> Monitor<W> { | |||
| 346 | let column = &workspace.columns[workspace.active_column_idx]; | 346 | let column = &workspace.columns[workspace.active_column_idx]; |
| 347 | let width = column.width; | 347 | let width = column.width; |
| 348 | let is_full_width = column.is_full_width; | 348 | let is_full_width = column.is_full_width; |
| 349 | - let window = | 349 | + let window = workspace |
| 350 | - workspace.remove_window_by_idx(workspace.active_column_idx, column.active_tile_idx); | 350 | + .remove_tile_by_idx(workspace.active_column_idx, column.active_tile_idx) |
| 351 | + .into_window(); | ||
| 351 | 352 | ||
| 352 | self.add_window(new_idx, window, true, width, is_full_width); | 353 | self.add_window(new_idx, window, true, width, is_full_width); |
| 353 | } | 354 | } |
| @@ -368,8 +369,9 @@ impl<W: LayoutElement> Monitor<W> { | |||
| 368 | let column = &workspace.columns[workspace.active_column_idx]; | 369 | let column = &workspace.columns[workspace.active_column_idx]; |
| 369 | let width = column.width; | 370 | let width = column.width; |
| 370 | let is_full_width = column.is_full_width; | 371 | let is_full_width = column.is_full_width; |
| 371 | - let window = | 372 | + let window = workspace |
| 372 | - workspace.remove_window_by_idx(workspace.active_column_idx, column.active_tile_idx); | 373 | + .remove_tile_by_idx(workspace.active_column_idx, column.active_tile_idx) |
| 374 | + .into_window(); | ||
| 373 | 375 | ||
| 374 | self.add_window(new_idx, window, true, width, is_full_width); | 376 | self.add_window(new_idx, window, true, width, is_full_width); |
| 375 | } | 377 | } |
| @@ -390,8 +392,9 @@ impl<W: LayoutElement> Monitor<W> { | |||
| 390 | let column = &workspace.columns[workspace.active_column_idx]; | 392 | let column = &workspace.columns[workspace.active_column_idx]; |
| 391 | let width = column.width; | 393 | let width = column.width; |
| 392 | let is_full_width = column.is_full_width; | 394 | let is_full_width = column.is_full_width; |
| 393 | - let window = | 395 | + let window = workspace |
| 394 | - workspace.remove_window_by_idx(workspace.active_column_idx, column.active_tile_idx); | 396 | + .remove_tile_by_idx(workspace.active_column_idx, column.active_tile_idx) |
| 397 | + .into_window(); | ||
| 395 | 398 | ||
| 396 | self.add_window(new_idx, window, true, width, is_full_width); | 399 | self.add_window(new_idx, window, true, width, is_full_width); |
| 397 | 400 | ||
src/layout/tile.rsmodified+1 -1
| @@ -61,7 +61,7 @@ pub struct Tile<W: LayoutElement> { | |||
| 61 | move_animation: Option<MoveAnimation>, | 61 | move_animation: Option<MoveAnimation>, |
| 62 | 62 | ||
| 63 | /// Configurable properties of the layout. | 63 | /// Configurable properties of the layout. |
| 64 | - options: Rc<Options>, | 64 | + pub options: Rc<Options>, |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | niri_render_elements! { | 67 | niri_render_elements! { |
src/layout/workspace.rsmodified+91 -33
| @@ -659,12 +659,24 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 659 | width: ColumnWidth, | 659 | width: ColumnWidth, |
| 660 | is_full_width: bool, | 660 | is_full_width: bool, |
| 661 | ) { | 661 | ) { |
| 662 | - self.enter_output_for_window(&window); | 662 | + let tile = Tile::new(window, self.options.clone()); |
| 663 | + self.add_tile_at(col_idx, tile, activate, width, is_full_width); | ||
| 664 | + } | ||
| 665 | + | ||
| 666 | + fn add_tile_at( | ||
| 667 | + &mut self, | ||
| 668 | + col_idx: usize, | ||
| 669 | + tile: Tile<W>, | ||
| 670 | + activate: bool, | ||
| 671 | + width: ColumnWidth, | ||
| 672 | + is_full_width: bool, | ||
| 673 | + ) { | ||
| 674 | + self.enter_output_for_window(tile.window()); | ||
| 663 | 675 | ||
| 664 | let was_empty = self.columns.is_empty(); | 676 | let was_empty = self.columns.is_empty(); |
| 665 | 677 | ||
| 666 | - let column = Column::new( | 678 | + let column = Column::new_with_tile( |
| 667 | - window, | 679 | + tile, |
| 668 | self.view_size, | 680 | self.view_size, |
| 669 | self.working_area, | 681 | self.working_area, |
| 670 | self.options.clone(), | 682 | self.options.clone(), |
| @@ -725,6 +737,16 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 725 | self.add_window_at(col_idx, window, activate, width, is_full_width); | 737 | self.add_window_at(col_idx, window, activate, width, is_full_width); |
| 726 | } | 738 | } |
| 727 | 739 | ||
| 740 | + fn add_tile(&mut self, tile: Tile<W>, activate: bool, width: ColumnWidth, is_full_width: bool) { | ||
| 741 | + let col_idx = if self.columns.is_empty() { | ||
| 742 | + 0 | ||
| 743 | + } else { | ||
| 744 | + self.active_column_idx + 1 | ||
| 745 | + }; | ||
| 746 | + | ||
| 747 | + self.add_tile_at(col_idx, tile, activate, width, is_full_width); | ||
| 748 | + } | ||
| 749 | + | ||
| 728 | pub fn add_window_right_of( | 750 | pub fn add_window_right_of( |
| 729 | &mut self, | 751 | &mut self, |
| 730 | right_of: &W::Id, | 752 | right_of: &W::Id, |
| @@ -825,7 +847,7 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 825 | } | 847 | } |
| 826 | } | 848 | } |
| 827 | 849 | ||
| 828 | - pub fn remove_window_by_idx(&mut self, column_idx: usize, window_idx: usize) -> W { | 850 | + pub fn remove_tile_by_idx(&mut self, column_idx: usize, window_idx: usize) -> Tile<W> { |
| 829 | let offset = self.column_x(column_idx + 1) - self.column_x(column_idx); | 851 | let offset = self.column_x(column_idx + 1) - self.column_x(column_idx); |
| 830 | 852 | ||
| 831 | let column = &mut self.columns[column_idx]; | 853 | let column = &mut self.columns[column_idx]; |
| @@ -840,11 +862,11 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 840 | ); | 862 | ); |
| 841 | } | 863 | } |
| 842 | 864 | ||
| 843 | - let window = column.tiles.remove(window_idx).into_window(); | 865 | + let tile = column.tiles.remove(window_idx); |
| 844 | column.heights.remove(window_idx); | 866 | column.heights.remove(window_idx); |
| 845 | 867 | ||
| 846 | if let Some(output) = &self.output { | 868 | if let Some(output) = &self.output { |
| 847 | - window.output_leave(output); | 869 | + tile.window().output_leave(output); |
| 848 | } | 870 | } |
| 849 | 871 | ||
| 850 | if column.tiles.is_empty() { | 872 | if column.tiles.is_empty() { |
| @@ -871,7 +893,7 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 871 | 893 | ||
| 872 | self.columns.remove(column_idx); | 894 | self.columns.remove(column_idx); |
| 873 | if self.columns.is_empty() { | 895 | if self.columns.is_empty() { |
| 874 | - return window; | 896 | + return tile; |
| 875 | } | 897 | } |
| 876 | 898 | ||
| 877 | if column_idx < self.active_column_idx { | 899 | if column_idx < self.active_column_idx { |
| @@ -898,13 +920,13 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 898 | self.activate_column(min(self.active_column_idx, self.columns.len() - 1)); | 920 | self.activate_column(min(self.active_column_idx, self.columns.len() - 1)); |
| 899 | } | 921 | } |
| 900 | 922 | ||
| 901 | - return window; | 923 | + return tile; |
| 902 | } | 924 | } |
| 903 | 925 | ||
| 904 | column.active_tile_idx = min(column.active_tile_idx, column.tiles.len() - 1); | 926 | column.active_tile_idx = min(column.active_tile_idx, column.tiles.len() - 1); |
| 905 | column.update_tile_sizes(true); | 927 | column.update_tile_sizes(true); |
| 906 | 928 | ||
| 907 | - window | 929 | + tile |
| 908 | } | 930 | } |
| 909 | 931 | ||
| 910 | pub fn remove_column_by_idx(&mut self, column_idx: usize) -> Column<W> { | 932 | pub fn remove_column_by_idx(&mut self, column_idx: usize) -> Column<W> { |
| @@ -978,7 +1000,8 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 978 | let column = &self.columns[column_idx]; | 1000 | let column = &self.columns[column_idx]; |
| 979 | 1001 | ||
| 980 | let window_idx = column.position(window).unwrap(); | 1002 | let window_idx = column.position(window).unwrap(); |
| 981 | - self.remove_window_by_idx(column_idx, window_idx) | 1003 | + self.remove_tile_by_idx(column_idx, window_idx) |
| 1004 | + .into_window() | ||
| 982 | } | 1005 | } |
| 983 | 1006 | ||
| 984 | pub fn update_window(&mut self, window: &W::Id) { | 1007 | pub fn update_window(&mut self, window: &W::Id) { |
| @@ -1173,6 +1196,7 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1173 | assert!(self.active_column_idx < self.columns.len()); | 1196 | assert!(self.active_column_idx < self.columns.len()); |
| 1174 | 1197 | ||
| 1175 | for column in &self.columns { | 1198 | for column in &self.columns { |
| 1199 | + assert!(Rc::ptr_eq(&self.options, &column.options)); | ||
| 1176 | column.verify_invariants(); | 1200 | column.verify_invariants(); |
| 1177 | } | 1201 | } |
| 1178 | 1202 | ||
| @@ -1330,17 +1354,19 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1330 | let target_column_idx = source_col_idx - 1; | 1354 | let target_column_idx = source_col_idx - 1; |
| 1331 | 1355 | ||
| 1332 | // Make sure the previous (target) column is activated so the animation looks right. | 1356 | // Make sure the previous (target) column is activated so the animation looks right. |
| 1333 | - self.activate_prev_column_on_removal = Some(self.static_view_offset()); | 1357 | + self.activate_prev_column_on_removal = Some(self.static_view_offset() + offset_x); |
| 1334 | - let window = self.remove_window_by_idx(source_col_idx, 0); | 1358 | + let offset_x = offset_x + self.columns[source_col_idx].render_offset().x; |
| 1335 | - self.enter_output_for_window(&window); | 1359 | + let tile = self.remove_tile_by_idx(source_col_idx, 0); |
| 1360 | + self.enter_output_for_window(tile.window()); | ||
| 1336 | 1361 | ||
| 1337 | let next_col_idx = source_col_idx; | 1362 | let next_col_idx = source_col_idx; |
| 1338 | let prev_next_x = self.column_x(next_col_idx); | 1363 | let prev_next_x = self.column_x(next_col_idx); |
| 1339 | 1364 | ||
| 1340 | let target_column = &mut self.columns[target_column_idx]; | 1365 | let target_column = &mut self.columns[target_column_idx]; |
| 1366 | + let offset_x = offset_x - target_column.render_offset().x; | ||
| 1341 | let offset_y = prev_y - target_column.tile_y(target_column.tiles.len()); | 1367 | let offset_y = prev_y - target_column.tile_y(target_column.tiles.len()); |
| 1342 | 1368 | ||
| 1343 | - target_column.add_window(window, true); | 1369 | + target_column.add_tile(tile, true); |
| 1344 | target_column.focus_last(); | 1370 | target_column.focus_last(); |
| 1345 | 1371 | ||
| 1346 | let new_tile = target_column.tiles.last_mut().unwrap(); | 1372 | let new_tile = target_column.tiles.last_mut().unwrap(); |
| @@ -1357,15 +1383,17 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1357 | let width = source_column.width; | 1383 | let width = source_column.width; |
| 1358 | let is_full_width = source_column.is_full_width; | 1384 | let is_full_width = source_column.is_full_width; |
| 1359 | 1385 | ||
| 1360 | - let window = self.remove_window_by_idx(source_col_idx, source_column.active_tile_idx); | 1386 | + let offset_x = source_column.render_offset().x; |
| 1387 | + | ||
| 1388 | + let tile = self.remove_tile_by_idx(source_col_idx, source_column.active_tile_idx); | ||
| 1361 | 1389 | ||
| 1362 | - self.add_window_at(self.active_column_idx, window, true, width, is_full_width); | 1390 | + self.add_tile_at(self.active_column_idx, tile, true, width, is_full_width); |
| 1363 | // We added to the left, don't activate even further left on removal. | 1391 | // We added to the left, don't activate even further left on removal. |
| 1364 | self.activate_prev_column_on_removal = None; | 1392 | self.activate_prev_column_on_removal = None; |
| 1365 | 1393 | ||
| 1366 | let new_col = &mut self.columns[self.active_column_idx]; | 1394 | let new_col = &mut self.columns[self.active_column_idx]; |
| 1367 | let offset_y = prev_y - new_col.tile_y(0); | 1395 | let offset_y = prev_y - new_col.tile_y(0); |
| 1368 | - new_col.tiles[0].animate_move_from(Point::from((0, offset_y))); | 1396 | + new_col.tiles[0].animate_move_from(Point::from((offset_x, offset_y))); |
| 1369 | } | 1397 | } |
| 1370 | } | 1398 | } |
| 1371 | 1399 | ||
| @@ -1378,6 +1406,7 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1378 | let offset_x = self.column_x(source_col_idx) - self.column_x(source_col_idx + 1); | 1406 | let offset_x = self.column_x(source_col_idx) - self.column_x(source_col_idx + 1); |
| 1379 | 1407 | ||
| 1380 | let source_column = &self.columns[source_col_idx]; | 1408 | let source_column = &self.columns[source_col_idx]; |
| 1409 | + let offset_x = offset_x + source_column.render_offset().x; | ||
| 1381 | let prev_y = source_column.tile_y(source_column.active_tile_idx); | 1410 | let prev_y = source_column.tile_y(source_column.active_tile_idx); |
| 1382 | 1411 | ||
| 1383 | if source_column.tiles.len() == 1 { | 1412 | if source_column.tiles.len() == 1 { |
| @@ -1388,17 +1417,19 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1388 | // Move into adjacent column. | 1417 | // Move into adjacent column. |
| 1389 | let target_column_idx = source_col_idx; | 1418 | let target_column_idx = source_col_idx; |
| 1390 | 1419 | ||
| 1420 | + let offset_x = offset_x - self.columns[source_col_idx + 1].render_offset().x; | ||
| 1421 | + | ||
| 1391 | // Make sure the target column gets activated. | 1422 | // Make sure the target column gets activated. |
| 1392 | self.activate_prev_column_on_removal = None; | 1423 | self.activate_prev_column_on_removal = None; |
| 1393 | - let window = self.remove_window_by_idx(source_col_idx, 0); | 1424 | + let tile = self.remove_tile_by_idx(source_col_idx, 0); |
| 1394 | - self.enter_output_for_window(&window); | 1425 | + self.enter_output_for_window(tile.window()); |
| 1395 | 1426 | ||
| 1396 | let prev_next_x = self.column_x(target_column_idx + 1); | 1427 | let prev_next_x = self.column_x(target_column_idx + 1); |
| 1397 | 1428 | ||
| 1398 | let target_column = &mut self.columns[target_column_idx]; | 1429 | let target_column = &mut self.columns[target_column_idx]; |
| 1399 | let offset_y = prev_y - target_column.tile_y(target_column.tiles.len()); | 1430 | let offset_y = prev_y - target_column.tile_y(target_column.tiles.len()); |
| 1400 | 1431 | ||
| 1401 | - target_column.add_window(window, true); | 1432 | + target_column.add_tile(tile, true); |
| 1402 | target_column.focus_last(); | 1433 | target_column.focus_last(); |
| 1403 | 1434 | ||
| 1404 | let new_tile = target_column.tiles.last_mut().unwrap(); | 1435 | let new_tile = target_column.tiles.last_mut().unwrap(); |
| @@ -1414,9 +1445,10 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1414 | // Move out of column. | 1445 | // Move out of column. |
| 1415 | let width = source_column.width; | 1446 | let width = source_column.width; |
| 1416 | let is_full_width = source_column.is_full_width; | 1447 | let is_full_width = source_column.is_full_width; |
| 1417 | - let window = self.remove_window_by_idx(source_col_idx, source_column.active_tile_idx); | ||
| 1418 | 1448 | ||
| 1419 | - self.add_window(window, true, width, is_full_width); | 1449 | + let tile = self.remove_tile_by_idx(source_col_idx, source_column.active_tile_idx); |
| 1450 | + | ||
| 1451 | + self.add_tile(tile, true, width, is_full_width); | ||
| 1420 | 1452 | ||
| 1421 | let new_col = &mut self.columns[self.active_column_idx]; | 1453 | let new_col = &mut self.columns[self.active_column_idx]; |
| 1422 | let offset_y = prev_y - new_col.tile_y(0); | 1454 | let offset_y = prev_y - new_col.tile_y(0); |
| @@ -1435,11 +1467,13 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1435 | 1467 | ||
| 1436 | let source_column_idx = self.active_column_idx + 1; | 1468 | let source_column_idx = self.active_column_idx + 1; |
| 1437 | 1469 | ||
| 1438 | - let offset_x = self.column_x(source_column_idx) - self.column_x(self.active_column_idx); | 1470 | + let offset_x = self.column_x(source_column_idx) |
| 1471 | + + self.columns[source_column_idx].render_offset().x | ||
| 1472 | + - self.column_x(self.active_column_idx); | ||
| 1439 | let prev_y = self.columns[source_column_idx].tile_y(0); | 1473 | let prev_y = self.columns[source_column_idx].tile_y(0); |
| 1440 | 1474 | ||
| 1441 | - let window = self.remove_window_by_idx(source_column_idx, 0); | 1475 | + let tile = self.remove_tile_by_idx(source_column_idx, 0); |
| 1442 | - self.enter_output_for_window(&window); | 1476 | + self.enter_output_for_window(tile.window()); |
| 1443 | 1477 | ||
| 1444 | let prev_next_x = self.column_x(self.active_column_idx + 1); | 1478 | let prev_next_x = self.column_x(self.active_column_idx + 1); |
| 1445 | 1479 | ||
| @@ -1447,12 +1481,14 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1447 | let was_fullscreen = target_column.tiles[target_column.active_tile_idx].is_fullscreen(); | 1481 | let was_fullscreen = target_column.tiles[target_column.active_tile_idx].is_fullscreen(); |
| 1448 | let offset_y = prev_y - target_column.tile_y(target_column.tiles.len()); | 1482 | let offset_y = prev_y - target_column.tile_y(target_column.tiles.len()); |
| 1449 | 1483 | ||
| 1450 | - target_column.add_window(window, true); | 1484 | + target_column.add_tile(tile, true); |
| 1451 | 1485 | ||
| 1452 | if !was_fullscreen { | 1486 | if !was_fullscreen { |
| 1453 | self.view_offset_before_fullscreen = None; | 1487 | self.view_offset_before_fullscreen = None; |
| 1454 | } | 1488 | } |
| 1455 | 1489 | ||
| 1490 | + let offset_x = offset_x - target_column.render_offset().x; | ||
| 1491 | + | ||
| 1456 | let new_tile = target_column.tiles.last_mut().unwrap(); | 1492 | let new_tile = target_column.tiles.last_mut().unwrap(); |
| 1457 | new_tile.animate_move_from(Point::from((offset_x, offset_y))); | 1493 | new_tile.animate_move_from(Point::from((offset_x, offset_y))); |
| 1458 | 1494 | ||
| @@ -1477,14 +1513,15 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 1477 | return; | 1513 | return; |
| 1478 | } | 1514 | } |
| 1479 | 1515 | ||
| 1516 | + let offset_x = offset_x + source_column.render_offset().x; | ||
| 1517 | + | ||
| 1480 | let prev_y = source_column.tile_y(source_column.active_tile_idx); | 1518 | let prev_y = source_column.tile_y(source_column.active_tile_idx); |
| 1481 | 1519 | ||
| 1482 | let width = source_column.width; | 1520 | let width = source_column.width; |
| 1483 | let is_full_width = source_column.is_full_width; | 1521 | let is_full_width = source_column.is_full_width; |
| 1484 | - let window = | 1522 | + let tile = self.remove_tile_by_idx(self.active_column_idx, source_column.active_tile_idx); |
| 1485 | - self.remove_window_by_idx(self.active_column_idx, source_column.active_tile_idx); | ||
| 1486 | 1523 | ||
| 1487 | - self.add_window(window, true, width, is_full_width); | 1524 | + self.add_tile(tile, true, width, is_full_width); |
| 1488 | 1525 | ||
| 1489 | let new_col = &mut self.columns[self.active_column_idx]; | 1526 | let new_col = &mut self.columns[self.active_column_idx]; |
| 1490 | let offset_y = prev_y - new_col.tile_y(0); | 1527 | let offset_y = prev_y - new_col.tile_y(0); |
| @@ -2022,6 +2059,27 @@ impl<W: LayoutElement> Column<W> { | |||
| 2022 | width: ColumnWidth, | 2059 | width: ColumnWidth, |
| 2023 | is_full_width: bool, | 2060 | is_full_width: bool, |
| 2024 | animate_resize: bool, | 2061 | animate_resize: bool, |
| 2062 | + ) -> Self { | ||
| 2063 | + let tile = Tile::new(window, options.clone()); | ||
| 2064 | + Self::new_with_tile( | ||
| 2065 | + tile, | ||
| 2066 | + view_size, | ||
| 2067 | + working_area, | ||
| 2068 | + options, | ||
| 2069 | + width, | ||
| 2070 | + is_full_width, | ||
| 2071 | + animate_resize, | ||
| 2072 | + ) | ||
| 2073 | + } | ||
| 2074 | + | ||
| 2075 | + fn new_with_tile( | ||
| 2076 | + tile: Tile<W>, | ||
| 2077 | + view_size: Size<i32, Logical>, | ||
| 2078 | + working_area: Rectangle<i32, Logical>, | ||
| 2079 | + options: Rc<Options>, | ||
| 2080 | + width: ColumnWidth, | ||
| 2081 | + is_full_width: bool, | ||
| 2082 | + animate_resize: bool, | ||
| 2025 | ) -> Self { | 2083 | ) -> Self { |
| 2026 | let mut rv = Self { | 2084 | let mut rv = Self { |
| 2027 | tiles: vec![], | 2085 | tiles: vec![], |
| @@ -2037,9 +2095,9 @@ impl<W: LayoutElement> Column<W> { | |||
| 2037 | options, | 2095 | options, |
| 2038 | }; | 2096 | }; |
| 2039 | 2097 | ||
| 2040 | - let is_pending_fullscreen = window.is_pending_fullscreen(); | 2098 | + let is_pending_fullscreen = tile.window().is_pending_fullscreen(); |
| 2041 | 2099 | ||
| 2042 | - rv.add_window(window, animate_resize); | 2100 | + rv.add_tile(tile, animate_resize); |
| 2043 | 2101 | ||
| 2044 | if is_pending_fullscreen { | 2102 | if is_pending_fullscreen { |
| 2045 | rv.set_fullscreen(true); | 2103 | rv.set_fullscreen(true); |
| @@ -2171,8 +2229,7 @@ impl<W: LayoutElement> Column<W> { | |||
| 2171 | self.active_tile_idx = idx; | 2229 | self.active_tile_idx = idx; |
| 2172 | } | 2230 | } |
| 2173 | 2231 | ||
| 2174 | - fn add_window(&mut self, window: W, animate: bool) { | 2232 | + fn add_tile(&mut self, tile: Tile<W>, animate: bool) { |
| 2175 | - let tile = Tile::new(window, self.options.clone()); | ||
| 2176 | self.is_fullscreen = false; | 2233 | self.is_fullscreen = false; |
| 2177 | self.tiles.push(tile); | 2234 | self.tiles.push(tile); |
| 2178 | self.heights.push(WindowHeight::Auto); | 2235 | self.heights.push(WindowHeight::Auto); |
| @@ -2437,6 +2494,7 @@ impl<W: LayoutElement> Column<W> { | |||
| 2437 | } | 2494 | } |
| 2438 | 2495 | ||
| 2439 | for tile in &self.tiles { | 2496 | for tile in &self.tiles { |
| 2497 | + assert!(Rc::ptr_eq(&self.options, &tile.options)); | ||
| 2440 | assert_eq!(self.is_fullscreen, tile.window().is_pending_fullscreen()); | 2498 | assert_eq!(self.is_fullscreen, tile.window().is_pending_fullscreen()); |
| 2441 | } | 2499 | } |
| 2442 | } | 2500 | } |