Why is XSetStandardProperties freezing?

Adam Jackson ajax at redhat.com
Thu Jun 21 07:07:53 PDT 2012


On Thu, 2012-06-21 at 13:08 +0100, Myrosia Dzikovska wrote:

> TASKTYPE TASKMOD XEventThread(void *data)
> {
>    XEvent xev;
>    HEventRec r;
>    HWin win;
>    HThread t;
>    do{
>       XNextEvent(globDisp, &xev);
>       r=convertXevToHEventRec(xev);
>       if(r.event != HIGNORE) {
>          win=FindWindowRec(xev.xany.window);
>          t=win->theThread;
>          postEventToQueue(t, r);
>       }
>       HFlush();
>    }
>    while(True);
> }
> 
> Basically, it's taking up X events and re-posting them into queues
> handled by the apps with the convertXevToHEventRec and
> postEventToQueue calls.
> 
> If I disable the creation of that thread, nothing freezes anymore, but
> the apps that depend on the library start misbehaving (e.g., windows
> not reacting properly to close events).
> 
> I tried adding XLockDisplay/XUnlockDisplay around the calls to
> XNextEvent, but that does not work because it blocks waiting for
> events and the display is permanently locked.

Do you mean you halt in XLockDisplay, or in XNextEvent?  If the former,
then xlib is probably already locked by another thread.  If the latter,
then perhaps you didn't call XInitThreads, or didn't call it early
enough.

Alternatively, the OSes you're comparing may not have identical versions
of libX11 and libxcb, and the failing one is missing a thread-safety
fix.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20120621/7cbc437b/attachment.pgp>


More information about the xorg mailing list