diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index e62ab93d4..e45f3de67 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -107,14 +107,9 @@ func initialize() error { currentUI.window.MakeContextCurrent() - mode := glfw.CursorNormal - if !currentUI.isInitCursorVisible() { - mode = glfw.CursorHidden - } if i := currentUI.getInitIconImages(); i != nil { currentUI.window.SetIcon(i) } - currentUI.window.SetInputMode(glfw.CursorMode, mode) currentUI.window.SetInputMode(glfw.StickyMouseButtonsMode, glfw.True) currentUI.window.SetInputMode(glfw.StickyKeysMode, glfw.True) @@ -535,6 +530,13 @@ func DeviceScaleFactor() float64 { func Run(width, height int, scale float64, title string, g GraphicsContext, mainloop bool) error { u := currentUI _ = mainthread.Run(func() error { + // Solve the initial properties of the window. + mode := glfw.CursorNormal + if !currentUI.isInitCursorVisible() { + mode = glfw.CursorHidden + } + u.window.SetInputMode(glfw.CursorMode, mode) + // Get the monitor before showing the window. // // On Windows, there are two types of windows: