[Xcb] Getting time since server started and `XIfEvent'
Travis Spencer
travislspencer at gmail.com
Mon Aug 8 04:09:57 EST 2005
Hey All,
I'm porting a function [1] called get_server_time that gets the number
of milliseconds since the X server started. I think I've got it, but
I would really appreciate it if someone could double check my work.
My test app is currently at
http://www.travisspencer.com/stash2/tests/ctests/servertime.c.
The thing that I am especially unsure about is the port of XIfEvent in
the function get_server_time_xcb. I replaced that function with a
call to XCBSync and a loop that processes all of the events. If I'm
not mistaken, XIfEvent leaves all events in the queue except the one
for which the predicate returns true. My port, however, is removing
all events including the one that is being sought after.
I know it is a lot of code to look through, but I would really
appreciate the feedback.
If it looks good or after it does, I'll write up a little blurb about
it and add it to the porting guide that I'm working on.
--
Regards,
Travis Spencer
[1] http://cvs.freedesktop.org/xsettings/xsettings/xsettings-manager.c?rev=1.4&view=markup
and also known as `gdk_x11_get_server_time' in GDK:
http://cvs.gnome.org/viewcvs/gtk%2B/gdk/x11/gdkevents-x11.c?rev=1.153&view=markup
More information about the xcb
mailing list