mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/uidriver/glfw: Bug fix: Delay to enable SetSize callback
On Linux, the SetSize callback is invoked with an unexpected value at the initial phase. Just delay it until the initialization finishes.
This commit is contained in:
parent
34be0371be
commit
fbe6961528
@ -814,7 +814,6 @@ func (u *UserInterface) init() error {
|
||||
if err := u.createWindow(); err != nil {
|
||||
return err
|
||||
}
|
||||
u.setSizeCallbackEnabled = true
|
||||
|
||||
setSize := func() {
|
||||
ww, wh := u.getInitWindowSize()
|
||||
@ -849,6 +848,10 @@ func (u *UserInterface) init() error {
|
||||
g.SetWindow(u.nativeWindow())
|
||||
}
|
||||
|
||||
// Enable the SetSize callback after all the initialization finishes. Or, unexpected the callback
|
||||
// is fired unexpectedly at the initial phase with a very small size on Linux.
|
||||
u.setSizeCallbackEnabled = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user