summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zoom.cpp8
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);