mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
internal/ui: bug fix: call setOrigWindowPos on entering fullscreen
Closes #2757
This commit is contained in:
parent
f7a801d591
commit
568e98ef1c
@ -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 {
|
||||
|
@ -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())
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user