Native pickers are hidden behind topmost parent windows
talbotmcinnis opened this issue · comments
Is there an existing issue for this?
- I have searched both open/closed issues, no issue already exists.
CefSharp Version
119.4.30
Operating System
Windows 11
Architecture
x86
.Net Version
.NEt 4.7.2
Implementation
WinForms
Reproduction Steps
Our page is using OS native CSS pickers for times, dates and colours. For example,
Our application is WPF with a Grid which is dynamically populated with a WindowsFormsHost which in turn contains our CefSharp.WinForms.ChromiumWebBrowser.
Our application launches without topmost, in which case native pickers work (appear on top of our app). However we have a "KIOSK" mode which can be enabled after launch, in which case our top application declared TopMost. Once it does so, native pickers do not appear. (Debugging shows they do show up, but behind our top window).
I have have attempted a hack by enumerating child windows of our application, and the native pickers are not found as children. They are found if I enumerate ALL desktop windows. So I suspect the creation of the native pickers is not setting the window parent.
Expected behavior
- All created windows have the window parent set.
- All created windows inherit TopMost property from their parent.
Actual behavior
Created windows have neither parents nor TopMost inherited, causing them to not appear.
Regression?
I have not found a version in which this works.
Known Workarounds
Avoiding use of TopMost. I have considered running a timer to identify the windows and manually set themt to TopMost, but this would be a messy and implementation dependent hack.
Does this problem also occur in the CEF Sample Application
Not Tested
Other information
I cannot build the cefclient so I cannot recreate it being topmost. I can build CefSharp.WinForms.Example, and if you add "this.TopMost = true;" following IntializeComponent(); in BrowserForm constructor, the behavior does appear i.e. native pickers are hidden.