XDestroyWindow can not really close the window
Ilya Anfimov
ilan at tzirechnoy.com
Fri May 11 17:04:18 UTC 2018
On Thu, May 10, 2018 at 06:23:08PM -0700, Alan Coopersmith wrote:
> 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.
I think, it could be useful to note, that it does not necessary
send request to a server. It may. In some circumstances or on
some implementations. But it is not required to do so.
>
> 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.coopersmith at oracle.com
> Oracle Solaris Engineering - https://blogs.oracle.com/alanc
> _______________________________________________
> xorg at 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
More information about the xorg
mailing list