-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Feature Request - Add IBrowserProcessHandler.OnScheduleMessagePumpWork #1748
Comments
I've added a rough example, not production ready by any means. https://github.com/cefsharp/CefSharp/search?l=C%23&q=OnScheduleMessagePumpWork |
For |
Another example can be seen in |
Is integrating into a current message loop still an acceptable solution? Also, I'm not thrilled with adding a timer that runs 30 times a second. It doesn't seem to adversely affect performance but it's always running ... even if a ChromiumWebBrowser is not being shown/used. Is there a way, maybe, to set up a WpfBrowserProcessHandler ... when using a ChromiumWebBrowser ... and then taking it down ... when I'm no longer using a ChromiumWebBrowser? That is, is there another way to hook this baby in ... instead of via Cef.Initialize? |
Yes, see https://github.com/cefsharp/CefSharp/wiki/General-Usage#multithreadedmessageloop
No, we're limited by the http://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html#CefInitialize(constCefMainArgs&,constCefSettings&,CefRefPtr%3CCefApp%3E,void*) |
There is nothing that says you have to run a http://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html#CefDoMessageLoopWork() If you have further questions please ask them on https://gitter.im/cefsharp/CefSharp |
This comment has been minimized.
This comment has been minimized.
Maybe this quick hack helps someone. For the menu to close when clicking on the browser control I created a simple class file "ChromiumWebBrowser.cs" and added:
|
CEF Now provides support for integrating into an existing message loop.
Resolved with 63ef6be
Breaking Change:
Cef.OnContextInitialized
has been removed and is now part of theIBrowserProcessHandler
interface.Notes:
setting.MultiThreadedMessageLoop = false;
setting.ExternalMessagePump= true;
IBrowserProcessHandler.OnScheduleMessagePumpWork
you should refer to theCEF
reference implementation for ideas see https://bitbucket.org/chromiumembedded/cef/commits/1ff26aa02a656b3bc9f0712591c92849c5909e04?at=2785Background:
The default is to use
MultiThreadedMessageLoop
, this provides excellent performance though has it's own problems in the message loop is run in a different thread to your main application. This makes it difficult for messages to be passed, like when you display the context menu, click on your app title bar, there menu will stay shown as the message loops aren't aware of the message triggered by clicking the title bar.The text was updated successfully, but these errors were encountered: