aboutsummaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/floating.rs8
-rw-r--r--src/layout/mod.rs5
-rw-r--r--src/layout/scrolling.rs9
-rw-r--r--src/layout/tile.rs2
-rw-r--r--src/layout/workspace.rs8
5 files changed, 31 insertions, 1 deletions
diff --git a/src/layout/floating.rs b/src/layout/floating.rs
index cb757d67..c6a17e30 100644
--- a/src/layout/floating.rs
+++ b/src/layout/floating.rs
@@ -365,6 +365,14 @@ impl<W: LayoutElement> FloatingSpace<W> {
.map(Tile::window)
}
+ pub fn active_window_mut(&mut self) -> Option<&mut W> {
+ let id = self.active_window_id.as_ref()?;
+ self.tiles
+ .iter_mut()
+ .find(|tile| tile.window().id() == id)
+ .map(Tile::window_mut)
+ }
+
pub fn has_window(&self, id: &W::Id) -> bool {
self.tiles.iter().any(|tile| tile.window().id() == id)
}
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index eb702c37..63bedc7f 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -190,6 +190,7 @@ pub trait LayoutElement {
fn set_active_in_column(&mut self, active: bool);
fn set_floating(&mut self, floating: bool);
fn set_bounds(&self, bounds: Size<i32, Logical>);
+ fn is_ignoring_opacity_window_rule(&self) -> bool;
fn configure_intent(&self) -> ConfigureIntent;
fn send_pending_configure(&mut self);
@@ -4347,6 +4348,10 @@ mod tests {
fn set_bounds(&self, _bounds: Size<i32, Logical>) {}
+ fn is_ignoring_opacity_window_rule(&self) -> bool {
+ false
+ }
+
fn configure_intent(&self) -> ConfigureIntent {
ConfigureIntent::CanSend
}
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs
index 6b8bf760..ffb51ace 100644
--- a/src/layout/scrolling.rs
+++ b/src/layout/scrolling.rs
@@ -383,6 +383,15 @@ impl<W: LayoutElement> ScrollingSpace<W> {
Some(col.tiles[col.active_tile_idx].window())
}
+ pub fn active_window_mut(&mut self) -> Option<&mut W> {
+ if self.columns.is_empty() {
+ return None;
+ }
+
+ let col = &mut self.columns[self.active_column_idx];
+ Some(col.tiles[col.active_tile_idx].window_mut())
+ }
+
pub fn active_tile_mut(&mut self) -> Option<&mut Tile<W>> {
if self.columns.is_empty() {
return None;
diff --git a/src/layout/tile.rs b/src/layout/tile.rs
index 4a5b61a9..b8d049b0 100644
--- a/src/layout/tile.rs
+++ b/src/layout/tile.rs
@@ -720,7 +720,7 @@ impl<W: LayoutElement> Tile<W> {
) -> impl Iterator<Item = TileRenderElement<R>> + 'a {
let _span = tracy_client::span!("Tile::render_inner");
- let alpha = if self.is_fullscreen {
+ let alpha = if self.is_fullscreen || self.window.is_ignoring_opacity_window_rule() {
1.
} else {
self.window.rules().opacity.unwrap_or(1.).clamp(0., 1.)
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs
index f4c87342..4426c264 100644
--- a/src/layout/workspace.rs
+++ b/src/layout/workspace.rs
@@ -406,6 +406,14 @@ impl<W: LayoutElement> Workspace<W> {
}
}
+ pub fn active_window_mut(&mut self) -> Option<&mut W> {
+ if self.floating_is_active.get() {
+ self.floating.active_window_mut()
+ } else {
+ self.scrolling.active_window_mut()
+ }
+ }
+
pub fn is_active_fullscreen(&self) -> bool {
self.scrolling.is_active_fullscreen()
}