From bbbc9e6f61123f1e0ff8e0f78f675616f0461a79 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Mon, 6 Sep 2021 11:44:57 +0200 Subject: [PATCH 01/14] make splashscreen draggable --- ElectronNET.Host/splashscreen/index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ElectronNET.Host/splashscreen/index.html b/ElectronNET.Host/splashscreen/index.html index ddd85e2..bafd72a 100644 --- a/ElectronNET.Host/splashscreen/index.html +++ b/ElectronNET.Host/splashscreen/index.html @@ -10,9 +10,10 @@ splashscreen From a3fb411d8aa3f60beba508ab76a841d9b5bdf584 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Mon, 6 Sep 2021 12:39:32 +0200 Subject: [PATCH 02/14] always keep default values when creating window --- ElectronNET.API/WindowManager.cs | 4 ++-- ElectronNET.Host/api/browserWindows.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ElectronNET.API/WindowManager.cs b/ElectronNET.API/WindowManager.cs index 60f4a1c..6be6071 100644 --- a/ElectronNET.API/WindowManager.cs +++ b/ElectronNET.API/WindowManager.cs @@ -126,10 +126,10 @@ namespace ElectronNET.API if (options.X == -1 && options.Y == -1) { - options.X = 0; + options.X = 0; //This is manually removed by the browserWindows.js code before creating the window options.Y = 0; - BridgeConnector.Emit("createBrowserWindow", guid, JObject.FromObject(options, _jsonSerializer), loadUrl); + BridgeConnector.Emit("createBrowserWindow", guid, JObject.FromObject(options, _keepDefaultValuesSerializer), loadUrl); } else { diff --git a/ElectronNET.Host/api/browserWindows.js b/ElectronNET.Host/api/browserWindows.js index 458c4d9..ecf3209 100644 --- a/ElectronNET.Host/api/browserWindows.js +++ b/ElectronNET.Host/api/browserWindows.js @@ -182,6 +182,12 @@ module.exports = (socket, app) => { else if (!options.webPreferences) { options = { ...options, webPreferences: { nodeIntegration: true, contextIsolation: false } }; } + + if (options.x && options.y && options.x == 0 && options.y == 0) { + delete options.x; + delete options.y; + } + // we dont want to recreate the window when watch is ready. if (app.commandLine.hasSwitch('watch') && app['mainWindowURL'] === loadUrl) { window = app['mainWindow']; From 9693c82792af90ae5283499a38532d23aae4c69d Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Mon, 6 Sep 2021 15:18:59 +0200 Subject: [PATCH 03/14] Add TitleBarOverlay option --- ElectronNET.API/Entities/BrowserWindowOptions.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ElectronNET.API/Entities/BrowserWindowOptions.cs b/ElectronNET.API/Entities/BrowserWindowOptions.cs index 2199fe4..8918192 100644 --- a/ElectronNET.API/Entities/BrowserWindowOptions.cs +++ b/ElectronNET.API/Entities/BrowserWindowOptions.cs @@ -222,6 +222,12 @@ namespace ElectronNET.API.Entities /// public bool FullscreenWindowTitle { get; set; } + /// + /// Activate the Window Controls Overlay on Windows, when combined with = + /// + [SupportedOSPlatform("win")] + public bool TitleBarOverlay { get; set; } + /// /// Use WS_THICKFRAME style for frameless windows on Windows, which adds standard /// window frame.Setting it to false will remove window shadow and window From 801616cd532c40b6b60663352dca9c88d116d27b Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Mon, 6 Sep 2021 15:54:32 +0200 Subject: [PATCH 04/14] Let users set the color of the titlebar instead of just enabling it --- ElectronNET.API/Entities/BrowserWindowOptions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ElectronNET.API/Entities/BrowserWindowOptions.cs b/ElectronNET.API/Entities/BrowserWindowOptions.cs index 8918192..863b133 100644 --- a/ElectronNET.API/Entities/BrowserWindowOptions.cs +++ b/ElectronNET.API/Entities/BrowserWindowOptions.cs @@ -226,7 +226,8 @@ namespace ElectronNET.API.Entities /// Activate the Window Controls Overlay on Windows, when combined with = /// [SupportedOSPlatform("win")] - public bool TitleBarOverlay { get; set; } + [DefaultValue(null)] + public TitleBarOverlayConfig TitleBarOverlay { get; set; } /// /// Use WS_THICKFRAME style for frameless windows on Windows, which adds standard From dc2662e52e8bb1f88a8aa1d224030909669a9321 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Tue, 7 Sep 2021 14:36:57 +0200 Subject: [PATCH 05/14] Add way to set flags for Electron before the app starts --- ElectronNET.API/App.cs | 4 ++-- ElectronNET.API/CommandLine.cs | 2 +- ElectronNET.API/Entities/TitleBarStyle.cs | 6 ++++++ ElectronNET.API/Entities/WebPreferences.cs | 6 ++++++ ElectronNET.Host/main.js | 9 +++++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ElectronNET.API/App.cs b/ElectronNET.API/App.cs index e133c5c..793bb2a 100644 --- a/ElectronNET.API/App.cs +++ b/ElectronNET.API/App.cs @@ -539,9 +539,9 @@ namespace ElectronNET.API public Task GetNameAsync() => BridgeConnector.OnResult("appGetName", "appGetNameCompleted"); - internal App() + private App() { - CommandLine = new CommandLine(); + CommandLine = CommandLine.Instance; } internal static App Instance diff --git a/ElectronNET.API/CommandLine.cs b/ElectronNET.API/CommandLine.cs index 26a116c..40c48e4 100644 --- a/ElectronNET.API/CommandLine.cs +++ b/ElectronNET.API/CommandLine.cs @@ -8,7 +8,7 @@ namespace ElectronNET.API /// public sealed class CommandLine { - internal CommandLine() { } + private CommandLine() { } internal static CommandLine Instance { diff --git a/ElectronNET.API/Entities/TitleBarStyle.cs b/ElectronNET.API/Entities/TitleBarStyle.cs index 8fb108e..5ee48bc 100644 --- a/ElectronNET.API/Entities/TitleBarStyle.cs +++ b/ElectronNET.API/Entities/TitleBarStyle.cs @@ -28,4 +28,10 @@ namespace ElectronNET.API.Entities /// customButtonsOnHover } + + public class TitleBarOverlayConfig + { + public string Color { get; set; } + public string SymbolColor { get; set; } + } } \ No newline at end of file diff --git a/ElectronNET.API/Entities/WebPreferences.cs b/ElectronNET.API/Entities/WebPreferences.cs index f236247..ea4a1f1 100644 --- a/ElectronNET.API/Entities/WebPreferences.cs +++ b/ElectronNET.API/Entities/WebPreferences.cs @@ -171,6 +171,12 @@ namespace ElectronNET.API.Entities /// public bool Offscreen { get; set; } + /// + /// Whether to enable built-in spellcheck + /// + [DefaultValue(true)] + public bool Spellcheck { get; set; } = true; + /// /// Whether to run Electron APIs and the specified preload script in a separate /// JavaScript context. Defaults to false. The context that the preload script runs diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index 201d534..c1fbd73 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -54,6 +54,7 @@ app.on('before-quit-for-update', () => { }); const manifestJsonFile = require(manifestJsonFilePath); + if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { const mainInstance = app.requestSingleInstanceLock(); app.on('second-instance', (events, args = []) => { @@ -81,6 +82,14 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { } } +//Some flags need to be set before app is ready +if (manifestJsonFile.hasOwnProperty('cliFlags') && manifesJsonFile.cliFlags.length > 0) { + manifestJsonFile.cliFlags.forEach(flag => { + app.commandLine.appendSwitch(flag); + }); +} + + app.on('ready', () => { // Fix ERR_UNKNOWN_URL_SCHEME using file protocol From a637174b93d402f31a85d2b95a46da1f28653140 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Tue, 7 Sep 2021 15:00:35 +0200 Subject: [PATCH 06/14] typo --- ElectronNET.Host/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index c1fbd73..baeff4d 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -83,7 +83,7 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { } //Some flags need to be set before app is ready -if (manifestJsonFile.hasOwnProperty('cliFlags') && manifesJsonFile.cliFlags.length > 0) { +if (manifestJsonFile.hasOwnProperty('cliFlags') && manifestJsonFile.cliFlags.length > 0) { manifestJsonFile.cliFlags.forEach(flag => { app.commandLine.appendSwitch(flag); }); From 6a4a7eff1ca095b724d808e5afed95cfc0bbfbb0 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Tue, 7 Sep 2021 17:48:12 +0200 Subject: [PATCH 07/14] Workaround for electron freeze bug --- ElectronNET.Host/main.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index baeff4d..f7c4d05 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -172,12 +172,13 @@ function startSplashScreen() { } } - - splashScreen.setIgnoreMouseEvents(true); + //Removed as we want to be able to drag the splash screen: splashScreen.setIgnoreMouseEvents(true); app.once('browser-window-created', () => { - splashScreen.destroy(); - splashScreen = null; + if (splashScreen) { + splashScreen.hide(); + } + //We cannot destroy the window here as this triggers an electron freeze bug (https://github.com/electron/electron/issues/29050) }); const loadSplashscreenUrl = path.join(__dirname, 'splashscreen', 'index.html') + '?imgPath=' + imageFile; @@ -271,6 +272,13 @@ function startSocketApiBridge(port) { } }); + socket.on('splashscreen-destroy', () => { + if(splashScreen) { + splashScreen.destroy(); + splashScreen = null; + } + }); + socket.on('register-app-open-url-event', (id) => { global['electronsocket'] = socket; From 9be80abfcfadc753278389e2582741127b668407 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Tue, 7 Sep 2021 19:19:49 +0200 Subject: [PATCH 08/14] Add method to destroy splashscreen --- ElectronNET.API/App.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ElectronNET.API/App.cs b/ElectronNET.API/App.cs index 793bb2a..e8b7d72 100644 --- a/ElectronNET.API/App.cs +++ b/ElectronNET.API/App.cs @@ -1338,6 +1338,13 @@ namespace ElectronNET.API /// The handler public void Once(string eventName, Action fn) => Events.Instance.Once(ModuleName, eventName, fn); + + /// + /// If you're using a splashscreen in the electron.manifest.json, the window will ony be fully destroyed once you call this method once. + /// You should only do this after creating another window, to avoid a bug where the Electron renderer process frezees till any window interaction. + /// + public void DestroySplashScreen() => BridgeConnector.Emit("splashscreen-destroy"); + private readonly JsonSerializer _jsonSerializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver() From 5559fc61b19da67eeef690146a56541f5a187b35 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Wed, 8 Sep 2021 08:47:16 +0200 Subject: [PATCH 09/14] force-destroy all windows on before-quit-for-update --- ElectronNET.Host/main.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index f7c4d05..e3b9741 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -51,6 +51,20 @@ app.on('will-finish-launching', () => { app.on('before-quit-for-update', () => { ignoreApiProcessClosed = true; + + const windows = BrowserWindow.getAllWindows(); + if (windows.length) { + windows.forEach(w => { + try { + w.hide(); + w.destroy(); + } + catch { + //ignore, probably already destroyed + } + }); + } + }); const manifestJsonFile = require(manifestJsonFilePath); From 8604b50224102ebbf26cbffa821dec2eadc8dd93 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Wed, 8 Sep 2021 08:57:05 +0200 Subject: [PATCH 10/14] Add method to destroy all windows manually --- ElectronNET.API/WindowManager.cs | 13 +++++++++++++ ElectronNET.Host/api/browserWindows.js | 19 +++++++++++++++++++ ElectronNET.Host/api/browserWindows.ts | 18 ++++++++++++++++++ ElectronNET.Host/main.js | 1 - 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/ElectronNET.API/WindowManager.cs b/ElectronNET.API/WindowManager.cs index 6be6071..dbb0da2 100644 --- a/ElectronNET.API/WindowManager.cs +++ b/ElectronNET.API/WindowManager.cs @@ -218,6 +218,19 @@ namespace ElectronNET.API return await taskCompletionSource.Task; } + + /// + /// Destroy all windows. + /// + /// Number of windows destroyed + public async Task DestroyAllWindows() + { + var destroyed = await BridgeConnector.OnResult("browserWindowDestroyAll", "browserWindowDestroyAll-completed"); + _browserViews.Clear(); + _browserWindows.Clear(); + return destroyed; + } + private static JsonSerializer _jsonSerializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver(), diff --git a/ElectronNET.Host/api/browserWindows.js b/ElectronNET.Host/api/browserWindows.js index ecf3209..4703f16 100644 --- a/ElectronNET.Host/api/browserWindows.js +++ b/ElectronNET.Host/api/browserWindows.js @@ -262,6 +262,25 @@ module.exports = (socket, app) => { socket.on('browserWindowDestroy', (id) => { getWindowById(id)?.destroy(); }); + + socket.on('browserWindowDestroyAll', () => { + const windows = electron_1.BrowserWindow.getAllWindows(); + let count = 0; + if (windows.length) { + windows.forEach(w => { + try { + w.hide(); + w.destroy(); + count++; + } + catch { + //ignore, probably already destroyed + } + }); + } + electronSocket.emit('browserWindowDestroyAll-completed', count); + }); + socket.on('browserWindowClose', (id) => { getWindowById(id)?.close(); }); diff --git a/ElectronNET.Host/api/browserWindows.ts b/ElectronNET.Host/api/browserWindows.ts index c1923a1..82d9765 100644 --- a/ElectronNET.Host/api/browserWindows.ts +++ b/ElectronNET.Host/api/browserWindows.ts @@ -288,6 +288,24 @@ export = (socket: Socket, app: Electron.App) => { getWindowById(id)?.destroy(); }); + socket.on('browserWindowDestroyAll', () => { + const windows = BrowserWindow.getAllWindows(); + let count = 0; + if (windows.length) { + windows.forEach(w => { + try { + w.hide(); + w.destroy(); + count++; + } + catch { + //ignore, probably already destroyed + } + }); + } + electronSocket.emit('browserWindowDestroyAll-completed', count); + }); + socket.on('browserWindowClose', (id) => { getWindowById(id)?.close(); }); diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index e3b9741..3b4c6dc 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -64,7 +64,6 @@ app.on('before-quit-for-update', () => { } }); } - }); const manifestJsonFile = require(manifestJsonFilePath); From 67ea8c768e58d124e23d765f4c74905b0bfe7100 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Fri, 10 Sep 2021 10:11:41 +0200 Subject: [PATCH 11/14] Update BrowserWindow.cs --- ElectronNET.API/BrowserWindow.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ElectronNET.API/BrowserWindow.cs b/ElectronNET.API/BrowserWindow.cs index e2fc622..fb5c1e4 100644 --- a/ElectronNET.API/BrowserWindow.cs +++ b/ElectronNET.API/BrowserWindow.cs @@ -1075,6 +1075,14 @@ namespace ElectronNET.API { BridgeConnector.Emit("browserWindowSetFullScreen", Id, flag); } + + /// + /// Sets whether the background color of the window + /// + public void SetBackgroundColor(string color) + { + BridgeConnector.Emit("browserWindowSetBackgroundColor", Id, color); + } /// /// Whether the window is in fullscreen mode. From 124d24a19ca62739cbe38d7f6525631adee9d8b2 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Fri, 10 Sep 2021 10:12:56 +0200 Subject: [PATCH 12/14] Update browserWindows.ts --- ElectronNET.Host/api/browserWindows.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ElectronNET.Host/api/browserWindows.ts b/ElectronNET.Host/api/browserWindows.ts index 82d9765..7eda1ef 100644 --- a/ElectronNET.Host/api/browserWindows.ts +++ b/ElectronNET.Host/api/browserWindows.ts @@ -389,7 +389,11 @@ export = (socket: Socket, app: Electron.App) => { socket.on('browserWindowSetFullScreen', (id, fullscreen) => { getWindowById(id)?.setFullScreen(fullscreen); }); - + + socket.on('browserWindowSetBackgroundColor', (id, color) => { + getWindowById(id)?.setBackgroundColor(color); + }); + socket.on('browserWindowIsFullScreen', (id) => { const isFullScreen = getWindowById(id)?.isFullScreen() ?? null; From 836eebf256c2d91348f5dad2aa81de8b2dfd58f6 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Fri, 10 Sep 2021 10:13:23 +0200 Subject: [PATCH 13/14] Update browserWindows.js --- ElectronNET.Host/api/browserWindows.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ElectronNET.Host/api/browserWindows.js b/ElectronNET.Host/api/browserWindows.js index 4703f16..bb4d629 100644 --- a/ElectronNET.Host/api/browserWindows.js +++ b/ElectronNET.Host/api/browserWindows.js @@ -343,6 +343,9 @@ module.exports = (socket, app) => { socket.on('browserWindowSetFullScreen', (id, fullscreen) => { getWindowById(id)?.setFullScreen(fullscreen); }); + socket.on('browserWindowSetBackgroundColor', (id, color) => { + getWindowById(id)?.setBackgroundColor(color); + }); socket.on('browserWindowIsFullScreen', (id) => { const isFullScreen = getWindowById(id)?.isFullScreen() ?? null; electronSocket.emit('browserWindow-isFullScreen-completed' + id, isFullScreen); @@ -653,4 +656,4 @@ module.exports = (socket, app) => { return null; } }; -//# sourceMappingURL=browserWindows.js.map \ No newline at end of file +//# sourceMappingURL=browserWindows.js.map From adef39f3ec82b91d7cc3989eeea4fadb262bcab2 Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Fri, 10 Sep 2021 10:53:49 +0200 Subject: [PATCH 14/14] Change flags to nullable --- .../Entities/BrowserWindowOptions.cs | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/ElectronNET.API/Entities/BrowserWindowOptions.cs b/ElectronNET.API/Entities/BrowserWindowOptions.cs index 863b133..c7263ae 100644 --- a/ElectronNET.API/Entities/BrowserWindowOptions.cs +++ b/ElectronNET.API/Entities/BrowserWindowOptions.cs @@ -37,62 +37,62 @@ namespace ElectronNET.API.Entities /// window's size will include window frame's size and be slightly larger. Default /// is false. /// - public bool UseContentSize { get; set; } + public bool? UseContentSize { get; set; } /// /// Show window in the center of the screen. /// - public bool Center { get; set; } + public bool? Center { get; set; } /// /// Window's minimum width. Default is 0. /// - public int MinWidth { get; set; } + public int? MinWidth { get; set; } /// /// Window's minimum height. Default is 0. /// - public int MinHeight { get; set; } + public int? MinHeight { get; set; } /// /// Window's maximum width. Default is no limit. /// - public int MaxWidth { get; set; } + public int? MaxWidth { get; set; } /// /// Window's maximum height. Default is no limit. /// - public int MaxHeight { get; set; } + public int? MaxHeight { get; set; } /// /// Whether window is resizable. Default is true. /// [DefaultValue(true)] - public bool Resizable { get; set; } = true; + public bool? Resizable { get; set; } = true; /// /// Whether window is movable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] - public bool Movable { get; set; } = true; + public bool? Movable { get; set; } = true; /// /// Whether window is minimizable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] - public bool Minimizable { get; set; } = true; + public bool? Minimizable { get; set; } = true; /// /// Whether window is maximizable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] - public bool Maximizable { get; set; } = true; + public bool? Maximizable { get; set; } = true; /// /// Whether window is closable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] - public bool Closable { get; set; } = true; + public bool? Closable { get; set; } = true; /// /// Whether the window can be focused. Default is true. On Windows setting @@ -101,35 +101,35 @@ namespace ElectronNET.API.Entities /// always stay on top in all workspaces. /// [DefaultValue(true)] - public bool Focusable { get; set; } = true; + public bool? Focusable { get; set; } = true; /// /// Whether the window should always stay on top of other windows. Default is false. /// - public bool AlwaysOnTop { get; set; } + public bool? AlwaysOnTop { get; set; } /// /// Whether the window should show in fullscreen. When explicitly set to false the /// fullscreen button will be hidden or disabled on macOS.Default is false. /// - public bool Fullscreen { get; set; } + public bool? Fullscreen { get; set; } /// /// Whether the window can be put into fullscreen mode. On macOS, also whether the /// maximize/zoom button should toggle full screen mode or maximize window.Default /// is true. /// - public bool Fullscreenable { get; set; } + public bool? Fullscreenable { get; set; } /// /// Whether to show the window in taskbar. Default is false. /// - public bool SkipTaskbar { get; set; } + public bool? SkipTaskbar { get; set; } /// /// The kiosk mode. Default is false. /// - public bool Kiosk { get; set; } + public bool? Kiosk { get; set; } /// /// Default window title. Default is "Electron.NET". @@ -146,40 +146,40 @@ namespace ElectronNET.API.Entities /// Whether window should be shown when created. Default is true. /// [DefaultValue(true)] - public bool Show { get; set; } = true; + public bool? Show { get; set; } = true; /// /// Specify false to create a . Default is true. /// [DefaultValue(true)] - public bool Frame { get; set; } = true; + public bool? Frame { get; set; } = true; /// /// Whether this is a modal window. This only works when the window is a child /// window.Default is false. /// - public bool Modal { get; set; } + public bool? Modal { get; set; } /// /// Whether the web view accepts a single mouse-down event that simultaneously /// activates the window.Default is false. /// - public bool AcceptFirstMouse { get; set; } + public bool? AcceptFirstMouse { get; set; } /// /// Whether to hide cursor when typing. Default is false. /// - public bool DisableAutoHideCursor { get; set; } + public bool? DisableAutoHideCursor { get; set; } /// /// Auto hide the menu bar unless the Alt key is pressed. Default is false. /// - public bool AutoHideMenuBar { get; set; } + public bool? AutoHideMenuBar { get; set; } /// /// Enable the window to be resized larger than screen. Default is false. /// - public bool EnableLargerThanScreen { get; set; } + public bool? EnableLargerThanScreen { get; set; } /// /// Window's background color as Hexadecimal value, like #66CD00 or #FFF or @@ -191,18 +191,18 @@ namespace ElectronNET.API.Entities /// Whether window should have a shadow. This is only implemented on macOS. Default /// is true. /// - public bool HasShadow { get; set; } + public bool? HasShadow { get; set; } /// /// Forces using dark theme for the window, only works on some GTK+3 desktop /// environments.Default is false. /// - public bool DarkTheme { get; set; } + public bool? DarkTheme { get; set; } /// /// Makes the window . Default is false. /// - public bool Transparent { get; set; } + public bool? Transparent { get; set; } /// /// The type of window, default is normal window. @@ -214,13 +214,13 @@ namespace ElectronNET.API.Entities /// 'default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover' /// [JsonConverter(typeof(StringEnumConverter))] - public TitleBarStyle TitleBarStyle { get; set; } + public TitleBarStyle? TitleBarStyle { get; set; } /// /// Shows the title in the tile bar in full screen mode on macOS for all /// titleBarStyle options.Default is false. /// - public bool FullscreenWindowTitle { get; set; } + public bool? FullscreenWindowTitle { get; set; } /// /// Activate the Window Controls Overlay on Windows, when combined with = @@ -235,7 +235,7 @@ namespace ElectronNET.API.Entities /// animations. Default is true. /// [DefaultValue(true)] - public bool ThickFrame { get; set; } = true; + public bool? ThickFrame { get; set; } = true; /// /// Add a type of vibrancy effect to the window, only on macOS. Can be @@ -243,7 +243,7 @@ namespace ElectronNET.API.Entities /// medium-light or ultra-dark. /// [JsonConverter(typeof(StringEnumConverter))] - public Vibrancy Vibrancy { get; set; } + public Vibrancy? Vibrancy { get; set; } /// /// Controls the behavior on macOS when option-clicking the green stoplight button @@ -252,7 +252,7 @@ namespace ElectronNET.API.Entities /// it to zoom to the width of the screen.This will also affect the behavior when /// calling maximize() directly.Default is false. /// - public bool ZoomToPageWidth { get; set; } + public bool? ZoomToPageWidth { get; set; } /// /// Tab group name, allows opening the window as a native tab on macOS 10.12+.