diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-24 21:28:25 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-24 22:34:30 +0300 |
| commit | 5b6b5536fd74e4188d2aa62a1dd6b7c9eee6a816 (patch) | |
| tree | fca073c612c4f70818aeb2d5745f9730c5cf5816 /src | |
| parent | bac22dfe9f9073486848cfba5692863ed318e225 (diff) | |
| download | niri-5b6b5536fd74e4188d2aa62a1dd6b7c9eee6a816.tar.gz niri-5b6b5536fd74e4188d2aa62a1dd6b7c9eee6a816.tar.bz2 niri-5b6b5536fd74e4188d2aa62a1dd6b7c9eee6a816.zip | |
Also check pointer for activation token validity
This actually doesn't matter in most cases currently, because it more or less
checks for *anything* to have a keyboard focus, so if you have some focused
window while clicking on a mako notification, that already qualifies.
Signed-off-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers/mod.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index c23966ed..11553932 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -717,11 +717,19 @@ impl XdgActivationHandler for State { return false; }; - let keyboard = seat.get_keyboard().unwrap(); - keyboard - .last_enter() - .map(|last_enter| serial.is_no_older_than(&last_enter)) - .unwrap_or(false) + // Check the serial against both a keyboard and a pointer, since layer-shell surfaces + // with no keyboard interactivity won't have any keyboard focus. + let kb_last_enter = seat.get_keyboard().unwrap().last_enter(); + if kb_last_enter.is_some_and(|last_enter| serial.is_no_older_than(&last_enter)) { + return true; + } + + let pointer_last_enter = seat.get_pointer().unwrap().last_enter(); + if pointer_last_enter.is_some_and(|last_enter| serial.is_no_older_than(&last_enter)) { + return true; + } + + false } fn request_activation( |
