aboutsummaryrefslogtreecommitdiff
path: root/src/layout.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-11-02 13:07:01 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-11-02 13:07:01 +0400
commit889d062df7d89bf8084414c6f8fd87075c3cf85a (patch)
tree4cea8bbf31309b84b8bba85369504e214336cd3a /src/layout.rs
parent10905efeaf2de2865c619dfd086627031dedc998 (diff)
downloadniri-889d062df7d89bf8084414c6f8fd87075c3cf85a.tar.gz
niri-889d062df7d89bf8084414c6f8fd87075c3cf85a.tar.bz2
niri-889d062df7d89bf8084414c6f8fd87075c3cf85a.zip
Render top layer under fullscreen surfaces when stationary
Diffstat (limited to 'src/layout.rs')
-rw-r--r--src/layout.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/layout.rs b/src/layout.rs
index 5426af95..663a5fc3 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -1768,6 +1768,16 @@ impl<W: LayoutElement> Monitor<W> {
}
}
}
+
+ pub fn render_above_top_layer(&self) -> bool {
+ // Render above the top layer only if the view is stationary.
+ if self.workspace_switch.is_some() {
+ return false;
+ }
+
+ let ws = &self.workspaces[self.active_workspace_idx];
+ ws.render_above_top_layer()
+ }
}
impl Monitor<Window> {
@@ -2449,6 +2459,19 @@ impl<W: LayoutElement> Workspace<W> {
let value = !col.is_fullscreen;
self.set_fullscreen(window, value);
}
+
+ pub fn render_above_top_layer(&self) -> bool {
+ // Render above the top layer if we're on a fullscreen window and the view is stationary.
+ if self.columns.is_empty() {
+ return false;
+ }
+
+ if self.view_offset_anim.is_some() {
+ return false;
+ }
+
+ self.columns[self.active_column_idx].is_fullscreen
+ }
}
impl Workspace<Window> {