|
|
22c471 |
From 0d95c2087aba7f0b07cb303c1f15d097b45f1b09 Mon Sep 17 00:00:00 2001
|
|
|
22c471 |
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
|
|
|
22c471 |
Date: Tue, 28 Apr 2020 23:26:11 +0200
|
|
|
22c471 |
Subject: [PATCH] main: Unset the right prevFocus actor after the focus stack
|
|
|
22c471 |
got shifted
|
|
|
22c471 |
MIME-Version: 1.0
|
|
|
22c471 |
Content-Type: text/plain; charset=UTF-8
|
|
|
22c471 |
Content-Transfer-Encoding: 8bit
|
|
|
22c471 |
|
|
|
22c471 |
When a modal that's not on top of the modalActorFocusStack gets popped,
|
|
|
22c471 |
we shift the focus stack as described in popModal() to ensure the chain
|
|
|
22c471 |
remains correct. That however destroys the association of a modal actor
|
|
|
22c471 |
and its prevFocus actor on the focus stack, because the prevFocus actors
|
|
|
22c471 |
are now moved to different entries of the stack.
|
|
|
22c471 |
|
|
|
22c471 |
Now when a prevFocus actor gets destroyed, we don't handle that case
|
|
|
22c471 |
correctly and search for the modal actor that was associated with the
|
|
|
22c471 |
prevFocus actor before the stack was shifted, which means we end up
|
|
|
22c471 |
unsetting the wrong prevFocus actor.
|
|
|
22c471 |
|
|
|
22c471 |
So fix that and search the stack for the prevFocus actor which is being
|
|
|
22c471 |
destroyed instead to unset the correct entry.
|
|
|
22c471 |
|
|
|
22c471 |
Thanks to Florian Müllner for figuring out the actual issue and
|
|
|
22c471 |
proposing this fix.
|
|
|
22c471 |
|
|
|
22c471 |
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2446
|
|
|
22c471 |
---
|
|
|
22c471 |
js/ui/main.js | 4 +++-
|
|
|
22c471 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
22c471 |
|
|
|
22c471 |
diff --git a/js/ui/main.js b/js/ui/main.js
|
|
|
22c471 |
index dd1d8463d..ca3dcaa3c 100644
|
|
|
22c471 |
--- a/js/ui/main.js
|
|
|
22c471 |
+++ b/js/ui/main.js
|
|
|
22c471 |
@@ -486,7 +486,9 @@ function pushModal(actor, params) {
|
|
|
22c471 |
let prevFocusDestroyId;
|
|
|
22c471 |
if (prevFocus != null) {
|
|
|
22c471 |
prevFocusDestroyId = prevFocus.connect('destroy', () => {
|
|
|
22c471 |
- let index = _findModal(actor);
|
|
|
22c471 |
+ const index = modalActorFocusStack.findIndex(
|
|
|
22c471 |
+ record => record.prevFocus === prevFocus);
|
|
|
22c471 |
+
|
|
|
22c471 |
if (index >= 0)
|
|
|
22c471 |
modalActorFocusStack[index].prevFocus = null;
|
|
|
22c471 |
});
|
|
|
22c471 |
--
|
|
|
22c471 |
2.35.1
|
|
|
22c471 |
|