Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.15.1
-
None
Description
I'm successfully embedding a powerful Qt-based image processing application in a larger .NET Core WPF application. Generally everything works very nicely together, thanks for all this awesome work!
Recently we switched to using `BlockingQueuedConnection` for `QMetaObject::invokeMethod()` in order to better synchronize the apps and have return values from slots. Ever since, there are sporadic hangs of the whole application.
I could trace this down and think I understand whats going on. But I fail to see how to resolve it.
The main Qt event loop hangs in `qwindowscontext.cpp` calling `DefWindowProc()` with a mouse cursor related message. At the same time, the main .NET thread blocks in `qmetaobject.cpp` in `QMetaMethod::invoke()` with `semaphore.acquire()`.
I assume when calling slots with `BlockingQueuedConnection`, then Qt can not at the same time send unused Windows messages back to the main window. Is that possible?
Is there a solution to resolve this? I'm under the impression that I do not need all possible messages in the first place. But could I pre-filter on the WPF side to avoid Qt calling `DefWindowProc()` alltogether? Currently the messages are passed automatically, I did not install any message passing or filtering.