aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-02-05 09:32:47 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-02-05 09:35:10 +0300
commit734e3a6d3cea277e56baf4531695e989b2d1bdda (patch)
tree71d6e8e9ceb01e8d9f4acaa6b04514bad1ef3142 /src/niri.rs
parentf18b1a70434755b92a8f0a59e8aa0302309e8b3a (diff)
downloadniri-734e3a6d3cea277e56baf4531695e989b2d1bdda.tar.gz
niri-734e3a6d3cea277e56baf4531695e989b2d1bdda.tar.bz2
niri-734e3a6d3cea277e56baf4531695e989b2d1bdda.zip
Fix find_window_and_output() returning None with no outputs
As far as I can tell, this would mess up a ton of the logic. Not sure how anything worked with no outputs before?
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 36c56f30..37620e4c 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -2898,6 +2898,9 @@ impl Niri {
// Check the main layout.
let win_out = self.layout.find_window_and_output(root);
let layout_output = win_out.map(|(_, output)| output);
+ if let Some(output) = layout_output {
+ return output;
+ }
// Check layer-shell.
let has_layer_surface = |o: &&Output| {
@@ -2905,9 +2908,7 @@ impl Niri {
.layer_for_surface(root, WindowSurfaceType::TOPLEVEL)
.is_some()
};
- let layer_shell_output = || self.layout.outputs().find(has_layer_surface);
-
- layout_output.or_else(layer_shell_output)
+ self.layout.outputs().find(has_layer_surface)
}
pub fn lock_surface_focus(&self) -> Option<WlSurface> {