Skip to content

[GUI] Bring window to front on tray Quit even when only obscured, not minimized - #5135

Open
xhon-pelushi wants to merge 1 commit into
canonical:mainfrom
xhon-pelushi:fix/tray-quit-ask-focus-4210
Open

[GUI] Bring window to front on tray Quit even when only obscured, not minimized#5135
xhon-pelushi wants to merge 1 commit into
canonical:mainfrom
xhon-pelushi:fix/tray-quit-ask-focus-4210

Conversation

@xhon-pelushi

Copy link
Copy Markdown

What this does

With "Ask about running instances" enabled, clicking tray Quit while the Multipass GUI window is obscured by another window (visible, not minimized, but not focused) never brought the confirmation dialog to front — so it looked like nothing happened.

onWindowClose() only called windowManager.showAndRestore() when the window was invisible or minimized, missing the "obscured but visible" case. This adds !await windowManager.isFocused() to that condition, so the window is restored/focused whenever it isn't already, not just when hidden or minimized.

Testing

Fixes #4210

Clicking "Quit" on the tray icon only restored the window when it
was hidden or minimized. If the window was merely obscured by
another window (visible, not minimized, but not focused), the
before-quit confirmation dialog was shown behind it, giving the
appearance that Quit had no effect.

Also check isFocused() so the window is brought to the front in
that case.

Fixes canonical#4210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GUI] Quit appears to fail when called from the tray and set to ask

1 participant