GLX: Wait for MapNotify
This commit is contained in:
parent
a30ae7d0fb
commit
05bc72eeb3
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Reference in a new issue