Fix clicking a dock icon flashing a minimized window instead of restoring it - #361
Open
svan71 wants to merge 1 commit into
Open
Fix clicking a dock icon flashing a minimized window instead of restoring it#361svan71 wants to merge 1 commit into
svan71 wants to merge 1 commit into
Conversation
…ring it _maybeMinimizeOrMaximize() decided between minimize and restore on focus alone. When an app holds a focused window and a minimized one, the click took the minimize branch and minimized every window of the app 50ms later - including the one the dash's own activate() had just restored, so the window appeared for a frame and vanished. Restoring now takes precedence: if any window of the app is hidden, unminimize and raise instead of toggling. Also stop reading event.type() through the null check right above it - an activate() raised outside an event dispatch threw there, and the catch around the wrapper swallowed the exception together with the dash's own activate(), so the click did nothing at all. The wrapper now keeps the extension's extras and the real activate() in separate try blocks.
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.
With an app that has one focused window and another minimized, clicking its dock icon made the minimized window appear and immediately vanish.
Cause
_maybeMinimizeOrMaximize()chose between minimize and restore on focus alone. The dash'sactivate()restored the minimized window, then 50 ms later this ran, saw the app was focused, and minimized every window — including the one just restored.Fix
Restore wins whenever any of the app's windows is hidden; minimize only applies when none is.
Also
An
event.type()dereference sat directly under its own null check forevent. Wheneventwas null the throw was swallowed by the wrapper'scatch, which also swallowed the realactivate()call along with it.Verification
On GNOME 50: with one window focused and one minimized, clicking the dock icon now restores and keeps the minimized window. With no window hidden, clicking still minimizes as before.