GTK2 Some events do not unblock g_main_context_iteration
Original Reporter info from Mantis: JoshyFun @joshyfun
-
Reporter name: José Mejuto
Original Reporter info from Mantis: JoshyFun @joshyfun
- Reporter name: José Mejuto
Description:
Testing GeckoPort in my Ubuntu (running in Virtualbox) I had problem not present in the Win32 version. GeckoBrowser is a TCustomControl and the underlaying browser delivers paint events to the widget to request updates (when content changes) but this events are not unblocking g_main_context_iteration.
Once I move the mouse over the form, or any other similar event the queue is being processed, and paint events for GeckoBrowser are being processed too for about near one second (maybe already enqued ones?).
Side effects are that browser is not updated/showed until a regular event is fired and meanwhile the application takes up 100% CPU for that process (maybe Gecko waiting spinning for the answer to the fired events?).
This effect is not visible in the C++ GTK Gecko version, so it is somehow related to LCL and maybe the way LCL design the TCustomControl and its events.
Compiling LCL with GTK_MAIN_OLD_ITERATION "solves" the problem and CPU is being reduced to 1-2% for the process in idle state.
Setting g_main_context_iteration to not block still consumes ~100% CPU but events are processed.
Steps to reproduce:
I was unable to write a synthetic code that triggers the problem. So the only way to check it is using the Geckoport code (Additional information link).
It could be somehow related with bug 018188
Additional information:
[Geckoport]
http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus-ccr/components/geckoport/
[Gecko setup]
http://wiki.lazarus.freepascal.org/GeckoPort#GTK2_widgetset