Browse Source

fix: fire close event upon closing modal BrowserWindow in macOS (#19014) (#22125)

* fix: emit close event from modal on macOS

* fix: Move fn call to correct spot

* refactor: call notify fn directly
Erick Zhao 5 years ago
parent
commit
dde1ddade9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      atom/browser/native_window_mac.mm

+ 2 - 0
atom/browser/native_window_mac.mm

@@ -545,6 +545,8 @@ void NativeWindowMac::Close() {
   // When this is a sheet showing, performClose won't work.
   if (is_modal() && parent() && IsVisible()) {
     [parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_];
+    // Manually emit close event (not triggered from close fn)
+    NotifyWindowCloseButtonClicked();
     CloseImmediately();
     return;
   }