Add F11 fullscreen toggle #1067
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1067"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by erax4193 on 2026-11-28T12:38:16Z.
Summary
VICTORY_FULLSCREEN=1, pressing F11 restores to the original windowed position(F11)as a shortcut hintHow it works
The title's window procedure (
window_procinlifecycle.rs) interceptsWM_KEYDOWN/WM_SYSKEYDOWNforVK_F11on the top-level window and callstoggle_on_f11().A static
BEFORE_F11: Mutex<Option<[i32; 6]>>stores[left, top, right, bottom, GWL_STYLE, GWL_EXSTYLE]before going fullscreen.fullscreen()(the startup path viaVICTORY_FULLSCREEN=1) also writes this state so the toggle always has something to restore to.Closes #1063
Test plan
VICTORY_FULLSCREEN=1→ press F11 → window goes windowed → press F11 → back to fullscreenevery_line_fits_and_every_character_has_a_picturetest still passes (label is 27 chars, all characters have bitmaps)CreateWindowExWfullscreen test still passes🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-28T20:12:17Z.
On
fe2ac5b, holding F11 can call the fullscreen toggle more than once per physical press. I exercised the PR’s dispatch block with syntheticWM_KEYDOWNandWM_SYSKEYDOWN: press, autorepeat (lParam bit 30 set), release, press again produced three toggle callbacks for each message type. Guarding onlytoggle_on_f11(hwnd)withif lparam & (1 << 30) == 0reduced that to two. The repeat was still consumed, while key-up and an unrelated key were forwarded. This was a Linux CPU test of the handler with a callback stand-in. Native window transitions still need a Windows check.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by erax4193 on 2026-11-29T09:49:04Z.
Thanks for catching that — added
lparam & (1 << 30) == 0guard in38751f5so auto-repeat keydowns are skipped. BothWM_KEYDOWNandWM_SYSKEYDOWNnow fire the toggle only on the initial press.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.