Georgi Georgiev wrote:

maillog: 12/08/2005-07:16:10(+1000): Ben Skeggs types
Donnie Berkholz wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I started a brief migrating to modular X howto, on popular demand.
Comments and additions would be appreciated.


Just a quick note for any brave amd64 users who might want to try this, it
seems that something isn't quite right as all X apps seem to cause BadValue
X errors in XCreateWindow.

I'm unsure as to whether I've done something wrong, or this is a problem
upstream.

I haven't given it a try on my athlon64 yet, but if you could take a
look at https://bugs.gentoo.org/show_bug.cgi?id=100767 and see if it
could be in any way related.
I don't think it's the same problem, but it could possibly be something similar?

I've attached a small test case which demonstrates a problem with event selection. I haven't had time yet to try this with XCreateWindow also, but I imagine I'll see similar results if I try to select for events on the window. I'll try and track this down sometime in the next 24-hours, and report upstream if it is indeed a problem there.

Ben.

#include <X11/Xlib.h>
#include <stdio.h>

#define ERROR(fmt, args...) do { \
	fprintf(stderr, fmt, ##args); \
	return -1; \
}while(0);

int main() {
	Display *dpy;
	int screen;
	Window root, wnd;

	dpy = XOpenDisplay(NULL);
	if (!dpy) ERROR("unable to open display");
	XSynchronize(dpy, True);

	screen = DefaultScreen(dpy);
	root = RootWindow(dpy, screen);
	if (root == None) ERROR("invalid root window\n");

	wnd = XCreateSimpleWindow(dpy, root, 0, 0, 640, 480, 0,
					BlackPixel(dpy, screen), WhitePixel(dpy, screen));
	if (wnd == None) ERROR("invalid window\n");
#if 1 /* causes BadValue in modular build */
	XSelectInput(dpy, wnd, KeyPressMask);
#endif
	XMapRaised(dpy, wnd);

	while(1) {
		XEvent ev;
		XNextEvent(dpy, &ev);
		switch(ev.type) {
		case KeyPress:
			XCloseDisplay(dpy);
			return 0;
		default:
			break;
		}
	};
}

Reply via email to