XSelectInput(display, win, PropertyChangeMask)
(select for the event generated by XChangeProperty)
.
.
.
XChangeProperty(display, win, XA_WM_NAME, XA_STRING, 8,
PropModeAppend, NULL, NULL);
(when you want to know the server time, append zero-length data to some
window property; this generates a PropertyNotify event)
.
.
.
case PropertyNotify:
printf("Server Time is now %ld\n",report.xproperty.time);
(when the event is received, we have the time value.)
-Greg Gancarz
> XChangeProperty(display, win, XA_WM_NAME, XA_STRING, 8,
> PropModeAppend, NULL, NULL);
The last two arguments might not work on all platforms... It should be
something like:
{
unsigned char dummy;
....
XChangeProperty(display, win, XA_WM_NAME, XA_STRING, 8, PropModeAppend,
&dummy, 0);
...
}
The original risked a NULL dereference (unlikely) but at the very least
has a type mismatch on the element count in the last argument (on
platforms where NULL is a 0 cast to a pointer).
-Rob