From f8a140cdf65e8dcf1c74da5e214d332833d30923 Mon Sep 17 00:00:00 2001 From: Nicola Date: Fri, 23 Oct 2020 17:09:45 +0200 Subject: [PATCH] DIsable transparent on Chromium --- Client.Config/ClientValidator.xsd | 3 ++- Client.Config/Config.xml | 1 + Client.Config/ConfigController.cs | 10 ++++++++++ Client.Config/SubModels/Client.cs | 3 +++ Client2020/Program.cs | 4 +++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Client.Config/ClientValidator.xsd b/Client.Config/ClientValidator.xsd index e6c3eae9..7d4ec7e9 100644 --- a/Client.Config/ClientValidator.xsd +++ b/Client.Config/ClientValidator.xsd @@ -11,7 +11,8 @@ - + + diff --git a/Client.Config/Config.xml b/Client.Config/Config.xml index 8c1d68c1..1715196d 100644 --- a/Client.Config/Config.xml +++ b/Client.Config/Config.xml @@ -2,6 +2,7 @@ false + false #FF00FF GPU true diff --git a/Client.Config/ConfigController.cs b/Client.Config/ConfigController.cs index 9c2bf1b1..44f3b7a9 100644 --- a/Client.Config/ConfigController.cs +++ b/Client.Config/ConfigController.cs @@ -31,6 +31,7 @@ namespace Client.Config .Descendants(Constants.CLIENT_CONFIG_KEY) .Select(x => new SubModels.Client() { + EnableTransparent = ValidateEnableTransparent(x.Element("EnableTransparent").Value), TranspColor = ValidateTranspColor(x.Element("TranspColor").Value), RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value), RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value), @@ -179,7 +180,16 @@ namespace Client.Config throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type"); } + private static bool ValidateEnableTransparent(string value) + { + Boolean DeveloperMode; + if (Boolean.TryParse(value, out DeveloperMode)) + return DeveloperMode; + else + throw new Exception(@"Configuration Error: ""Client - EnableTransparent"" is not a valid Boolean Type"); + } + private static Boolean ValidateFollowNcWin(String value) { diff --git a/Client.Config/SubModels/Client.cs b/Client.Config/SubModels/Client.cs index 32fc0431..d8218a58 100644 --- a/Client.Config/SubModels/Client.cs +++ b/Client.Config/SubModels/Client.cs @@ -13,5 +13,8 @@ namespace Client.Config.SubModels public Boolean DeveloperMode { get; set; } public Boolean IsSCM { get; set; } public Boolean Autorun { get; set; } + public Boolean EnableTransparent { get; set; } + + } } diff --git a/Client2020/Program.cs b/Client2020/Program.cs index f9f4b3bc..fc419b8a 100644 --- a/Client2020/Program.cs +++ b/Client2020/Program.cs @@ -72,8 +72,10 @@ namespace Client2020 if (Config.ClientConfig.RenderingMethod == Constants.Rendering.CPU) settings.CefCommandLineArgs.Add("--disable-gpu"); + + if (Config.ClientConfig.EnableTransparent == true) + settings.CefCommandLineArgs.Add("--enable-transparent-visuals"); - settings.CefCommandLineArgs.Add("--enable-transparent-visuals"); settings.CefCommandLineArgs.Add("--disable-pinch"); settings.CefCommandLineArgs.Add("--enable-media-stream"); settings.CefCommandLineArgs.Add("--enable-usermedia-screen-capture");