[Lazarus] Message Loop paused when no interaction with mouse?

Henry Vermaak henry.vermaak at gmail.com
Wed Apr 20 13:21:53 CEST 2011

On 20/04/11 11:55, Bernd wrote:
> 2011/4/20 Henry Vermaak<henry.vermaak at gmail.com>:
>> See here for a related issue:
>> http://bugs.freepascal.org/view.php?id=13120
>> You'll have to wake up the main thread after the frame (which is what your
>> timer is doing).  For gtk you can use
>> g_main_context_wakeup(g_main_context_default), for qt there is
>> QEventLoop::wakeUp().
> Thank you, this is what I have read a while ago but could not find
> anymore due to the wrong serch terms.
> But it does not seem to help :-(

Hmm, that's strange.  This works for me.  I've written a c lib that 
notifies me of usb devices getting plugged in.  The callback from the 
lib looks like this:

procedure NotifyPlug(status: cint); cdecl;
   Application.QueueAsyncCall(@Form1.NotifyAsync, status);

   {$ifdef lclgtk2}
   PostMessage(Form1.Handle, LM_PAINT, 0, 0);

Does it make a difference if you define usecthreads?  Perhaps you can 
try postmessage, too, just to rule out a bug with the QueueAsyncCall 
implementation.  Postmessage (at least on gtk) will wake up the main 
thread (make sure you define usecthreads for this, though).


More information about the Lazarus mailing list