mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: fire close event upon closing modal BrowserWindow in macOS (#19014)
* fix: emit close event from modal on macOS * fix: Move fn call to correct spot * refactor: call notify fn directly
This commit is contained in:
@@ -492,6 +492,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user