Merge pull request #109 from liamg/darwin-blank-window-workaround

Add workaround for darwin SDL blank window bug
This commit is contained in:
Liam Galvin 2018-12-04 12:05:07 +00:00 committed by GitHub
commit 06c5ca65b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -215,6 +215,8 @@ func (gui *GUI) Render() error {
startTime := time.Now() startTime := time.Now()
showMessage := true showMessage := true
darwinRenderFixRequired := runtime.GOOS == "darwin"
for !gui.window.ShouldClose() { for !gui.window.ShouldClose() {
select { select {
@ -269,6 +271,12 @@ Buffer Size: %d lines
gui.window.SwapBuffers() gui.window.SwapBuffers()
// Workaround for https://github.com/glfw/glfw/issues/1334
if darwinRenderFixRequired {
darwinRenderFixRequired = false
x, y := gui.window.GetPos()
gui.window.SetPos(x+1, y)
}
} }
} }