Skip to content

v1.0.4 — fix Windows minimize/resize (#153)

Choose a tag to compare

@AmrDab AmrDab released this 07 Jun 04:59
· 358 commits to main since this release

Fixes

#153 — window minimize (and window resize) silently did nothing on Windows.

Root cause: the PowerShell those commands run is built as a single concatenated line and executed via powershell.exe -Command <string>, but it opened the Add-Type -MemberDefinition block with a here-string (@"…"@). A here-string header must be the last token on its line — on a single line PowerShell raises "No characters are allowed after a here-string header before the end of the line" and the entire script fails to parse, so the call produced no output and returned false. Reported for UWP apps (Calculator/Settings) but it affected every window.

Fix:

  • Switched to a single-quoted -MemberDefinition '…' (C# double-quotes are literal inside it; Node handles wire-escaping). Applied to setWindowState (minimize/maximize/restore/close) and setWindowBounds (resize).
  • Minimize now also drives the transition through the UIA WindowPattern (SetWindowVisualState) with a title-first window lookup — the supported cross-process path for UWP / ApplicationFrameHost-hosted windows whose Win32 ShowWindow(SW_MINIMIZE) no-ops — falling back to ShowWindowAsync for plain Win32.
  • Added a static guard test so the single-line here-string can't return.

Verified live on Calculator: minimize / restore / maximize / restore all succeed. Full suite green (724 passed).

Security

npm i -g clawdcursor@1.0.4