From 05bc72eeb33ea42012da2eba26dcaedfafb2f3a2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 7 Jan 2010 16:25:42 +0100 Subject: GLX: Wait for MapNotify --- src/zoom.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/zoom.cpp b/src/zoom.cpp index aa085bf..84c303c 100644 --- a/src/zoom.cpp +++ b/src/zoom.cpp @@ -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); -- cgit v1.2.3