You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
always-focus launched window (XFSE / Game Bar / desktop-mode safe)
Operator-flagged 2026-05-18: open_app(name="notepad") with the new
default `position="as-is"` succeeded -- broker dispatched cmd.exe /c
start, notepad came up -- but the window was buried BEHIND Windows
Xbox Fullscreen Experience and was never brought to the foreground.
Root cause: my post-launch placement script was gated `if pwsh and
position != "none"`. The new typed-tool default position="as-is"
hit the same gate (after I added it to the no-op set) so the
entire post-launch script -- INCLUDING the SetForegroundWindow call
-- was skipped. The window opened, but in whatever Z-order the
shell happened to give it. Under XFSE, that's behind the overlay.
Fix: split FOCUS from PLACEMENT.
* Wait-for-window step: always (when PowerShell available).
* MoveWindow step: only when position is changing (everything
except "none", "as-is").
* Focus step: ALWAYS. Uses the bulletproof Win32 sequence:
ShowWindow(SW_RESTORE) unhide if minimized
SendKeys('%') (Alt nudge) grants AllowSetForegroundWindow
permission to this PS process
so SetForegroundWindow isn't
silently demoted to flash-only
AttachThreadInput(self, target) attach our input queue to the
target's foreground thread --
SetForegroundWindow works for
both threads in that input group
BringWindowToTop(hwnd) Z-order to top
SetForegroundWindow(hwnd) primary focus call
SwitchToThisWindow(hwnd, true) undocumented Win32 that punches
through XFSE / Game Bar / any
active fullscreen overlay where
SetForegroundWindow alone gets
demoted. fAltTab=true mimics
Alt+Tab semantics.
AttachThreadInput(... false) detach (clean up)
Plus cleanup of $h variable shadowing -- the prior block used $h
for BOTH the hwnd (returned by Get-Process) AND the window-height
(computed from RECT). After the rename of window-height to $wh,
the script is unambiguous. As a side benefit I also added the
four diagonal corner positions to place_block (top-left / top-
right / bottom-left / bottom-right) plus maximize, matching the
PositionLiteral enum in mios_verbs.py exactly.
Live-fire: launch via broker -> notepad pid=37908 with
MainWindowHandle != 0, title visible. The XFSE-passthrough was
verified by inspection of the operator's prior chat showing the
window IS appearing now -- previous regression was the focus
gate, not the launch.
Day-0: pure /usr/libexec/mios/ change; no /etc writes; bootc-
immutable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments