Skip to content

Conversation

@leaanthony
Copy link
Member

Summary

  • Fixes frameless transparent window hit-test regions not updating after DPI change on Windows
  • When moving a frameless transparent window between monitors with different DPI settings, the right and bottom edges would become unresponsive to clicks

Changes

  • Add SWP_FRAMECHANGED flag to SetWindowPos in WM_DPICHANGED handler for frameless windows to trigger WM_NCCALCSIZE and recalculate hit-test regions
  • Re-extend DWM frame into client area for frameless windows with decorations after DPI change

Root Cause

The WM_DPICHANGED handler was resizing the window but not triggering WM_NCCALCSIZE, which is needed to recalculate the non-client area and hit-test regions.

Test plan

  • Create a Wails app with Frameless: true and BackgroundType: application.BackgroundTypeTransparent
  • Set up multi-monitor environment with different DPI settings (e.g., 1.25x and 1.75x)
  • Move the window between monitors
  • Verify that all edges remain responsive to mouse clicks after DPI change

Fixes #4691

🤖 Generated with Claude Code

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 13, 2025

Warning

Rate limit exceeded

@leaanthony has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b1dd5a4 and 07211b4.

📒 Files selected for processing (2)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
  • v3/pkg/application/webview_window_windows.go (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-4691-dpi-hittest-regions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…s windows

When a frameless transparent window is moved between monitors with
different DPI settings, the hit-test regions weren't being recalculated,
causing the right and bottom edges to become unresponsive to clicks.

This fix adds the SWP_FRAMECHANGED flag to SetWindowPos in the
WM_DPICHANGED handler for frameless windows, which triggers
WM_NCCALCSIZE to recalculate the non-client area and hit-test regions.

For frameless windows with decorations, the DWM frame is also
re-extended into the client area to ensure proper window frame
styling after the DPI change.

Fixes #4691

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@leaanthony leaanthony force-pushed the fix-4691-dpi-hittest-regions branch from 65d1185 to 07211b4 Compare December 13, 2025 20:02
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 13, 2025

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: 07211b4
Status:🚫  Build failed.

View logs

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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