Switch full screen with F11 or Alt+Enter while the title runs #1

Manually merged
github merged 1 commit from gh-pr/1/head into gh-pr/1/base 2026-11-26 09:02:01 +00:00
Owner

@⁠TaynanGT on GitHub · 2026-11-26 08:34 UTC · original
TaynanGT:batch/full-screen-switch → main · +98 −8 · 3 files · 1 commits · merged 2026-11-26 08:35 UTC

Full screen was fixed when the window was made. Now F11, or Alt+Enter, on the title's window switches between full screen (a frameless popup over the monitor the window is on) and the window it was made as, fitted to the screen. The swap chain stretches to either. DXGI's own Alt+Enter, which would switch the swap chain to exclusive full screen with buffers nothing resizes, is turned off with MakeWindowAssociation.

The README already describes the keys (How to run it).

Tested:

  • Local CI (clippy both ways, workspace tests, xtask): 936 passed, 0 failed.
  • New tests: a_full_screen_window_is_a_frameless_popup_over_the_screen, full_screen_switches_both_ways_on_the_window_s_monitor.

Not played live with this exact tree yet: the next measured session will check both keys.

**@⁠TaynanGT** on GitHub · 2026-11-26 08:34 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1) `TaynanGT:batch/full-screen-switch` → `main` · +98 −8 · 3 files · 1 commits · merged 2026-11-26 08:35 UTC Full screen was fixed when the window was made. Now **F11**, or **Alt+Enter**, on the title's window switches between full screen (a frameless popup over the monitor the window is on) and the window it was made as, fitted to the screen. The swap chain stretches to either. DXGI's own Alt+Enter, which would switch the swap chain to exclusive full screen with buffers nothing resizes, is turned off with `MakeWindowAssociation`. The README already describes the keys (How to run it). Tested: - Local CI (clippy both ways, workspace tests, xtask): 936 passed, 0 failed. - New tests: `a_full_screen_window_is_a_frameless_popup_over_the_screen`, `full_screen_switches_both_ways_on_the_window_s_monitor`. Not played live with this exact tree yet: the next measured session will check both keys.
Full screen was fixed at the window's creation. Now F11, or Enter with
Alt, on the title's window switches between full screen (a frameless
popup over the monitor the window is on) and the window it was made as
(fitted to the screen); the swap chain stretches to either. DXGI's own
Alt+Enter, which would make the swap chain exclusive full screen with
buffers nothing resizes, is turned off with MakeWindowAssociation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:02:00 +00:00
github manually merged commit 3981f716f3 into gh-pr/1/base 2026-11-26 09:02:01 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 08:35 UTC · original · edited 2026-11-26 08:38 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T08:37:01.074997Z 3981f71 PR opened
🔒 Security Review ✅ Completed 2026-11-26T08:38:30.452295Z 3981f71 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 08:35 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#issuecomment-7186773592) · edited 2026-11-26 08:38 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"3981f716f3f9f2f49b5b0dc84ef23fbcacacae0c","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":"3981f716f3f9f2f49b5b0dc84ef23fbcacacae0c","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"3981f716f3f9f2f49b5b0dc84ef23fbcacacae0c","mergeGateEnabled":false,"pullRequestNumber":1,"repository":"TaynanGT/Vice-Tay","status":"completed"} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T08:37:01.074997Z">2026-11-26T08:37:01.074997Z</relative-time> | `3981f71` | PR opened | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-26T08:38:30.452295Z">2026-11-26T08:38:30.452295Z</relative-time> | `3981f71` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 08:36 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3981f716f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 08:36 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#pullrequestreview-6070810102) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `3981f716f3` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
@ -170,0 +167,4 @@
if full.is_some() {
// A window that could go full screen: how it goes back to a window
// ([`toggle_full_screen`]).
*WINDOWED.lock().unwrap_or_else(|e| e.into_inner()) = Some((ex_style, style, fitted));
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 08:36 UTC · original

P2 Badge Associate saved window state with the title's HWND

If the title creates another unowned, non-tool top-level window after its main window, this assignment overwrites WINDOWED with that other window's styles and geometry, even if it is hidden or creation subsequently fails. window_proc still restricts toggling to TITLE_WINDOW, so switching the main window back to windowed mode applies the helper's dimensions and styles to it. Save the state per HWND after successful creation, or retain only the state belonging to the selected title window.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 08:36 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#discussion_r4705693135) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Associate saved window state with the title's HWND** If the title creates another unowned, non-tool top-level window after its main window, this assignment overwrites `WINDOWED` with that other window's styles and geometry, even if it is hidden or creation subsequently fails. `window_proc` still restricts toggling to `TITLE_WINDOW`, so switching the main window back to windowed mode applies the helper's dimensions and styles to it. Save the state per HWND after successful creation, or retain only the state belonging to the selected title window. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -172,0 +205,4 @@
unsafe {
wm::SetWindowLongPtrW(hwnd, wm::GWL_STYLE, style as isize);
wm::SetWindowLongPtrW(hwnd, wm::GWL_EXSTYLE, ex_style as isize);
wm::SetWindowPos(hwnd, std::ptr::null_mut(), x, y, w, h, wm::SWP_FRAMECHANGED | wm::SWP_NOZORDER | wm::SWP_SHOWWINDOW);
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 08:36 UTC · original

P2 Badge Resolve default window geometry before saving it for restoration

For a title that passes CW_USEDEFAULT to CreateWindowEx, fit deliberately preserves that sentinel, so the saved rectangle is not necessarily usable geometry. Returning from full screen later passes it directly to SetWindowPos, which does not interpret CW_USEDEFAULT as a default-placement request. Default coordinates can therefore move the window off-screen, and default dimensions can leave it incorrectly sized. Resolve the windowed rectangle to actual coordinates and positive dimensions before using it for restoration.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 08:36 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#discussion_r4705693144) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Resolve default window geometry before saving it for restoration** For a title that passes `CW_USEDEFAULT` to `CreateWindowEx`, `fit` deliberately preserves that sentinel, so the saved rectangle is not necessarily usable geometry. Returning from full screen later passes it directly to `SetWindowPos`, which does not interpret `CW_USEDEFAULT` as a default-placement request. Default coordinates can therefore move the window off-screen, and default dimensions can leave it incorrectly sized. Resolve the windowed rectangle to actual coordinates and positive dimensions before using it for restoration. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -172,0 +230,4 @@
const VK_RETURN: usize = 0x0D;
const VK_F11: usize = 0x7A;
let alt = (lparam >> 29) & 1 != 0;
(message == wm::WM_KEYDOWN && wparam == VK_F11) || (message == wm::WM_SYSKEYDOWN && wparam == VK_RETURN && alt)
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 08:36 UTC · original

P2 Badge Ignore auto-repeat messages for full-screen shortcuts

Holding F11 or Alt+Enter beyond the keyboard repeat delay generates repeated key-down messages, and every one currently triggers another full-screen transition. The window consequently alternates modes until release, with the final mode depending on the repeat count. Check the previous-key-state bit in lparam and toggle only on the initial key-down.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 08:36 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#discussion_r4705693147) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Ignore auto-repeat messages for full-screen shortcuts** Holding F11 or Alt+Enter beyond the keyboard repeat delay generates repeated key-down messages, and every one currently triggers another full-screen transition. The window consequently alternates modes until release, with the final mode depending on the repeat count. Check the previous-key-state bit in `lparam` and toggle only on the initial key-down. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -9305,0 +9305,4 @@
// Alt+Enter is the title window's own switch to and from full
// screen (frameless, the swap chain stretched); DXGI's would make
// it exclusive full screen, whose buffers nothing resizes.
let _ = factory.MakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER);
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 08:36 UTC · original

P2 Badge Provide a replacement shortcut for the GPU fallback window

When presenter() finds no title-created window, it calls window(width, height) to create the GPU fallback window. That window is created directly through Win32 in make_window(), and its window_proc() only calls DefWindowProcW; it never receives the lifecycle module's new shortcut handler. Disabling DXGI's Alt+Enter unconditionally therefore removes the fallback window's existing full-screen shortcut without providing a replacement. Add the borderless toggle handler to this window too, or restrict this association change to windows with the replacement handler.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 08:36 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#discussion_r4705693170) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Provide a replacement shortcut for the GPU fallback window** When `presenter()` finds no title-created window, it calls `window(width, height)` to create the GPU fallback window. That window is created directly through Win32 in `make_window()`, and its `window_proc()` only calls `DefWindowProcW`; it never receives the lifecycle module's new shortcut handler. Disabling DXGI's Alt+Enter unconditionally therefore removes the fallback window's existing full-screen shortcut without providing a replacement. Add the borderless toggle handler to this window too, or restrict this association change to windows with the replacement handler. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 01:33 UTC · original

I opened #104 to address the four findings above. Window placement now belongs to the window that created it, the restore path resolves default coordinates before calling SetWindowPos, and held F11 or Alt+Enter only toggles once. The fallback window keeps DXGI's Alt+Enter. The draft includes regression tests and is waiting for CI and an in-game toggle check.

**@⁠TaynanGT** on GitHub · 2026-11-27 01:33 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/1#issuecomment-7207390781) I opened #104 to address the four findings above. Window placement now belongs to the window that created it, the restore path resolves default coordinates before calling `SetWindowPos`, and held F11 or Alt+Enter only toggles once. The fallback window keeps DXGI's Alt+Enter. The draft includes regression tests and is waiting for CI and an in-game toggle check.
This discussion has been locked. Commenting is limited to contributors.
No description provided.