diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-27 14:09:55 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-27 14:09:55 +0400 |
| commit | 6d7c220137f10b6a5a579043e82a54659488cc04 (patch) | |
| tree | d0eb44e920ca8284a9e80d9d756dd80e93db81f4 | |
| parent | d77aac1afa0c61c26e39f36c5b38f026af884986 (diff) | |
| download | niri-6d7c220137f10b6a5a579043e82a54659488cc04.tar.gz niri-6d7c220137f10b6a5a579043e82a54659488cc04.tar.bz2 niri-6d7c220137f10b6a5a579043e82a54659488cc04.zip | |
Try harder to find an output for the screenshot UI
The mouse might be outside any outputs, let's try to open in that case
anyway.
| -rw-r--r-- | src/niri.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/niri.rs b/src/niri.rs index 97bbd498..1bb8a6d0 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -2508,7 +2508,11 @@ impl Niri { return; } - let Some(default_output) = self.output_under_cursor() else { + let default_output = self + .output_under_cursor() + .or_else(|| self.layout.active_output().cloned()) + .or_else(|| self.global_space.outputs().next().cloned()); + let Some(default_output) = default_output else { return; }; |
