Closed Hyrius closed 5 years ago
Has finally been fixed in CEF
, see commit https://bitbucket.org/chromiumembedded/cef/commits/db143a568876175974e9abed4817f989af23f5d3 for details.
https://github.com/cefsharp/CefSharp/blob/cefsharp/71/CefSharp.WinForms/ChromiumWebBrowser.cs#L644
I will likely make WS_EX_NOACTIVATE
the default and allow for customisation of IWindowInfo
like in WPF
. Anyone wishing to still use the default behaviour will be able to, though it doesn't really make much sense for it to be the default to me.
https://github.com/cefsharp/CefSharp/blob/cefsharp/71/CefSharp.Wpf/ChromiumWebBrowser.cs#L1773
WS_EX_NOACTIVATE
was made the default in https://github.com/cefsharp/CefSharp/commit/a7a73dc930f1ee2f39c40a170e9f795247b3e4e6
To re-enable activation by default then create a custom class that inherits from ChromiumWebBrowser
and override
the CreateBrowserWindowInfo
method. Then it's a simple case of removing WS_EX_NOACTIVATE
from WindowInfo.ExStyle
const uint WS_EX_NOACTIVATE = 0x08000000;
windowInfo.ExStyle &= ~WS_EX_NOACTIVATE;
If there is enough demand then I will add a bool Property
that can be used to enable/disable activation. It's not clear that there is enough demand at the moment, most people asking how to disable window activation as it's an unexpected behaviour.
Any Example of implementation in C# winform ???
Needs to be fixed in
CEF
. Search theCEF
issue tracker, there is already an open issue for this.