diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index fee7fece7..18c29f072 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -644,13 +644,6 @@ func (u *UserInterface) DeviceScaleFactor() float64 { // deviceScaleFactor must be called from the main thread. func (u *UserInterface) deviceScaleFactor() float64 { - // Before calling SetWindowPosition, the window's position is not reliable. - if u.iwindow.setPositionCalled { - // Avoid calling monitor.GetPos if we have the monitor position cached already. - if cm := getCachedMonitor(u.window.GetPos()); cm != nil { - return devicescale.GetAt(cm.x, cm.y) - } - } m := u.initMonitor if u.window != nil { m = currentMonitor(u.window) diff --git a/internal/uidriver/glfw/window.go b/internal/uidriver/glfw/window.go index 4d4fbf2f0..d7b646590 100644 --- a/internal/uidriver/glfw/window.go +++ b/internal/uidriver/glfw/window.go @@ -25,8 +25,7 @@ import ( ) type window struct { - ui *UserInterface - setPositionCalled bool + ui *UserInterface } func (w *window) IsDecorated() bool { @@ -212,10 +211,6 @@ func (w *window) SetPosition(x, y int) { // setPosition must be called from the main thread func (w *window) setPosition(x, y int) { - defer func() { - w.setPositionCalled = true - }() - mx, my := currentMonitor(w.ui.window).GetPos() xf := w.ui.toGLFWPixel(float64(x)) yf := w.ui.toGLFWPixel(float64(y))