From e5a8eb5b1daac9401ee30b1fb12e804d1f8ab71a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 19 Dec 2022 12:55:28 +0100 Subject: [PATCH] cocoadisplay: Fix Command+Q in green-button-style fullscreen mode It seems macOS has an extra NSWindow without a delegate in this mode --- panda/src/cocoadisplay/cocoaPandaAppDelegate.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/cocoadisplay/cocoaPandaAppDelegate.mm b/panda/src/cocoadisplay/cocoaPandaAppDelegate.mm index cbb84bc205..f64b2be56a 100644 --- a/panda/src/cocoadisplay/cocoaPandaAppDelegate.mm +++ b/panda/src/cocoadisplay/cocoaPandaAppDelegate.mm @@ -39,7 +39,8 @@ // Ask all the windows whether they are OK to be closed. bool should_close = true; for (NSWindow *window in [app windows]) { - if (![[window delegate] windowShouldClose:window]) { + id delegate = [window delegate]; + if (delegate != nil && ![delegate windowShouldClose:window]) { should_close = false; } }