mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Bug fix: a window was alwasy 'unfocused' on Windows
There is an issue in GLFW that a window was recognized as unfoces on Windows (glfw/glfw#1573). As a workaround, skip the logic for an unfocused window on Windows. On Windows, even if a window is in another workspace, vsync works. Then there seems no problem. Fixes #987
This commit is contained in:
parent
cfc66efcfb
commit
800b98a0c6
@ -823,7 +823,14 @@ func (u *UserInterface) loop(context driver.UIContext) error {
|
|||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
for {
|
for {
|
||||||
unfocused := u.window.GetAttrib(glfw.Focused) == glfw.False
|
var unfocused bool
|
||||||
|
|
||||||
|
// On Windows, the focusing state might be always false (#987).
|
||||||
|
// On Windows, even if a window is in another workspace, vsync seems to work.
|
||||||
|
// Then let's assume the window is alwasy 'focused' as a workaround.
|
||||||
|
if runtime.GOOS != "windows" {
|
||||||
|
unfocused = u.window.GetAttrib(glfw.Focused) == glfw.False
|
||||||
|
}
|
||||||
|
|
||||||
var t1, t2 time.Time
|
var t1, t2 time.Time
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user