Place default-sized windows whose height is 0 #201

Manually merged
github merged 2 commits from github-bot/gh-201 into gh-pr/201/base 2026-11-27 10:40:27 +00:00 AGit
Owner

@⁠Geckomacabre on GitHub · 2026-11-27 09:06 UTC · original
Geckomacabre:pr/default-size-window → main · +42 −1 · 1 files · 2 commits · merged 2026-11-27 09:17 UTC

Follow-up to #148 (from #125), for the Codex P2 finding on lifecycle.rs:167: a window created with a CW_USEDEFAULT width and a height of 0 was treated as a zero-sized helper.

Win32 ignores the height when the width is CW_USEDEFAULT, so height = 0 there is a normal default-sized window. The guard in place() returned before resolving that default, which skipped the VICTORY_MONITOR placement and VICTORY_FULLSCREEN, and left the window without a WindowState, so F11 and Alt+Enter did nothing for it.

  • zero_sized(width, height): a width of CW_USEDEFAULT is never zero-sized; any other width or height of 0 still is, so hidden helpers keep the geometry they asked for.
  • Test: a_default_width_with_zero_height_is_not_a_zero_sized_helper (the helper predicate both ways, and place() keeping the window's full-screen state for a default-width, zero-height request).

Checks (Windows 11, RTX 4090, toolchain 1.98.1): cargo test -p victory-hle --lib -- --test-threads=1 lifecycle: 18 passed, 0 failed. cargo clippy -p victory-hle --tests -- -D warnings: clean.

From the Geckomacabre/vx-layer work.

🤖 Generated with Claude Code

**@⁠Geckomacabre** on GitHub · 2026-11-27 09:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/201) `Geckomacabre:pr/default-size-window` → `main` · +42 −1 · 1 files · 2 commits · merged 2026-11-27 09:17 UTC Follow-up to #148 (from #125), for the Codex P2 finding on `lifecycle.rs:167`: a window created with a `CW_USEDEFAULT` width and a height of 0 was treated as a zero-sized helper. Win32 ignores the height when the width is `CW_USEDEFAULT`, so `height = 0` there is a normal default-sized window. The guard in `place()` returned before resolving that default, which skipped the `VICTORY_MONITOR` placement and `VICTORY_FULLSCREEN`, and left the window without a `WindowState`, so F11 and Alt+Enter did nothing for it. - `zero_sized(width, height)`: a width of `CW_USEDEFAULT` is never zero-sized; any other width or height of 0 still is, so hidden helpers keep the geometry they asked for. - Test: `a_default_width_with_zero_height_is_not_a_zero_sized_helper` (the helper predicate both ways, and `place()` keeping the window's full-screen state for a default-width, zero-height request). Checks (Windows 11, RTX 4090, toolchain 1.98.1): `cargo test -p victory-hle --lib -- --test-threads=1 lifecycle`: 18 passed, 0 failed. `cargo clippy -p victory-hle --tests -- -D warnings`: clean. From the Geckomacabre/vx-layer work. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A width of CW_USEDEFAULT leaves the size to Windows, which then ignores the height, so a
height of 0 there is a normal default-sized window rather than a zero-sized helper. The
guard in place() returned before resolving that default, which skipped VICTORY_MONITOR
placement, VICTORY_FULLSCREEN and the F11/Alt+Enter state for such a window. zero_sized()
now exempts a default width; genuinely zero-sized helpers keep what they asked for.

Test: a_default_width_with_zero_height_is_not_a_zero_sized_helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 09:09:30 +00:00
Apply the default-size exception only to overlapped windows. Preserve native zero size for pop-ups and child windows that request CW_USEDEFAULT, and cover the top-level pop-up placement path.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 09:12 UTC · original

@⁠Geckomacabre The default-width case is right for overlapped windows. Win32 gives a pop-up zero size for the same value, and placeable() accepts unowned pop-ups. I added a follow-up commit that keeps zero-sized helpers out of monitor placement and covers both window styles in the placement tests. CreateWindowExW parameters

**@⁠TaynanGT** on GitHub · 2026-11-27 09:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/201#issuecomment-7214412773) @⁠Geckomacabre The default-width case is right for overlapped windows. Win32 gives a pop-up zero size for the same value, and `placeable()` accepts unowned pop-ups. I added a follow-up commit that keeps zero-sized helpers out of monitor placement and covers both window styles in the placement tests. [CreateWindowExW parameters](https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createwindowexw#parameters)
github-bot changed target branch from main to gh-pr/201/base 2026-11-27 10:40:26 +00:00
github manually merged commit baca545368 into gh-pr/201/base 2026-11-27 10:40:27 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.