aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-07-16 14:36:58 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-08-21 12:26:32 +0300
commitd662811bf6d004382061380f537ffdeb0bffe892 (patch)
treeee8a973a4e5599a34725c9dd12da09b528520a26 /src/handlers
parent05337ce85560efc4d20cc23e9452a1e1f360007d (diff)
downloadniri-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/handlers')
-rw-r--r--src/handlers/xdg_shell.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs
index a9eceb67..b7123e5f 100644
--- a/src/handlers/xdg_shell.rs
+++ b/src/handlers/xdg_shell.rs
@@ -303,7 +303,11 @@ impl XdgShellHandler for State {
// We need to hand out the grab in a way consistent with what update_keyboard_focus()
// thinks the current focus is, otherwise it will desync and cause weird issues with
// keyboard focus being at the wrong place.
- if self.niri.is_locked() {
+ if self.niri.exit_confirm_dialog.is_open() {
+ trace!("ignoring popup grab because the exit confirm dialog is open");
+ let _ = PopupManager::dismiss_popup(&root, &popup);
+ return;
+ } else if self.niri.is_locked() {
if Some(&root) != self.niri.lock_surface_focus().as_ref() {
trace!("ignoring popup grab because the session is locked");
let _ = PopupManager::dismiss_popup(&root, &popup);