[GUI] Bring window to front on tray Quit even when only obscured, not minimized - #5135
Open
xhon-pelushi wants to merge 1 commit into
Open
[GUI] Bring window to front on tray Quit even when only obscured, not minimized#5135xhon-pelushi wants to merge 1 commit into
xhon-pelushi wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 calledwindowManager.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
flutter analyze lib/main.dart: same 5 pre-existing issues before and after (all pre-existing generated-protobuf-type issues, confirmed viagit stash/git stash pop) — zero new issues introduced.window_manager's documentedisFocused()/show()API and directly extends the existing, already-merged restore pattern from Honour the close settings when quitting from the tray #4068/Honour the close setting when quitting from the tray (clone of #4068) #4138.Fixes #4210