mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
ui: Bug fix: the window is shown on the current monitor on Windows
Fixes #704
This commit is contained in:
parent
96a657025f
commit
8d2820efb0
@ -516,6 +516,10 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
|
||||
// swapping buffers.
|
||||
opengl.Init(currentUI.runOnMainThread)
|
||||
_ = u.runOnMainThread(func() error {
|
||||
// Get the monitor before calling setScreenSize. On Windows, setScreenSize can affect the
|
||||
// monitor where the hidden window is shown.
|
||||
m := u.currentMonitor()
|
||||
|
||||
// The game is in window mode (not fullscreen mode) at the first state.
|
||||
// Don't refer u.initFullscreen here to avoid some GLFW problems.
|
||||
u.setScreenSize(width, height, scale, false, u.vsync)
|
||||
@ -523,7 +527,6 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
|
||||
u.window.SetTitle(title)
|
||||
u.window.Show()
|
||||
|
||||
m := u.currentMonitor()
|
||||
mx, my := m.GetPos()
|
||||
v := m.GetVideoMode()
|
||||
w, h := u.glfwSize()
|
||||
|
Loading…
Reference in New Issue
Block a user