Window manager: call Close() instead of Hide() so that WindowClose event handlers fire always

This commit is contained in:
Noah 2022-04-09 14:19:20 -07:00
parent c9c7b33647
commit 3b653e503c
2 changed files with 3 additions and 4 deletions

View File

@ -412,5 +412,5 @@ func (w *Window) Present(e render.Engine, P render.Point) {
// Destroy hides the window. // Destroy hides the window.
func (w *Window) Destroy() { func (w *Window) Destroy() {
w.Hide() w.Close()
} }

View File

@ -171,8 +171,7 @@ func (s *Supervisor) CloseAllWindows() int {
) )
for node != nil { for node != nil {
i++ i++
node.window.Destroy() node.window.Close()
node.window.Hide()
node = node.next node = node.next
} }
return i return i
@ -182,7 +181,7 @@ func (s *Supervisor) CloseAllWindows() int {
func (s *Supervisor) CloseActiveWindow() bool { func (s *Supervisor) CloseActiveWindow() bool {
var node = s.winFocus var node = s.winFocus
if node != nil { if node != nil {
node.window.Hide() node.window.Close()
} }
// Find the next visible window to focus. // Find the next visible window to focus.