diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-12 08:16:01 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-12 09:10:59 +0300 |
| commit | c98537a2b084b5c7a38578ffe15f410d967758ac (patch) | |
| tree | ea44a5db18cb802fbefe2dfc3e9f04ba79c836ef /src/handlers/layer_shell.rs | |
| parent | 9c103f1f1d3636d28d2759138e4ebf9eebbe5e0c (diff) | |
| download | niri-c98537a2b084b5c7a38578ffe15f410d967758ac.tar.gz niri-c98537a2b084b5c7a38578ffe15f410d967758ac.tar.bz2 niri-c98537a2b084b5c7a38578ffe15f410d967758ac.zip | |
Implement baba-is-float for layers
Diffstat (limited to 'src/handlers/layer_shell.rs')
| -rw-r--r-- | src/handlers/layer_shell.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/handlers/layer_shell.rs b/src/handlers/layer_shell.rs index 04366ab3..7678ccc1 100644 --- a/src/handlers/layer_shell.rs +++ b/src/handlers/layer_shell.rs @@ -12,7 +12,7 @@ use smithay::wayland::shell::xdg::PopupSurface; use crate::layer::{MappedLayer, ResolvedLayerRules}; use crate::niri::State; -use crate::utils::{is_mapped, send_scale_transform}; +use crate::utils::{is_mapped, output_size, send_scale_transform}; impl WlrLayerShellHandler for State { fn shell_state(&mut self) -> &mut WlrLayerShellState { @@ -125,10 +125,23 @@ impl State { // Resolve rules for newly mapped layer surfaces. if was_unmapped { let config = self.niri.config.borrow(); + let rules = &config.layer_rules; let rules = ResolvedLayerRules::compute(rules, layer, self.niri.is_at_startup); - let mapped = MappedLayer::new(layer.clone(), rules, &config); + + let output_size = output_size(&output); + let scale = output.current_scale().fractional_scale(); + + let mapped = MappedLayer::new( + layer.clone(), + rules, + output_size, + scale, + self.niri.clock.clone(), + &config, + ); + let prev = self .niri .mapped_layer_surfaces |
