static void getmove( /* get view change */ XButtonPressedEvent *ebut ) { int movdir = MOVDIR(ebut->button); int movorb = MOVORB(ebut->state); int oldnodesiz = qtMinNodesiz; Window rootw, childw; int rootx, rooty, wx, wy; unsigned int statemask; qtMinNodesiz = 24; /* accelerate update rate */ XNoOp(ourdisplay); while (!XCheckMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent))) { if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, &rootx, &rooty, &wx, &wy, &statemask)) break; /* on another screen */ if (!moveview(wx, odev.vres-1-wy, movdir, movorb)) { sleep(1); continue; } glClear(GL_COLOR_BUFFER_BIT); qtUpdate(); draw_grids(); glFlush(); } if (!(inpresflags & DFL(DC_SETVIEW))) { /* do final motion */ movdir = MOVDIR(levptr(XButtonReleasedEvent)->button); wx = levptr(XButtonReleasedEvent)->x; wy = levptr(XButtonReleasedEvent)->y; moveview(wx, odev.vres-1-wy, movdir, movorb); } dev_flush(); qtMinNodesiz = oldnodesiz; /* restore quadtree resolution */ }
static void getmove( /* get view change */ XButtonPressedEvent *ebut ) { int movdir = MOVDIR(ebut->button); int movorb = MOVORB(ebut->state); int moved = 0; Window rootw, childw; int rootx, rooty, wx, wy; unsigned int statemask; copylastv( movorb ? (movdir ? "left/right" : "up/down") : (movdir ? "fore/back" : "rotate") ); XNoOp(ourdisplay); while (!XCheckMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent))) { /* pause so as not to move too fast */ waitabit(); if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, &rootx, &rooty, &wx, &wy, &statemask)) break; /* on another screen */ if (!moveview(wx, vres-1-wy, movdir, movorb)) { sleep(1); continue; } else moved++; } if (!moved) { /* do final motion */ movdir = MOVDIR(levptr(XButtonReleasedEvent)->button); wx = levptr(XButtonReleasedEvent)->x; wy = levptr(XButtonReleasedEvent)->y; moveview(wx, vres-1-wy, movdir, movorb); } }