Skip to content

Commit 6001a3c

Browse files
committed
Removed ownjsonSerializer from WindowManager
Removed the unneeded serializer and applied the settings to the global this._jsonSerializer as when the X and Y values are -1 in the options it would lead to some settings not being applied. E.g. ContextIsolation with it now applying the default values when serializing, settings mentioned before are correctly assigned on Electron's end
1 parent c2ba55e commit 6001a3c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/ElectronNET.API/API/WindowManager.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ public async Task<BrowserWindow> CreateWindowAsync(BrowserWindowOptions options,
153153
options.X -= 7;
154154
}
155155

156-
var ownjsonSerializer = new JsonSerializer()
157-
{
158-
ContractResolver = new CamelCasePropertyNamesContractResolver(),
159-
NullValueHandling = NullValueHandling.Ignore
160-
};
161-
await BridgeConnector.Socket.Emit("createBrowserWindow", JObject.FromObject(options, ownjsonSerializer), loadUrl).ConfigureAwait(false);
156+
await BridgeConnector.Socket.Emit("createBrowserWindow", JObject.FromObject(options, this._jsonSerializer), loadUrl).ConfigureAwait(false);
162157
}
163158

164159
return await taskCompletionSource.Task.ConfigureAwait(false);
@@ -216,8 +211,7 @@ public async Task<BrowserView> CreateBrowserViewAsync(BrowserViewConstructorOpti
216211
private readonly JsonSerializer _jsonSerializer = new()
217212
{
218213
ContractResolver = new CamelCasePropertyNamesContractResolver(),
219-
NullValueHandling = NullValueHandling.Ignore,
220-
DefaultValueHandling = DefaultValueHandling.Ignore
214+
NullValueHandling = NullValueHandling.Ignore
221215
};
222216
}
223217
}

0 commit comments

Comments
 (0)