Skip to content

Fix clicking a dock icon flashing a minimized window instead of restoring it - #361

Open
svan71 wants to merge 1 commit into
icedman:mainfrom
svan71:fix-minimize-restore
Open

Fix clicking a dock icon flashing a minimized window instead of restoring it#361
svan71 wants to merge 1 commit into
icedman:mainfrom
svan71:fix-minimize-restore

Conversation

@svan71

@svan71 svan71 commented Jul 30, 2026

Copy link
Copy Markdown

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's activate() 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 for event. When event was null the throw was swallowed by the wrapper's catch, which also swallowed the real activate() 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.

…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.
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.

1 participant