Keep the clock above the taskbar after the shell raises itself - #159
Open
danielchalmers wants to merge 1 commit into
Open
Keep the clock above the taskbar after the shell raises itself#159danielchalmers wants to merge 1 commit into
danielchalmers wants to merge 1 commit into
Conversation
Topmost windows share a single z-order band, so clicking the taskbar or opening Start moves those shell windows above the clock and Windows never puts it back. Reassert the clock's place in the band on the existing clock tick, which also covers the raises that change no foreground window, like an auto-hide taskbar sliding up. Closes #154
danielchalmers
force-pushed
the
fix-topmost-above-taskbar
branch
from
July 31, 2026 01:15
96cc33f to
656689b
Compare
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.
Closes #154, and the same scenario reported in #72 (item 2) and #20.
Topmost windows all share one z-order band, so clicking the taskbar or opening Start moves the shell to the front of it, and WPF never puts the clock back because it only reapplies the z-order when
Topmostchanges. This reasserts the clock's place in the band on the tick that already runs every second, guarded on Stay on top being enabled and the window being visible.A
SetWinEventHookforeground listener was tried first and removed: measured on its own it failed every check, because its reassert is undone as the foreground switch completes, so the timer was doing all the work anyway.