-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: put_AreBrowserAcceleratorKeysEnabled(FALSE) doesn't work in some Win32 apps on runtime 120 #4278
Comments
@champnic FYI |
Hi @ptc-shunt , I'm looking into this issue. I am also able to repro the issue in the GettingStarted sample app but not the other one. I'll look more into this to see why this is happening. Thanks for reporting the issue. |
I can repro this in WinUI2/WinUI3 and Win32 sample apps in Win32_GettingStarted but not in the bigger apps. Opened a tracking bug on our side to continue looking |
Hi @ptc-shunt , we were able to root cause the issue and made a fix for it. The fix is now available in Canary build Version 122.0.2359.0. |
Confirmed fixed in 122.0.2362.0. Thanks. |
I also ran into this problem and can confirm that it's fixed in canary. @tofuandeve is there a way to workaround the problem as it doesn't happen always in the Test-Apps? Or is there a chance the fix gets released earlier? We currently get quite some support calls from our customers as our app gets unusable when the user presses F5. |
I have Edge 122.0.2365.50 from the beta channel Is this still a bug or something in the WinUI plumbing? |
@richardhauer I tested on a WinUI3 app with Canary channel v123 and can't seem to repro the issue, I'll try with Beta to see if I could repro this. Could you try with Canary in the meantime and let us know is you are still seeing the issue? Also could you share how you set AreBrowserAcceleratorKeysEnabled setting for WebView2 in your app? |
@Urmeli0815 Yes! It is possible to work around it by creating a handler for ICoreWebView2Controller::add_AcceleratorKeyPressed in the meantime until the fix makes it to stable release :) |
thanks @tofuandeve I have a MAUI Blazor Hybrid app on NET8 There's an event handler in the XAML for the component's
|
@tofuandeve I had a hell of a time trying to map into For the record and future travellers here, this is what I came up with, that did work. I've included the namespaces because a lot of people don't do that and it can be a real headache locating services, particularly when there's more than one with the same name. This from MainPage.xaml
Having said all that, as if by magic, the |
@richardhauer Hi, just a quick check since I can't repro this issue in Beta either. These changes in the settings for WebView2 will only take effect after a navigation. Did you navigate the WebView2 after DisableWebViewFeatures was called? |
@tofuandeve interesting... tl;dr I don't know what the event order is; we can test it empirically I guess, if it still matters. I think it depends what you mean by "navigation". The settings are set in the "Initialized" event handler, as directed by the guidance that I saw in various locations on the internet. There is a URL set declaratively in the XAML (this is a Blazor Web View component). I would assume the navigation would happen after the Initialize event, but I don't know conclusively. Further, since the document is being loaded locally it may be a "document.write()" and not a navigation event at all. Once Blazor is loaded there's no navigation in the normal sense, instead content is dynamically rewritten into the page. If this were a website we'd be talking about WASM/WebSockets, but since this is all local and there's no "server" per se I'm not actually sure how the content gets into the browser. Could be a custom URL mapping or just direct manipulation of the DOM I guess. |
@richardhauer This is an example of how devs can navigate the Webview2 control to apply the changes made to settings component in WinUI3:
The Settings value can be set in WebView2_CoreWebView2Initialized, and setting the WebView2.Source is one of the ways that devs can use to navigate the WebView2 control to make sure that all the changes to Settings are applied. CoreWebView2Settings Class |
What happened?
put_AreBrowserAcceleratorKeysEnabled(FALSE) is not working in the evergreen 120.0.2210.91 runtime, at least for some Win32 desktop apps. The standard accelerator keys (F5, Print etc) continue to work. The problem is also present in the 122.0.2323.0 canary.
It behaves as expected if I use an old 116.0.1935.0 canary runtime. I don't have any intermediate versions to try and pin down when it stopped.
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
120.0.2210.91
SDK Version
1.0.2210.55
Framework
Win32
Operating System
Windows 10
OS Version
10.0.19045
Repro steps
In the Win32_GettingStarted solution, add these lines after the existing call to put_IsWebMessageEnabled in HelloWebView.cpp:
Run the application and notice that F5, Ctrl+P have not been disabled.
(For some reason it works in the larger WebView2APISample. I haven't been able to spot a salient difference).
Repros in Edge Browser
No
Regression
Regression in newer Runtime
Last working version (if regression)
Works in 116.0.1935.0, unknown which version it stopped working. SDK version doesn't seem to matter.
AB#48454809
The text was updated successfully, but these errors were encountered: