[Lazarus] Dragging a window freezes threads using synchronize [was Unmoveable forms?]

Luca Olivetti luca at wetron.es
Fri Jun 27 11:53:17 CEST 2008


En/na Luca Olivetti ha escrit:
> En/na Graeme Geldenhuys ha escrit:
> 
>>> This is *really* bad, since a user could inadvertently stop the
>>> background threads.
>>> I could try some workaround (i.e not using synchronize but set some
>>> variables in the main form and use a timer to update the visual
>>> compnents) but it's ugly and error-prone.
>>
>> I don't think it's just Lazarus. I think Windows is to blame as well.
> 
> Maybe, but the same problem with delphi (or with lazarus under Linux) 
> doesn't stop my thread.

I've been debugging the lcl and effectively it's windows that's blocking 
the main loop (I've added that information to the bug report).

However timers doesn't suffer the same fate, so, as a simple workaround, 
I can put a timer on the main form that in turn calls CheckSynchronize.

Do you see any adverse effect of this workaround?
I mean, I think the timer fires in the context of the main thread 
(otherwise checksynchronize would raise an exception) but outside the 
main application loop.

Bye
-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007



More information about the Lazarus mailing list