diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-11 18:05:50 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-11 18:07:41 +0300 |
| commit | 17861e0003c122dec9ad8cca1177c750ca6390c8 (patch) | |
| tree | 101552c7cda0f86e39452bc5e14723c32338a78e | |
| parent | 97fe964e000ddff1f368726149a00de5b7681d50 (diff) | |
| download | niri-17861e0003c122dec9ad8cca1177c750ca6390c8.tar.gz niri-17861e0003c122dec9ad8cca1177c750ca6390c8.tar.bz2 niri-17861e0003c122dec9ad8cca1177c750ca6390c8.zip | |
Change expel-window-from-column to expel the bottom window
This way, expel becomes symmetric with consume. This is also how it
works in PaperWM. Though, in PaperWM if the expelled window was focused,
it will remain focused, while in this commit it is never focused, making
it the exact opposite of consume.
Use consume-or-expel-window-right for the old expel behavior.
| -rw-r--r-- | resources/default-config.kdl | 4 | ||||
| -rw-r--r-- | src/layout/workspace.rs | 14 |
2 files changed, 8 insertions, 10 deletions
diff --git a/resources/default-config.kdl b/resources/default-config.kdl index e3f06f49..aa454479 100644 --- a/resources/default-config.kdl +++ b/resources/default-config.kdl @@ -447,9 +447,9 @@ binds { Mod+BracketLeft { consume-or-expel-window-left; } Mod+BracketRight { consume-or-expel-window-right; } - // Consume one window from the right into the focused column. + // Consume one window from the right to the bottom of the focused column. Mod+Comma { consume-window-into-column; } - // Expel one window from the focused column to the right. + // Expel the bottom window from the focused column to the right. Mod+Period { expel-window-from-column; } Mod+R { switch-preset-column-width; } diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 7dab2bc0..b26dfcc1 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -2153,20 +2153,18 @@ impl<W: LayoutElement> Workspace<W> { return; } + let source_tile_idx = source_column.tiles.len() - 1; + let mut offset = Point::from((source_column.render_offset().x, 0.)); - let prev_off = source_column.tile_offset(source_column.active_tile_idx); + let prev_off = source_column.tile_offset(source_tile_idx); - let removed = self.remove_tile_by_idx( - source_col_idx, - source_column.active_tile_idx, - Transaction::new(), - None, - ); + let removed = + self.remove_tile_by_idx(source_col_idx, source_tile_idx, Transaction::new(), None); self.add_tile( Some(target_col_idx), removed.tile, - true, + false, removed.width, removed.is_full_width, Some(self.options.animations.window_movement.0), |
