From d4dabc12895c20ac89ad47afd126beaef3b59e66 Mon Sep 17 00:00:00 2001 From: cenan ozen Date: Wed, 15 May 2024 00:22:09 +0300 Subject: [PATCH] Fix window position inconsistency in MacOS (#3479) * Fix window position inconsistency in MacOS * Updated changelog --- v2/internal/frontend/desktop/darwin/WailsContext.m | 2 +- website/src/pages/changelog.mdx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/internal/frontend/desktop/darwin/WailsContext.m b/v2/internal/frontend/desktop/darwin/WailsContext.m index 13af17f60..91c1b65fe 100644 --- a/v2/internal/frontend/desktop/darwin/WailsContext.m +++ b/v2/internal/frontend/desktop/darwin/WailsContext.m @@ -55,7 +55,7 @@ typedef void (^schemeTaskCaller)(id); NSScreen* screen = [self getCurrentScreen]; NSRect windowFrame = [self.mainWindow frame]; - NSRect screenFrame = [screen frame]; + NSRect screenFrame = [screen visibleFrame]; windowFrame.origin.x = screenFrame.origin.x + (float)x; windowFrame.origin.y = (screenFrame.origin.y + screenFrame.size.height) - windowFrame.size.height - (float)y; diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index e1ca9279f..facd68f39 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed optional type generation where an extra `?` would be placed inside the field name instead of outside the name `"field?"?` vs `"field"?`. Fixed by [@atterpac](https://github.com/atterpac) in [#3476](https://github.com/wailsapp/wails/pull/3476) +- Fixed an issue where `WindowGetPosition` and `WindowSetPosition` values were inconsistent on MacOS. Fixed by [@cenan](https://github.com/wailsapp/wails/pull/3479) ## v2.8.2 - 2024-05-08