fix(tao): keep alwaysOnTop sticky on Windows - #633
Merged
Conversation
Three layers were losing WS_EX_TOPMOST on Windows: - DecoratedWindowComposable created every window with a hardcoded alwaysOnTop=false and only applied the real value from a later LaunchedEffect, which loses the race against creation-time style rewrites (acrylic, skip-taskbar). The real initial value is now passed at creation. - tao only issues the z-order SetWindowPos when its WindowFlags cache diffs — and then with SWP_ASYNCWINDOWPOS — so once an external rewrite drops the topmost band while the cache still says ALWAYS_ON_TOP, no path ever repairs it. TaoWindow.setAlwaysOnTop now also applies the z-order directly and synchronously via the new deco-bridge nativeApplyTopmost (SetWindowPos without SWP_ASYNCWINDOWPOS), keeping tao's cache in sync for its own future rewrites. - New TaoWindow.reassertAlwaysOnTop() repairs the band after the known clobber sites: every RESIZED event, and the WindowsBackdrop apply/teardown/survivor-restore paths. Adds a nativeIsTopmost probe (real GWL_EXSTYLE bit, mirroring nativeIsBackdropActive) and a headful regression case driving the issue's scenario: enable topmost, apply acrylic, resize, toggle the flag both ways, tear the backdrop down — asserting WS_EX_TOPMOST at each step.
kdroidFilter
added a commit
that referenced
this pull request
Sep 1, 2026
Brings the 2.6 line up to date with the released one (#629 MSI installer options, #630 NSIS menu category, #632 clean-frame present skip, #633 alwaysOnTop stickiness). Conflict: `nucleus_tao_windows_deco.c` — 2.6's ClearType pixel-geometry probe and main's #631 topmost helpers were appended at the same spot. Both kept. Verified on Windows: rebuilt natives, `check` on decorated-window-tao and nucleus-application, headful suite 27 run / 0 failed.
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.
Fixes #631.
Summary
DecoratedWindowComposableno longer hardcodesalwaysOnTop = falseatopenDecoratedWindowtime — the real initial value is applied before the first show, instead of racing the creation-time style rewrites (acrylic, skip-taskbar) from a laterLaunchedEffect.SetWindowPoson aWindowFlagscache diff — and then withSWP_ASYNCWINDOWPOS— so once an external rewrite dropsWS_EX_TOPMOSTwhile the cache still saysALWAYS_ON_TOP, no path ever repairs it.TaoWindow.setAlwaysOnTopnow additionally applies the z-order directly and synchronously through the new deco-bridgenativeApplyTopmost(plainSetWindowPos, no async flag), while still forwarding to tao so its cache stays coherent for its own future rewrites.TaoWindow.reassertAlwaysOnTop()re-applies the requested band after the known clobber sites — everyRESIZEDevent and theWindowsBackdropapply / teardown / survivor-restore paths. Idempotent no-op when the z-order already matches or the flag is off; no-op off Windows.nativeIsTopmostreads the realGWL_EXSTYLEbit (mirroringnativeIsBackdropActive), and a new headful case drives the issue's exact scenario — enable topmost, apply Acrylic, resize, toggle the flag both ways, tear the backdrop down — assertingWS_EX_TOPMOSTat each step.Test plan
taoHeadfulTest— 27 run, 0 failed, including the new "Windows: alwaysOnTop is not sticky on hiddenFromDock + Acrylic windows #631 alwaysOnTop sticks through acrylic and size rewrites":decorated-window-tao:check(detekt, ktlint, apiCheck, unit tests)