Skip to content

Commit

Permalink
fix Focus
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Jul 11, 2022
1 parent 9a01ca0 commit c6f3ac5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Avalonia.WebView2/Avalonia.WebView2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
This package is necessary for Avalonia applications. To learn more about package versions checkout https://aka.ms/wv2-packageversion. To learn best practices checkout: https://aka.ms/wv2-bestpractices.
</Description>
<PackageTags>Web WebView Native native package Edge avalonia avaloniaui dotnet framework core Webview2</PackageTags>
<Version>1.0.1264.42-preview.220711.3</Version>
<Version>1.0.1264.42-preview.220711.4</Version>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
Expand Down
26 changes: 11 additions & 15 deletions src/Avalonia.WebView2/WebView2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,18 @@ protected virtual IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lPa
{
switch ((NativeMethods.WM)msg)
{
case NativeMethods.WM.SETFOCUS:
#if !DISABLE_WEBVIEW2_CORE
if (_coreWebView2Controller != null)
{
_coreWebView2Controller.MoveFocus(CoreWebView2MoveFocusReason.Programmatic);
}
#endif
break;
// case NativeMethods.WM.SETFOCUS:
//#if !DISABLE_WEBVIEW2_CORE
// if (_coreWebView2Controller != null)
// {
// _coreWebView2Controller.MoveFocus(CoreWebView2MoveFocusReason.Programmatic);
// }
//#endif
// break;
case NativeMethods.WM.PAINT:
if (!IsInDesignMode)
{
NativeMethods.BeginPaint(hwnd, out var lpPaint);
NativeMethods.EndPaint(hwnd, ref lpPaint);
handled = true;
return IntPtr.Zero;
}
NativeMethods.BeginPaint(hwnd, out var lpPaint);
NativeMethods.EndPaint(hwnd, ref lpPaint);
handled = true;
break;
//case NativeMethods.WM.WINDOWPOSCHANGING:
// break;
Expand Down

0 comments on commit c6f3ac5

Please sign in to comment.