Skip to content

Conversation

@leaanthony
Copy link
Member

@leaanthony leaanthony commented Feb 6, 2026

Summary

  • Only apply InvisibleTitleBarHeight when the native drag area is actually hidden (frameless window or transparent title bar presets like MacTitleBarHiddenInset/MacTitleBarHiddenInsetUnified). Previously it was applied unconditionally, which could swallow clicks near the top of standard windows.
  • Skip drag initiation when the click is near the left/right window edges within the invisible title bar zone. This prevents conflict between dragging and native top-corner resizing, which caused window content to shake/jitter.

Test plan

  • Verify frameless window with InvisibleTitleBarHeight still drags correctly
  • Verify MacTitleBarHiddenInset + InvisibleTitleBarHeight still drags correctly
  • Verify top-left and top-right corner resizing no longer causes shaking
  • Verify bottom corner resizing still works (regression check)
  • Verify standard title bar window ignores InvisibleTitleBarHeight if accidentally set

Fixes #4960

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • InvisibleTitleBarHeight now applies only to frameless or transparent title-bar windows on macOS.
    • Prevent initiating a window drag when clicking within ~5 points of the top-left/right edges to avoid jitter when resizing from corners.
  • Documentation

    • Clarified Invisible title bar and InvisibleTitleBarHeight usage and constraints in macOS frameless/options docs.

…e shaking (#4960)

- Only apply InvisibleTitleBarHeight when the native drag area is actually
  hidden (frameless window or transparent title bar presets like HiddenInset).
  Previously it was applied unconditionally, which could swallow clicks near
  the top of standard windows.

- Skip drag initiation when the click is near the left/right window edges
  within the invisible title bar zone. This prevents conflict between
  dragging and native top-corner resizing, which caused window content to
  shake/jitter.

Fixes #4960

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 6, 2026 11:06
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

⚠️ Missing Changelog Update

Hi @leaanthony, please update v3/UNRELEASED_CHANGELOG.md with a description of your changes.

This helps us keep track of changes for the next release.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Walkthrough

Apply InvisibleTitleBarHeight only for windows that are frameless or use AppearsTransparent; skip initiating a window drag when a title-bar-area click is within 5 points of the left/right window edges to prevent top-corner resize jitter.

Changes

Cohort / File(s) Summary
macOS Window Logic
v3/pkg/application/webview_window_darwin.go
Only apply InvisibleTitleBarHeight when height != 0 AND (window is frameless OR title bar is transparent); tightens previous unconditional check.
macOS Mouse Handling
v3/pkg/application/webview_window_darwin.m
In handleLeftMouseDown, skip starting a window drag if the click in the title-bar area is within 5 points of the left/right window edges, preventing top-corner resize jitter.
Documentation
docs/src/content/docs/features/windows/frameless.mdx, docs/src/content/docs/features/windows/options.mdx
Clarify that InvisibleTitleBarHeight only takes effect when the native title-bar drag area is hidden (Frameless: true or AppearsTransparent: true) and has no effect on standard windows.
Changelog
v3/UNRELEASED_CHANGELOG.md
Add three Fixed entries: two macOS fixes (InvisibleTitleBarHeight misapplication and top-corner resize jitter) and one JS/TS bindings fix for mapped enum-keyed types.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Bug, MacOS, Documentation, v3-alpha, size:M, lgtm

Poem

🐰 I nudged the hidden bar with care,
Corners calm, no jittery scare.
Frameless or clear, the edges mind,
Smooth resizes now you’ll find. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely summarizes both fixes: guarding InvisibleTitleBarHeight and fixing top-corner resize shaking, directly matching the changeset.
Description check ✅ Passed Description covers the main issue, provides clear explanation of changes, lists a comprehensive test plan, and correctly links to issue #4960.
Linked Issues check ✅ Passed All code changes directly address the requirements in #4960: guarding InvisibleTitleBarHeight application and preventing drag conflicts near window edges during top-corner resizing.
Out of Scope Changes check ✅ Passed All changes are in scope: native code fixes to webview_window_darwin.go/m, changelog updates, and corresponding documentation clarifications for InvisibleTitleBarHeight behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v3-bugfix/invisible-titlebar-guard

No actionable comments were generated in the recent review. 🎉


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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a window shaking issue on macOS when resizing from top corners with transparent/hidden title bar presets. It also prevents InvisibleTitleBarHeight from interfering with standard title bar windows.

Changes:

  • Added guard condition to only apply InvisibleTitleBarHeight when the native drag area is hidden (frameless or transparent title bar)
  • Added edge detection logic to skip drag initiation near left/right window edges to prevent conflict with native corner resizing

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
v3/pkg/application/webview_window_darwin.go Added conditional check to only apply invisible title bar height for frameless or transparent title bar windows
v3/pkg/application/webview_window_darwin.m Added resize threshold check to prevent drag initiation near window edges, fixing top-corner resize shaking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2026

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: 00753e3
Status: ✅  Deploy successful!
Preview URL: https://45451abb.wails.pages.dev
Branch Preview URL: https://v3-bugfix-invisible-titlebar.wails.pages.dev

View logs

@leaanthony leaanthony merged commit e999741 into v3-alpha Feb 8, 2026
54 checks passed
@leaanthony leaanthony deleted the v3-bugfix/invisible-titlebar-guard branch February 8, 2026 20:35
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.

1 participant