Skip to content

Commit

Permalink
Restore old location for quit with no windows left
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz authored and andydotxyz committed Dec 18, 2023
1 parent fa3e65c commit 6a9b848
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/driver/glfw/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ func (d *gLDriver) runGL() {
d.windowLock.Lock()
d.windows = newWindows
d.windowLock.Unlock()

if len(newWindows) == 0 {
d.Quit()
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (w *window) destroy(d *gLDriver) {
w.DestroyEventQueue()
cache.CleanCanvas(w.canvas)

if w.master || len(w.driver.windowList()) == 1 {
if w.master {
d.Quit()
} else if runtime.GOOS == "darwin" {
go d.focusPreviousWindow()
Expand Down

0 comments on commit 6a9b848

Please sign in to comment.