diff options
Diffstat (limited to 'src/layer')
| -rw-r--r-- | src/layer/mapped.rs | 18 | ||||
| -rw-r--r-- | src/layer/mod.rs | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/layer/mapped.rs b/src/layer/mapped.rs index 5e62d033..78cfadbf 100644 --- a/src/layer/mapped.rs +++ b/src/layer/mapped.rs @@ -6,6 +6,7 @@ use smithay::backend::renderer::element::surface::{ use smithay::backend::renderer::element::Kind; use smithay::desktop::{LayerSurface, PopupManager}; use smithay::utils::{Logical, Point, Scale, Size}; +use smithay::wayland::shell::wlr_layer::{ExclusiveZone, Layer}; use super::ResolvedLayerRules; use crate::layout::shadow::Shadow; @@ -96,6 +97,23 @@ impl MappedLayer { true } + pub fn place_within_backdrop(&self) -> bool { + if !self.rules.place_within_backdrop { + return false; + } + + if self.surface.layer() != Layer::Background { + return false; + } + + let state = self.surface.cached_state(); + if state.exclusive_zone != ExclusiveZone::DontCare { + return false; + } + + true + } + pub fn render<R: NiriRenderer>( &self, renderer: &mut R, diff --git a/src/layer/mod.rs b/src/layer/mod.rs index 36e7ee67..3b27737c 100644 --- a/src/layer/mod.rs +++ b/src/layer/mod.rs @@ -19,6 +19,9 @@ pub struct ResolvedLayerRules { /// Corner radius to assume this layer surface has. pub geometry_corner_radius: Option<CornerRadius>, + + /// Whether to place this layer surface within the overview backdrop. + pub place_within_backdrop: bool, } impl ResolvedLayerRules { @@ -37,6 +40,7 @@ impl ResolvedLayerRules { inactive_color: None, }, geometry_corner_radius: None, + place_within_backdrop: false, } } @@ -73,6 +77,9 @@ impl ResolvedLayerRules { if let Some(x) = rule.geometry_corner_radius { resolved.geometry_corner_radius = Some(x); } + if let Some(x) = rule.place_within_backdrop { + resolved.place_within_backdrop = x; + } resolved.shadow.merge_with(&rule.shadow); } |
