mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-14 21:12:03 +01:00
Compare commits
No commits in common. "4d268f5ce44be8bbe02ff37ece4cabeba38e3b35" and "cf5b851cd308c563fd7b604d4858641ba37a150c" have entirely different histories.
4d268f5ce4
...
cf5b851cd3
@ -1027,7 +1027,7 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Window is shown after the first buffer swap (#2725).
|
// Window is shown after the first buffer swap.
|
||||||
if err := glfw.WindowHint(glfw.Visible, glfw.False); err != nil {
|
if err := glfw.WindowHint(glfw.Visible, glfw.False); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -1294,40 +1294,6 @@ func (u *UserInterface) update() (float64, float64, error) {
|
|||||||
if err = u.window.Focus(); err != nil {
|
if err = u.window.Focus(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// On Linux or UNIX, there is a problematic desktop environment like i3wm
|
|
||||||
// where an invisible window size cannot be initialized correctly (#2951).
|
|
||||||
// Call SetSize explicitly after the window becomes visible.
|
|
||||||
|
|
||||||
fullscreen, e := u.isFullscreen()
|
|
||||||
if e != nil {
|
|
||||||
err = e
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if fullscreen {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
m, e := u.currentMonitor()
|
|
||||||
if e != nil {
|
|
||||||
err = e
|
|
||||||
return
|
|
||||||
}
|
|
||||||
s := m.DeviceScaleFactor()
|
|
||||||
newW := int(dipToGLFWPixel(float64(u.origWindowWidthInDIP), s))
|
|
||||||
newH := int(dipToGLFWPixel(float64(u.origWindowHeightInDIP), s))
|
|
||||||
|
|
||||||
// Even though a framebuffer callback is not called, waitForFramebufferSizeCallback returns by timeout,
|
|
||||||
// so it is safe to use this.
|
|
||||||
if err = u.waitForFramebufferSizeCallback(u.window, func() error {
|
|
||||||
return u.window.SetSize(newW, newH)
|
|
||||||
}); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
|
Loading…
Reference in New Issue
Block a user