mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 13:07:26 +01:00
uidriver/glfw: Bug fix: Initializing order mattered
Especially on Linux, the window size and the window position must be initialized in this order. Fixes #1118
This commit is contained in:
parent
34acf788d2
commit
e628350d4e
@ -679,11 +679,13 @@ func (u *UserInterface) run(context driver.UIContext) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
u.iwindow.SetPosition(u.getInitWindowPosition())
|
// Set the window size and the window position in this order.
|
||||||
|
// This is necessary especially on Linux (#1118).
|
||||||
ww, wh := u.getInitWindowSize()
|
ww, wh := u.getInitWindowSize()
|
||||||
ww = int(u.toDeviceDependentPixel(float64(ww)))
|
ww = int(u.toDeviceDependentPixel(float64(ww)))
|
||||||
wh = int(u.toDeviceDependentPixel(float64(wh)))
|
wh = int(u.toDeviceDependentPixel(float64(wh)))
|
||||||
u.setWindowSize(ww, wh, u.isFullscreen(), u.vsync)
|
u.setWindowSize(ww, wh, u.isFullscreen(), u.vsync)
|
||||||
|
u.iwindow.SetPosition(u.getInitWindowPosition())
|
||||||
|
|
||||||
// Maximizing a window requires a proper size and position. Call Maximize here (#1117).
|
// Maximizing a window requires a proper size and position. Call Maximize here (#1117).
|
||||||
if u.isInitWindowMaximized() {
|
if u.isInitWindowMaximized() {
|
||||||
|
Loading…
Reference in New Issue
Block a user