mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-16 05:36:34 +00:00
Fix logic of all windows closed event on macos
The application was not raising the all windows closed event which didn't allow the .NET application to exit properly when the last window was closed. The recommendation by electronjs is to subscribe to the all windows closed event and exit the app via code on macos. This change allows the event to propagated up to the .NET application. It may be better to move all of the logic surrounding this to the ElectronNET.API project and allow the application developer full control over the behavior. For now, this fixes the immediate bug. GH-346
This commit is contained in:
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -31,7 +32,7 @@ namespace ElectronNET.API
|
||||
{
|
||||
BridgeConnector.Socket.On("app-window-all-closed" + GetHashCode(), () =>
|
||||
{
|
||||
if (!Electron.WindowManager.IsQuitOnWindowAllClosed)
|
||||
if (!Electron.WindowManager.IsQuitOnWindowAllClosed || RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
_windowAllClosed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user