diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-01-07 16:25:42 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-01-07 16:25:42 +0100 |
commit | 05bc72eeb33ea42012da2eba26dcaedfafb2f3a2 (patch) | |
tree | d3198217c681b3c915b20eb3cdea75b534078b9e /src | |
parent | a30ae7d0fb13b9a00a17e621463c186fb6ac5ada (diff) | |
download | zoom++-05bc72eeb33ea42012da2eba26dcaedfafb2f3a2.tar zoom++-05bc72eeb33ea42012da2eba26dcaedfafb2f3a2.zip |
GLX: Wait for MapNotify
Diffstat (limited to 'src')
-rw-r--r-- | src/zoom.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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); |