Skip to content

Keep the clock above the taskbar after the shell raises itself - #159

Open
danielchalmers wants to merge 1 commit into
masterfrom
fix-topmost-above-taskbar
Open

Keep the clock above the taskbar after the shell raises itself#159
danielchalmers wants to merge 1 commit into
masterfrom
fix-topmost-above-taskbar

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Jul 31, 2026

Copy link
Copy Markdown
Owner

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 Topmost changes. 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 SetWinEventHook foreground 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.

@github-actions github-actions Bot added the bug Something isn't working label Jul 31, 2026
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
danielchalmers force-pushed the fix-topmost-above-taskbar branch from 96cc33f to 656689b Compare July 31, 2026 01:15
@danielchalmers danielchalmers added enhancement New feature or request and removed bug Something isn't working labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fixing the issue where the taskbar overlapped the clock when you click on taskbar

1 participant