mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
layout: Preserve the Tile when moving across workspaces
This commit is contained in:
@@ -606,6 +606,9 @@ impl<W: LayoutElement> FloatingSpace<W> {
|
|||||||
|
|
||||||
let win_size = Size::from((win_width, win_height));
|
let win_size = Size::from((win_width, win_height));
|
||||||
win.request_size_once(win_size, animate);
|
win.request_size_once(win_size, animate);
|
||||||
|
|
||||||
|
// Store it right away so pending resizes are not lost when moving across floating spaces.
|
||||||
|
tile.set_floating_window_size(win_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_window_height(&mut self, id: Option<&W::Id>, change: SizeChange, animate: bool) {
|
pub fn set_window_height(&mut self, id: Option<&W::Id>, change: SizeChange, animate: bool) {
|
||||||
@@ -636,6 +639,9 @@ impl<W: LayoutElement> FloatingSpace<W> {
|
|||||||
|
|
||||||
let win_size = Size::from((win_width, win_height));
|
let win_size = Size::from((win_width, win_height));
|
||||||
win.request_size_once(win_size, animate);
|
win.request_size_once(win_size, animate);
|
||||||
|
|
||||||
|
// Store it right away so pending resizes are not lost when moving across floating spaces.
|
||||||
|
tile.set_floating_window_size(win_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn focus_directional(
|
fn focus_directional(
|
||||||
|
|||||||
+36
-24
@@ -530,14 +530,18 @@ impl<W: LayoutElement> Monitor<W> {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.add_window(
|
if removed.is_floating {
|
||||||
new_idx,
|
self.add_floating_tile(new_idx, removed.tile, None, true);
|
||||||
removed.tile.into_window(),
|
} else {
|
||||||
true,
|
self.add_tile(
|
||||||
removed.width,
|
new_idx,
|
||||||
removed.is_full_width,
|
None,
|
||||||
removed.is_floating,
|
removed.tile,
|
||||||
);
|
true,
|
||||||
|
removed.width,
|
||||||
|
removed.is_full_width,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn move_to_workspace_down(&mut self) {
|
pub fn move_to_workspace_down(&mut self) {
|
||||||
@@ -553,14 +557,18 @@ impl<W: LayoutElement> Monitor<W> {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.add_window(
|
if removed.is_floating {
|
||||||
new_idx,
|
self.add_floating_tile(new_idx, removed.tile, None, true);
|
||||||
removed.tile.into_window(),
|
} else {
|
||||||
true,
|
self.add_tile(
|
||||||
removed.width,
|
new_idx,
|
||||||
removed.is_full_width,
|
None,
|
||||||
removed.is_floating,
|
removed.tile,
|
||||||
);
|
true,
|
||||||
|
removed.width,
|
||||||
|
removed.is_full_width,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn move_to_workspace(&mut self, window: Option<&W::Id>, idx: usize) {
|
pub fn move_to_workspace(&mut self, window: Option<&W::Id>, idx: usize) {
|
||||||
@@ -592,14 +600,18 @@ impl<W: LayoutElement> Monitor<W> {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.add_window(
|
if removed.is_floating {
|
||||||
new_idx,
|
self.add_floating_tile(new_idx, removed.tile, None, activate);
|
||||||
removed.tile.into_window(),
|
} else {
|
||||||
activate,
|
self.add_tile(
|
||||||
removed.width,
|
new_idx,
|
||||||
removed.is_full_width,
|
None,
|
||||||
removed.is_floating,
|
removed.tile,
|
||||||
);
|
activate,
|
||||||
|
removed.width,
|
||||||
|
removed.is_full_width,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if self.workspace_switch.is_none() {
|
if self.workspace_switch.is_none() {
|
||||||
self.clean_up_workspaces();
|
self.clean_up_workspaces();
|
||||||
|
|||||||
Reference in New Issue
Block a user