-
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
[Problem/Bug]: A window hierarchy problem introduced by WebView2 #4787
Comments
@zprettytext What you're describing makes sense. When both process A and process B share the same WebView2 Environment settings, they end up sharing the same msedgewebview2.exe process. Child HWNDs across a thread or process boundary results in attached input queues. So having process A and process B share a WebView2 process, results in all 3 processes now having attached input queues. This gives all processes foreground permission to change the active window. I believe that you can resolve the issue above by adding SWP_NOOWNERZORDER .-,SWP_NOOWNERZORDER,-0x0200) to your SetWindowPos flags. This should prevent the owner window from changing z-order when you change the owned popup window to be HWND_TOP. |
What happened?
background
The background of the problem is this: we have two processes A and B that reuse the same WebView2 Run Environment. The process model is as follows:
Then we found the following problems:
Cause analysis:
This problem only occurs when WebView is loaded in both A and B.
We speculate that it is probably because when WebView is loaded in both A and B, A and B contain child windows (WebView window handles) belonging to the same process (Microsoft Edge WebView2), which leads to a problem that the Z order of A and B windows is mixed together.
conclusion
We need A and B to share the same WebView permission environment so that WebView can share cache data. However, we don't want to cause window Z order problems due to sharing the same Microsoft Edge WebView2 process. We want a perfect solution.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
122.0.2365.80
SDK Version
1.0221
Framework
Win32
Operating System
Windows 10, Windows 11
OS Version
No response
Repro steps
Please refer to the above description.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: