GLX: Wait for MapNotify

This commit is contained in:
Matthias Schiffer 2010-01-07 16:25:42 +01:00
parent a30ae7d0fb
commit 05bc72eeb3

View file

@ -233,6 +233,10 @@ bool XIInit(Display *disp, int *opcode) {
return true;
}
static Bool WaitForMapNotify(Display*, XEvent *event, XPointer arg) {
return (event->type == MapNotify && event->xmap.window == (Window)arg);
}
bool GLXinit(Display *disp, Atom windele, Window *wnd, GLXContext *gc, int *xi_opcode, int *pointer) {
static const int msAttributeList[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
@ -305,7 +309,9 @@ bool GLXinit(Display *disp, Atom windele, Window *wnd, GLXContext *gc, int *xi_o
XFreePixmap(disp, pixmap);
XMapWindow(disp, *wnd);
XSync(disp, False);
XEvent event;
XIfEvent(disp, &event, WaitForMapNotify, (XPointer)*wnd);
XIGetClientPointer(disp, *wnd, pointer);