On 05/10/18 06:17 PM, pengyixiang wrote:
> Hello, everyone!
>     I'm a newbie in xlib, I need to close the window while won't close the
> program, [1] is my test code, here's the result in [2], XDestroyWindow passed,
> but the window haven't close, Haven't I get the key to code it?

XDestroyWindow() just puts the request in the Xlib buffer but does not send
it to the X server.

You need to put an XFlush() before the infinite sched_yield loop to cause it to
be sent to the server, or remove the infinite sched_yield loop to allow the
program to loop back around to the XNextEvent() call which also flushes the
Xlib request buffer.  (Though then you'll end up in an infinite error loop
trying to destroy already destroyed windows.)


-- 
        -Alan Coopersmith-               alan.coopersm...@oracle.com
         Oracle Solaris Engineering - https://blogs.oracle.com/alanc
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Reply via email to