aboutsummaryrefslogtreecommitdiff
path: root/src/layout/workspace.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-02-04 21:23:00 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-02-04 21:23:00 +0400
commit7a4bb8ba8ae9022c572c5d4b66182f1af7fd3fb7 (patch)
treefd0519ce89fb833b726ba1dbacb75ce2db094c67 /src/layout/workspace.rs
parent72c8f569aca37ec45420b086a1aa488f5c4a2bd7 (diff)
downloadniri-7a4bb8ba8ae9022c572c5d4b66182f1af7fd3fb7.tar.gz
niri-7a4bb8ba8ae9022c572c5d4b66182f1af7fd3fb7.tar.bz2
niri-7a4bb8ba8ae9022c572c5d4b66182f1af7fd3fb7.zip
layout: Make rendering not Window-specific
Doesn't need to be any more.
Diffstat (limited to 'src/layout/workspace.rs')
-rw-r--r--src/layout/workspace.rs46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs
index 73a87376..5ecd25e0 100644
--- a/src/layout/workspace.rs
+++ b/src/layout/workspace.rs
@@ -1058,29 +1058,6 @@ impl<W: LayoutElement> Workspace<W> {
self.columns[self.active_column_idx].is_fullscreen
}
-}
-
-impl Workspace<Window> {
- pub fn refresh(&self, is_active: bool) {
- let bounds = self.toplevel_bounds();
-
- for (col_idx, col) in self.columns.iter().enumerate() {
- for (tile_idx, tile) in col.tiles.iter().enumerate() {
- let win = tile.window();
- let active = is_active
- && self.active_column_idx == col_idx
- && col.active_tile_idx == tile_idx;
- win.set_activated(active);
-
- win.toplevel().with_pending_state(|state| {
- state.bounds = Some(bounds);
- });
-
- win.toplevel().send_pending_configure();
- win.refresh();
- }
- }
- }
pub fn render_elements<R: Renderer + ImportAll>(
&self,
@@ -1137,6 +1114,29 @@ impl Workspace<Window> {
}
}
+impl Workspace<Window> {
+ pub fn refresh(&self, is_active: bool) {
+ let bounds = self.toplevel_bounds();
+
+ for (col_idx, col) in self.columns.iter().enumerate() {
+ for (tile_idx, tile) in col.tiles.iter().enumerate() {
+ let win = tile.window();
+ let active = is_active
+ && self.active_column_idx == col_idx
+ && col.active_tile_idx == tile_idx;
+ win.set_activated(active);
+
+ win.toplevel().with_pending_state(|state| {
+ state.bounds = Some(bounds);
+ });
+
+ win.toplevel().send_pending_configure();
+ win.refresh();
+ }
+ }
+ }
+}
+
impl<W: LayoutElement> Column<W> {
fn new(
window: W,