Skip to content

Fix #571 - on windows, mouse remains visible in screensaver#587

Merged
scottdraves merged 1 commit into
masterfrom
fix/571-mouse-visible-in-windows-screensaver
Apr 24, 2026
Merged

Fix #571 - on windows, mouse remains visible in screensaver#587
scottdraves merged 1 commit into
masterfrom
fix/571-mouse-visible-in-windows-screensaver

Conversation

@pavlopylypchuk321

Copy link
Copy Markdown
Collaborator

No description provided.

@scottdraves scottdraves merged commit 8a62d96 into master Apr 24, 2026
scottdraves added a commit that referenced this pull request Apr 27, 2026
Fixes a crash on Settings -> Close (preserve_AR=true) and the regression
where the resize cursor stopped appearing on the window borders.

Resize cursor: WM_SETCURSOR's non-fullscreen branch was breaking out of
the switch (added in #587 for fullscreen cursor hiding), which falls
through to "return 0" — telling Windows not to change the cursor. Defer
to DefWindowProc instead so it picks IDC_SIZEWE/etc. based on the
WM_NCHITTEST result. Drag-resize itself was working; just invisible.

Crash on close: SnapWindowTo16By9IfNeeded ran synchronously inside the
ImGui Close button handler. SetWindowPos -> WM_SIZE -> ResizeSwapChain
released RendererDX11's RTV while RenderIfNeeded still held the raw
pointer; the trailing OMSetRenderTargets dereferenced it. Now CloseDialog
posts a WM_APP message via PostMessageW and CDisplayDX11::WndProc runs
the snap from the message pump, after the render frame has returned.

CreateDisplayWindow: the work-area clamp now scales width and height
uniformly so the 16:9 design ratio is preserved when the requested size
doesn't fit. Independent per-axis shrinking previously produced ~1898x964
on a 1080p monitor at 150% DPI, which is what triggered the close-time
snap (and thus the crash).

Also enforce 16:9 on programmatic resizes (Aero snap, etc.) by posting
the deferred-snap message from WM_SIZE when preserve_AR is on. Added an
early-return to SnapWindowTo16By9IfNeeded so the handler is idempotent
and won't feedback-loop on its own SetWindowPos.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants