From f803ed4487e1413b0fb37ae4627283af2c7f2689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Mon, 14 Oct 2024 18:16:45 +0100 Subject: [PATCH] Disable OSR by default (#360) * Disable OSR by default * Raise version * Remove system references of wpf proj --- Directory.Build.props | 2 +- SampleWebView.Avalonia/MainWindow.xaml.cs | 1 - WebViewControl/GlobalSettings.cs | 7 ++++++- WebViewControl/WebView.cs | 2 +- WebViewControl/WebViewControl.csproj | 17 ----------------- tests/Tests.WebView/App.xaml.cs | 1 - 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a7a65c6b..6eada46f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,7 +10,7 @@ 2.0.0.0 2.0.0.0 - 3.120.5 + 3.120.6 OutSystems WebViewControl Copyright © OutSystems 2023 diff --git a/SampleWebView.Avalonia/MainWindow.xaml.cs b/SampleWebView.Avalonia/MainWindow.xaml.cs index 9dce859b..4bc7ecc2 100755 --- a/SampleWebView.Avalonia/MainWindow.xaml.cs +++ b/SampleWebView.Avalonia/MainWindow.xaml.cs @@ -7,7 +7,6 @@ namespace SampleWebView.Avalonia { internal class MainWindow : Window { public MainWindow() { - WebView.Settings.OsrEnabled = false; WebView.Settings.LogFile = "ceflog.txt"; AvaloniaXamlLoader.Load(this); diff --git a/WebViewControl/GlobalSettings.cs b/WebViewControl/GlobalSettings.cs index 427fa6d4..1482b352 100644 --- a/WebViewControl/GlobalSettings.cs +++ b/WebViewControl/GlobalSettings.cs @@ -9,7 +9,7 @@ public class GlobalSettings { private bool persistCache; private bool enableErrorLogOnly; - private bool osrEnabled = true; + private bool osrEnabled = false; private string userAgent; private string logFile; private string cachePath = Path.Combine(Path.GetTempPath(), "WebView" + Guid.NewGuid().ToString().Replace("-", null) + DateTime.UtcNow.Ticks); @@ -65,6 +65,11 @@ public string LogFile { } } + /// + /// Set to true to enable off-screen rendering support. + /// Do not enable this setting if the application does not use off-screen rendering + /// as it may reduce rendering performance and cause some issues. + /// public bool OsrEnabled { get => osrEnabled; set { diff --git a/WebViewControl/WebView.cs b/WebViewControl/WebView.cs index 579de43d..25b0551f 100644 --- a/WebViewControl/WebView.cs +++ b/WebViewControl/WebView.cs @@ -140,7 +140,7 @@ private void Initialize() { chromium.KeyboardHandler = new InternalKeyboardHandler(this); if (!Settings.OsrEnabled) { - // having the handler (by default) seems to cause some focus troubles, enable only osr disabled + // having the handler (by default) seems to cause some focus troubles, enable only when osr disabled chromium.FocusHandler = new InternalFocusHandler(this); } diff --git a/WebViewControl/WebViewControl.csproj b/WebViewControl/WebViewControl.csproj index adbe95a1..73012349 100644 --- a/WebViewControl/WebViewControl.csproj +++ b/WebViewControl/WebViewControl.csproj @@ -19,23 +19,6 @@ true - - - - - - - - - - - - - - - - - diff --git a/tests/Tests.WebView/App.xaml.cs b/tests/Tests.WebView/App.xaml.cs index ebccc3d1..6c0c451d 100644 --- a/tests/Tests.WebView/App.xaml.cs +++ b/tests/Tests.WebView/App.xaml.cs @@ -8,7 +8,6 @@ public class App : Application { public App() { } public override void Initialize() { - WebViewControl.WebView.Settings.OsrEnabled = false; AvaloniaXamlLoader.Load(this); } }