aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-04-09 22:34:41 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-04-09 23:42:01 +0400
commit301a2c06613c76d2c16a85ab21ad132e5618454b (patch)
tree9ab32515adb3ef5e7f43b3e0962862dfb84c809a /src
parent956bf7c0a84d2c5d618358b8577f361b275bf71a (diff)
downloadniri-301a2c06613c76d2c16a85ab21ad132e5618454b.tar.gz
niri-301a2c06613c76d2c16a85ab21ad132e5618454b.tar.bz2
niri-301a2c06613c76d2c16a85ab21ad132e5618454b.zip
layout: Fix view jumps when removing a window on the left
Diffstat (limited to 'src')
-rw-r--r--src/layout/workspace.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs
index f337a74a..ab23a1f0 100644
--- a/src/layout/workspace.rs
+++ b/src/layout/workspace.rs
@@ -767,9 +767,6 @@ impl<W: LayoutElement> Workspace<W> {
self.activate_prev_column_on_removal = None;
}
- // FIXME: activate_column below computes current view position to compute the new view
- // position, which can include the column we're removing here. This leads to unwanted
- // view jumps.
self.columns.remove(column_idx);
if self.columns.is_empty() {
return window;
@@ -778,7 +775,8 @@ impl<W: LayoutElement> Workspace<W> {
if column_idx < self.active_column_idx {
// A column to the left was removed; preserve the current position.
// FIXME: preserve activate_prev_column_on_removal.
- self.activate_column(self.active_column_idx - 1);
+ self.active_column_idx -= 1;
+ self.activate_prev_column_on_removal = None;
} else if column_idx == self.active_column_idx
&& self.activate_prev_column_on_removal.is_some()
{
@@ -822,9 +820,6 @@ impl<W: LayoutElement> Workspace<W> {
self.activate_prev_column_on_removal = None;
}
- // FIXME: activate_column below computes current view position to compute the new view
- // position, which can include the column we're removing here. This leads to unwanted
- // view jumps.
if self.columns.is_empty() {
return column;
}
@@ -832,7 +827,8 @@ impl<W: LayoutElement> Workspace<W> {
if column_idx < self.active_column_idx {
// A column to the left was removed; preserve the current position.
// FIXME: preserve activate_prev_column_on_removal.
- self.activate_column(self.active_column_idx - 1);
+ self.active_column_idx -= 1;
+ self.activate_prev_column_on_removal = None;
} else if column_idx == self.active_column_idx
&& self.activate_prev_column_on_removal.is_some()
{