This code uses CPU too much until I click the window. #include <X11/Xlib.h> static Bool check(Display *dpy, XEvent *ev, XPointer arg) { return ev->type == ButtonPress; } int main(void) { Display *dpy = XOpenDisplay(NULL); Window win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 100, 100, 0, 0, 0); XSelectInput(dpy, win, ExposureMask | ButtonPressMask); XMapWindow(dpy, win); XEvent ev; XIfEvent(dpy, &ev, check, NULL); return 0; } X11R7.2 slackware 11.0 linux kernel 2.6.20.6 glibc 2.5 gcc 4.1.2 ThinkPad X40
You're right: Xlib/XCB had a performance bug that code like yours (and metacity) triggered. Josh and I believe it is now fixed in libX11 git, and we'll release a new version after some more testing.
*** Bug 10173 has been marked as a duplicate of this bug. ***
JFI: this appears to be this commit: http://gitweb.freedesktop.org/?p=xcb/libxcb.git;a=commitdiff;h=e20a31d72b8838cdf31b568431b5ad78492c1481
Hmm.. probably not, but rather one from http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=log Would be nice to post a commit link for reference, if a bug gets closed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.