From 128215eeddb5101452a475c43c53f4a203037f45 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 16 Sep 2023 03:22:52 +0900 Subject: [PATCH] Revert "internal/ui: bug fix: disable window size limitation on fullscreen" This reverts commit 9a5ef1b55312dfd0433d957a8b6dd4e07b909849. Reason: we should disable the green button instead Updates #2260 --- internal/ui/ui_glfw.go | 11 ----------- internal/ui/ui_glfw_darwin.go | 2 -- 2 files changed, 13 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 007df760a..35634c026 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -1321,14 +1321,6 @@ func (u *userInterfaceImpl) updateWindowSizeLimits() { u.window.SetSizeLimits(minw, minh, maxw, maxh) } -// disableWindowSizeLimits disables a window size limitation temporarily, especially for fullscreen -// In order to enable the size limitation, call updateWindowSizeLimits. -// -// disableWindowSizeLimits must be called from the main thread. -func (u *userInterfaceImpl) disableWindowSizeLimits() { - u.window.SetSizeLimits(glfw.DontCare, glfw.DontCare, glfw.DontCare, glfw.DontCare) -} - // adjustWindowSizeBasedOnSizeLimitsInDIP adjust the size based on the window size limits. // width and height are in device-independent pixels. func (u *userInterfaceImpl) adjustWindowSizeBasedOnSizeLimitsInDIP(width, height int) (int, int) { @@ -1405,8 +1397,6 @@ func (u *userInterfaceImpl) setFullscreen(fullscreen bool) { // Enter the fullscreen. if fullscreen { - u.disableWindowSizeLimits() - if x, y := u.origWindowPos(); x == invalidPos || y == invalidPos { u.setOrigWindowPos(u.window.GetPos()) } @@ -1427,7 +1417,6 @@ func (u *userInterfaceImpl) setFullscreen(fullscreen bool) { } // Exit the fullscreen. - u.updateWindowSizeLimits() // Get the original window position and size before changing the state of fullscreen. // TODO: Why? diff --git a/internal/ui/ui_glfw_darwin.go b/internal/ui/ui_glfw_darwin.go index 519600088..57ded86b0 100644 --- a/internal/ui/ui_glfw_darwin.go +++ b/internal/ui/ui_glfw_darwin.go @@ -122,7 +122,6 @@ 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()) }, @@ -137,7 +136,6 @@ func init() { Cmd: sel_windowWillExitFullScreen, Fn: func(id objc.ID, cmd objc.SEL, notification objc.ID) { pushResizableState(id, cocoa.NSNotification{ID: notification}.Object()) - theUI.updateWindowSizeLimits() }, }, {