diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index f9227802c..cda3a2b75 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -1461,6 +1461,13 @@ func (u *userInterfaceImpl) setWindowSizeInDIP(width, height int, callSetSize bo u.updateWindowSizeLimits() } +// setOrigWindowPosWithCurrentPos must be called from the main thread. +func (u *userInterfaceImpl) setOrigWindowPosWithCurrentPos() { + if x, y := u.origWindowPos(); x == invalidPos || y == invalidPos { + u.setOrigWindowPos(u.window.GetPos()) + } +} + // setFullscreen must be called from the main thread. func (u *userInterfaceImpl) setFullscreen(fullscreen bool) { if u.isFullscreen() == fullscreen { diff --git a/internal/ui/ui_glfw_darwin.go b/internal/ui/ui_glfw_darwin.go index 4e1b169b7..689b58997 100644 --- a/internal/ui/ui_glfw_darwin.go +++ b/internal/ui/ui_glfw_darwin.go @@ -123,6 +123,7 @@ func init() { Cmd: sel_windowWillEnterFullScreen, Fn: func(id objc.ID, cmd objc.SEL, notification objc.ID) { theUI.disableWindowSizeLimits() + theUI.setOrigWindowPosWithCurrentPos() pushResizableState(id, cocoa.NSNotification{ID: notification}.Object()) }, },