Open Cef using Form.ShowDialog and avoid hanging or app unresponsiveness #3418
SorceryAdmin
started this conversation in
Show and tell
Replies: 1 comment
-
ShowDialog is a special case, when showing a modal dialog a modal message loop is created. Chromium isn't designed to be run in such a message loop. For reference I don't remember the specifics, just that there are problems. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Fix or WorkAround Report not sure how to call it.
What version of the product are you using?
Tested from 79 to 88-pre using Nuget
What architecture x86 or x64?
x86 and x64
On what operating system?
Win10 and Window8
Are you using WinForms, WPF or OffScreen?
WinForms
What Framework?
.net 4.5,4.62,4.7, Net Core 3/3.1 and Net 5
What is the expected output? What do you see instead?
When you use a a Window Form with CEF and then you can open a new form( as a pop up ) the main form get stuck when you close the child window. Tried with regular show or custom ILifeSpanHandler and still does not work.
similar to what his post experience:
#1574
#2086
https://groups.google.com/g/cefsharp/c/3Mi0PY6r22s
How to reproduce the error we are fixing:
on a windows form that has a CefSharpBrowser add a button and add code so when that button is hit we open a new winform using this :
When that
previewForm
is Closed/Disposed the Main Form in fact the whole App (if other pop up windows are open) whill hang and be unresponsive for about 30 seconds more less will depend.To avoid that error the updated code looks like this:
Hope this help others cause was gaving me a pain for a system where multiple pop ups by user where needed.
Tried threads and a lot of complicated ideas and was this simple one the charm.
Beta Was this translation helpful? Give feedback.
All reactions