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 committed Sep 14, 2023
1 parent 5f320fa commit 9052681
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 @@ -187,6 +187,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 @@ -279,7 +279,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 9052681

Please sign in to comment.