Raise the identities window instead of an "is ready" notification

GNOME Shell's focus-stealing prevention shows a "<app> is ready" notification
instead of raising an already-mapped window that has no valid activation token;
only a window mapped for the first time is focused in the default `smart`
mode. That is why it only happened after adding the first identity: on first
run the identities window *is* the app and is already mapped, and once a key is
added the next "Manage identities" re-presents it.

Make the identities window transient for the main window while that is
visible, so it is focused together with its parent. With no visible main window
(first run, last key removed) it stays a standalone window, as before.
This commit is contained in:
raucao committed 2026-11-28 15:34:00 +04:00
1 parent fca9851d8f
commit 0d98a53fce
2 files changed
+13

No files matched your search

+5
View File
@@ -226,6 +226,11 @@ data/ desktop, metainfo, gschema (all `.in` templates), icons, re
- The identities window is created once and `set_hide_on_close(true)`:
`AppState::listen` cannot unregister and its closures capture widgets, so a
window destroyed and rebuilt would leave listeners pointing at dead widgets.
`present_identities` makes it **transient for the main window** while that is
visible: GNOME Shell's focus-stealing prevention shows a "<app> is ready"
notification instead of raising an already-mapped window that has no valid
activation token, and a transient is focused with its parent. With no visible
main window (first run, last key removed) it stays standalone.
- **Preferences** (`ui/preferences.rs`) is an `AdwPreferencesDialog` — libadwaita
1.6 deprecated `AdwPreferencesWindow` in favour of it — built **once** and
re-presented (`AdwDialog` re-presents after being closed), with its listeners
+8
View File
@@ -250,8 +250,16 @@ impl Windows {
/// Open (or raise) the identities window — what the switcher's "Manage
/// identities…" does.
///
/// Made transient for the main window while that is on screen: GNOME Shell's
/// focus-stealing prevention shows a "<app> is ready" notification instead of
/// raising an already-mapped window that has no valid activation token, and a
/// transient is focused with its parent. With no visible main window (first
/// run, last key removed) it stays a standalone window.
pub fn present_identities(&self) {
if let Some(window) = self.identities.borrow().clone() {
let main = self.main.borrow().clone().filter(|main| main.is_visible());
window.set_transient_for(main.as_ref());
window.present();
}
}