Skip to content

fix(tao): keep alwaysOnTop sticky on Windows - #633

Merged
kdroidFilter merged 1 commit into
mainfrom
fix/631-windows-always-on-top-sticky
Aug 31, 2026
Merged

fix(tao): keep alwaysOnTop sticky on Windows#633
kdroidFilter merged 1 commit into
mainfrom
fix/631-windows-always-on-top-sticky

Conversation

@kdroidFilter

Copy link
Copy Markdown
Collaborator

Fixes #631.

Summary

  • Creation: DecoratedWindowComposable no longer hardcodes alwaysOnTop = false at openDecoratedWindow time — the real initial value is applied before the first show, instead of racing the creation-time style rewrites (acrylic, skip-taskbar) from a later LaunchedEffect.
  • Synchronous direct apply: tao only issues the z-order SetWindowPos on a WindowFlags cache diff — and then with SWP_ASYNCWINDOWPOS — so once an external rewrite drops WS_EX_TOPMOST while the cache still says ALWAYS_ON_TOP, no path ever repairs it. TaoWindow.setAlwaysOnTop now additionally applies the z-order directly and synchronously through the new deco-bridge nativeApplyTopmost (plain SetWindowPos, no async flag), while still forwarding to tao so its cache stays coherent for its own future rewrites.
  • Repair after clobbers: new internal TaoWindow.reassertAlwaysOnTop() re-applies the requested band after the known clobber sites — every RESIZED event and the WindowsBackdrop apply / teardown / survivor-restore paths. Idempotent no-op when the z-order already matches or the flag is off; no-op off Windows.
  • Probe + regression test: nativeIsTopmost reads the real GWL_EXSTYLE bit (mirroring nativeIsBackdropActive), 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 — asserting WS_EX_TOPMOST at each step.

Test plan

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
kdroidFilter merged commit c27224d into main Aug 31, 2026
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.
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.

Windows: alwaysOnTop is not sticky on hiddenFromDock + Acrylic windows

1 participant