mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user