From e628350d4e668530517d310d670f6ce230be129b Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 28 Mar 2020 23:36:48 +0900 Subject: [PATCH] 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 --- internal/uidriver/glfw/ui.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index ca332d17f..db3cacba6 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -679,11 +679,13 @@ func (u *UserInterface) run(context driver.UIContext) error { 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 = int(u.toDeviceDependentPixel(float64(ww))) wh = int(u.toDeviceDependentPixel(float64(wh))) 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). if u.isInitWindowMaximized() {