Use electron.main.App.commandLine type

`electron.main.App.commandLine` is now defined in electron externs, no need for untyped workaround anymore.
This commit is contained in:
70/V9
2018-11-23 09:15:25 +01:00
committed by Joshua Granick
parent d8ab14f08f
commit 992f7b70d1

View File

@@ -7,7 +7,7 @@ class ElectronSetup {
static function main()
{
untyped (electron.main.App).commandLine.appendSwitch('ignore-gpu-blacklist', 'true');
electron.main.App.commandLine.appendSwitch('ignore-gpu-blacklist', 'true');
var windows:Array<OpenFLWindow> = [
::foreach windows::
@@ -46,9 +46,7 @@ class ElectronSetup {
if (height == 0) height = 600;
var frame:Bool = window.borderless == false;
var commandLine = Reflect.getProperty(electron.main.App, "commandLine");
var appendSwitch:haxe.Constraints.Function = Reflect.getProperty(commandLine, "appendSwitch");
appendSwitch('--autoplay-policy','no-user-gesture-required');
electron.main.App.commandLine.appendSwitch('--autoplay-policy','no-user-gesture-required');
electron.main.App.on( 'ready', function(e) {
var config:Dynamic = {
@@ -100,4 +98,4 @@ typedef OpenFLWindow =
width:Int,
x:Int,
y:Int
}
}