diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-07-16 14:36:58 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-08-21 12:26:32 +0300 |
| commit | d662811bf6d004382061380f537ffdeb0bffe892 (patch) | |
| tree | ee8a973a4e5599a34725c9dd12da09b528520a26 /src/input | |
| parent | 05337ce85560efc4d20cc23e9452a1e1f360007d (diff) | |
| download | niri-d662811bf6d004382061380f537ffdeb0bffe892.tar.gz niri-d662811bf6d004382061380f537ffdeb0bffe892.tar.bz2 niri-d662811bf6d004382061380f537ffdeb0bffe892.zip | |
Unfocus layout when exit confirm dialog is open
Screen readers expect closing a modal dialog to reannounce the previous focus.
This makes the exit confirm dialog more modal in this sense: it will unfocus
the layout and then focus it back when closed, giving the desired behavior.
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index e753c42d..6921eaa1 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -375,12 +375,13 @@ impl State { let modified = keysym.modified_sym(); let raw = keysym.raw_latin_sym_or_raw_current_sym(); - if this.niri.exit_confirm_dialog.is_open() && pressed && raw == Some(Keysym::Return) - { - info!("quitting after confirming exit dialog"); - this.niri.stop_signal.stop(); + if this.niri.exit_confirm_dialog.is_open() && pressed { + if raw == Some(Keysym::Return) { + info!("quitting after confirming exit dialog"); + this.niri.stop_signal.stop(); + } - // Don't send this Enter press to any clients. + // Don't send this press to any clients. this.niri.suppressed_keys.insert(key_code); return FilterResult::Intercept(None); } |
