diff --git a/docs/src/content/docs/features/windows/frameless.mdx b/docs/src/content/docs/features/windows/frameless.mdx index c13cb9d4d..361cced18 100644 --- a/docs/src/content/docs/features/windows/frameless.mdx +++ b/docs/src/content/docs/features/windows/frameless.mdx @@ -394,7 +394,7 @@ body { ``` **Invisible title bar:** - Allows dragging whilst hiding the title bar: + Allows dragging whilst hiding the title bar. This only takes effect when the window is frameless or uses `AppearsTransparent`: ```go Mac: application.MacOptions{ InvisibleTitleBarHeight: 40, diff --git a/docs/src/content/docs/features/windows/options.mdx b/docs/src/content/docs/features/windows/options.mdx index 730e62045..9b38d5e2b 100644 --- a/docs/src/content/docs/features/windows/options.mdx +++ b/docs/src/content/docs/features/windows/options.mdx @@ -792,7 +792,8 @@ Mac: application.MacWindow{ **InvisibleTitleBarHeight** (`int`) - Height of invisible title bar area (for dragging) -- Useful when title bar is hidden +- Only takes effect when the native title bar drag area is hidden — i.e. when the window is frameless (`Frameless: true`) or uses a transparent title bar (`AppearsTransparent: true`) +- Has no effect on standard windows with a visible title bar **WindowLevel** (`MacWindowLevel`) - `MacWindowLevelNormal` - Standard window level (default) diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 1710e1795..796685b40 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -25,6 +25,9 @@ After processing, the content will be moved to the main changelog and this file ## Fixed +- Fix `InvisibleTitleBarHeight` being applied to all macOS windows instead of only frameless or transparent title bar windows (#4960) +- Fix window shaking/jitter when resizing from top corners with `InvisibleTitleBarHeight` enabled, by skipping drag initiation near window edges (#4960) +- Fix generation of mapped types with enum keys in JS/TS bindings (#4437) by @fbbdev ## Deprecated diff --git a/v3/pkg/application/webview_window_darwin.go b/v3/pkg/application/webview_window_darwin.go index 4a53d7337..ff49ad49b 100644 --- a/v3/pkg/application/webview_window_darwin.go +++ b/v3/pkg/application/webview_window_darwin.go @@ -1334,7 +1334,10 @@ func (w *macosWebviewWindow) run() { C.windowSetAppearanceTypeByName(w.nsWindow, C.CString(string(macOptions.Appearance))) } - if macOptions.InvisibleTitleBarHeight != 0 { + // Only apply invisible title bar when the native drag area is hidden + // (frameless window or transparent/hidden title bar presets like HiddenInset) + if macOptions.InvisibleTitleBarHeight != 0 && + (w.parent.options.Frameless || titleBarOptions.AppearsTransparent) { C.windowSetInvisibleTitleBar(w.nsWindow, C.uint(macOptions.InvisibleTitleBarHeight)) } diff --git a/v3/pkg/application/webview_window_darwin.m b/v3/pkg/application/webview_window_darwin.m index 4e2f1cabc..48130a562 100644 --- a/v3/pkg/application/webview_window_darwin.m +++ b/v3/pkg/application/webview_window_darwin.m @@ -345,6 +345,15 @@ typedef NS_ENUM(NSInteger, MacLiquidGlassStyle) { NSPoint location = [event locationInWindow]; NSRect frame = [window frame]; if( location.y > frame.size.height - self.invisibleTitleBarHeight ) { + // Skip drag if the click is near a window edge (resize zone). + // This prevents conflict between dragging and native top-corner resizing, + // which causes window content to shake/jitter (#4960). + CGFloat resizeThreshold = 5.0; + BOOL nearLeftEdge = location.x < resizeThreshold; + BOOL nearRightEdge = location.x > frame.size.width - resizeThreshold; + if( nearLeftEdge || nearRightEdge ) { + return; + } [window performWindowDragWithEvent:event]; return; }