From 28c7a0321e5a299a939244e373cd237863c060e7 Mon Sep 17 00:00:00 2001 From: younggann Date: Sun, 17 Aug 2025 14:52:09 -0400 Subject: [PATCH 1/3] fix(macOS): Use visibleFrame for window centering to exclude menu bar The windowCenter() function was using [screen frame] which includes the menu bar and dock areas, causing windows to appear positioned too high on the screen when centered. This change uses [screen visibleFrame] instead, which excludes the menu bar and dock areas, resulting in proper visual centering. Fixes vertical centering issue on macOS in Wails v3 alpha. --- v3/pkg/application/webview_window_darwin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v3/pkg/application/webview_window_darwin.go b/v3/pkg/application/webview_window_darwin.go index 8d5a85a8e19..167856dda0f 100644 --- a/v3/pkg/application/webview_window_darwin.go +++ b/v3/pkg/application/webview_window_darwin.go @@ -529,7 +529,7 @@ void windowCenter(void* nsWindow) { screen = [NSScreen mainScreen]; } - NSRect screenFrame = [screen frame]; + NSRect screenFrame = [screen visibleFrame]; NSRect windowFrame = [window frame]; CGFloat x = screenFrame.origin.x + (screenFrame.size.width - windowFrame.size.width) / 2; From 525d3b411208e9d3fcb99aafb0b000fe8ca24698 Mon Sep 17 00:00:00 2001 From: younggann Date: Mon, 25 Aug 2025 13:37:54 -0400 Subject: [PATCH 2/3] Update v3/UNRELEASED_CHANGELOG.md --- v3/UNRELEASED_CHANGELOG.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 8e46480384f..110ad746368 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -1,6 +1,6 @@ # Unreleased Changes - ## Added - + +- Updated the configuration for detecting the screenFrame to use the + visibleFrame instead of the frame to handle cases where the screen is not + fully visible (mostly due to dock or menu bar). ## Changed - + +- Changed the NSRect screenFrame = [screen frame]; to +- Changed the NSRect screenFrame = [screen visibleFrame]; ## Fixed - + +N/A ## Deprecated - + +N/A ## Removed - + +N/A ## Security - + +N/A --- ### Example Entries: **Added:** + - Add support for custom window icons in application options - Add new `SetWindowIcon()` method to runtime API (#1234) **Changed:** + - Update minimum Go version requirement to 1.21 - Improve error messages for invalid configuration files **Fixed:** + - Fix memory leak in event system during window close operations (#5678) - Fix crash when using context menus on Linux with Wayland **Security:** + - Update dependencies to address CVE-2024-12345 in third-party library From 57346f7e9ef85cc53df486710c9e5f41a4dd64f1 Mon Sep 17 00:00:00 2001 From: younggann Date: Fri, 29 Aug 2025 17:41:14 -0400 Subject: [PATCH 3/3] Update changelog entry format --- v3/UNRELEASED_CHANGELOG.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 110ad746368..c9a8e5b0d9f 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -16,31 +16,23 @@ After processing, the content will be moved to the main changelog and this file --> ## Added - -- Updated the configuration for detecting the screenFrame to use the - visibleFrame instead of the frame to handle cases where the screen is not - fully visible (mostly due to dock or menu bar). + ## Changed - -- Changed the NSRect screenFrame = [screen frame]; to -- Changed the NSRect screenFrame = [screen visibleFrame]; + +- macOS: Use `visibleFrame` instead of `frame` for window centering to exclude menu bar and dock areas ## Fixed - -N/A + ## Deprecated - -N/A + ## Removed - -N/A + ## Security - -N/A + ---