Skip to content

Commit

Permalink
Disable OSR by default (#360)
Browse files Browse the repository at this point in the history
* Disable OSR by default

* Raise version

* Remove system references of wpf proj
  • Loading branch information
joaompneves authored Oct 14, 2024
1 parent 31d5d64 commit f803ed4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PropertyGroup>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>3.120.5</Version>
<Version>3.120.6</Version>
<Authors>OutSystems</Authors>
<Product>WebViewControl</Product>
<Copyright>Copyright © OutSystems 2023</Copyright>
Expand Down
1 change: 0 additions & 1 deletion SampleWebView.Avalonia/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion WebViewControl/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -65,6 +65,11 @@ public string LogFile {
}
}

/// <summary>
/// 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.
/// </summary>
public bool OsrEnabled {
get => osrEnabled;
set {
Expand Down
2 changes: 1 addition & 1 deletion WebViewControl/WebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
17 changes: 0 additions & 17 deletions WebViewControl/WebViewControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<None Include="app.config" />
<None Include="WebViewControl.nuspec">
Expand Down
1 change: 0 additions & 1 deletion tests/Tests.WebView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class App : Application {
public App() { }

public override void Initialize() {
WebViewControl.WebView.Settings.OsrEnabled = false;
AvaloniaXamlLoader.Load(this);
}
}
Expand Down

0 comments on commit f803ed4

Please sign in to comment.