mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-30 20:44:29 +00:00
always keep default values when creating window
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user