Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/WinFormedge/Classes.Formedge/FormBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is part of the WinFormedge project.
// This file is part of the WinFormedge project.
// Copyright (c) 2025 Xuanchen Lin all rights reserved.
// This project is licensed under the MIT License.
// See the LICENSE file in the project root for more information.
Expand Down Expand Up @@ -384,8 +384,8 @@ protected override void WndProc(ref Message m)
}
break;

case WM_ERASEBKGND:
return;
//case WM_ERASEBKGND when SystemBackdropType != SystemBackdropType.Auto:
// return;
Comment on lines +387 to +388

case WM_NCCALCSIZE when wParam == 1 && ExtendsContentIntoTitleBar && !Popup && !Fullscreen:
{
Expand Down
11 changes: 6 additions & 5 deletions src/WinFormedge/Classes.Formedge/Formedge.Internal.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is part of the WinFormedge project.
// This file is part of the WinFormedge project.
// Copyright (c) 2025 Xuanchen Lin all rights reserved.
// This project is licensed under the MIT License.
// See the LICENSE file in the project root for more information.
Expand Down Expand Up @@ -73,12 +73,14 @@ internal WebViewCore WebView
{
ProfileName = ProfileName,
IsInPrivateMode = IsInPrivateMode,

};



WebView.WebViewCreated += (_, _) => WebViewCreatedCore();
WebView.WebViewCreated += (_, _) => WebViewCreatedCore(WindowStyleSettings);
WindowStyleSettings.WndProc += WebView.HostWndProc;

}

return _webViewCore;
Expand Down Expand Up @@ -804,7 +806,7 @@ private void RegisterHostWindowEvents()
/// <summary>
/// Called when the WebView2 browser is created. Sets up host objects, scripts, and event handlers.
/// </summary>
private void WebViewCreatedCore()
private void WebViewCreatedCore(WindowSettings windowStyleSettings)
{
if (WebView.Browser == null) throw new InvalidOperationException();

Expand All @@ -813,10 +815,9 @@ private void WebViewCreatedCore()
var controller = WebView.Controller;
var webview = WebView.Browser;

controller.DefaultBackgroundColor = Color.Transparent;
controller.DefaultBackgroundColor = windowStyleSettings.BackColor;

Comment on lines 816 to 819
WebView.ConfigureSettings += ConfigureWebView2Settings;
//WebView.ConfigureProfile += ConfigureWebView2Profile;
controller.GotFocus += OnGotFocus;
controller.LostFocus += OnLostFocus;

Expand Down
4 changes: 2 additions & 2 deletions src/WinFormedge/Classes.WebView/WebViewCore.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is part of the WinFormedge project.
// This file is part of the WinFormedge project.
// Copyright (c) 2025 Xuanchen Lin all rights reserved.
// This project is licensed under the MIT License.
// See the LICENSE file in the project root for more information.
Expand Down Expand Up @@ -249,7 +249,7 @@ private async Task CreateWebView2Async()

controller.ShouldDetectMonitorScaleChanges = true;
controller.Bounds = Container.ClientRectangle;
controller.DefaultBackgroundColor = Color.Transparent;
controller.DefaultBackgroundColor = Container.BackColor; //Color.Transparent;

var webview = controller!.CoreWebView2;

Expand Down
2 changes: 1 addition & 1 deletion src/WinFormedge/WinFormedge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<Version>1.1.2</Version>
<Version>1.1.3</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down