[Qt-interest] Problem: X Error: BadWindow (invalid Window parameter) 3 ...
Denis Dzyubenko
denis.dzyubenko at trolltech.com
Fri Feb 6 11:22:56 CET 2009
Hi,
Zeljko wrote:
> Don't need, I've found why/where/how it happens .... before each call to
> widgetAt() I'm calling QCursor::pos(), so it happens when QCursor::pos() is
> called when program is inside widgetAt() call.
>
> Regular rule:
>
> --> QCursor::pos() enter
> <-- QCursor::pos() exit .. (gives point for widgetAt())
> --> widgetAt() enter
> <-- widgetAt() exit
>
> Problem rule:
>
> --> widgetAt() enter
> --> QCursor::pos() enter
> <-- QCursor::pos() exit
> .....never gets widgetAt() EXIT HERE !!!
>
> I've fixed that via mutexes in my app, but asking shouldn't qt be be prone
> in such case ?
Do you mean you have several threads which execute widgetAt() and
QCursor::pos() concurrently? That might lead to race conditions due to
the fact that Qt uses single connection to the X server and doesn't do
any synchronization for X calls.
--
Denis Dzyubenko
Software Engineer
Nokia, Qt Software
More information about the Qt-interest-old
mailing list