606
606
if (screen->otherGrabExist ("rotate", "move", "group-drag", NULL))
609
warpX = pointerX - (screen->width () * direction);
609
warpX = CompGlobal::instance ().pointerX () - (screen->width () * direction);
610
610
if (direction == -1)
611
611
screen->warpPointer (screen->width () - 10, 0);
613
613
screen->warpPointer (10 - screen->width (), 0);
614
lastPointerX = warpX;
614
CompGlobal::instance ().setLastPointerX (warpX);
616
616
o.push_back (CompOption ("root", CompOption::TypeInt));
617
617
o.push_back (CompOption ("x", CompOption::TypeInt));
620
620
o[0].value ().set ((int) screen->root ());
621
621
o[1].value ().set (0);
622
o[2].value ().set (pointerY);
622
o[2].value ().set (CompGlobal::instance ().pointerY ());
624
624
rotate (NULL, 0, o, direction);
626
626
XWarpPointer (screen->dpy (), None, None, 0, 0, 0, 0, direction, 0);
627
mSavedPointer.setX (lastPointerX + (9 * direction));
627
mSavedPointer.setX (CompGlobal::instance ().lastPointerX () + (9 * direction));
691
691
if (optionGetFlipTime () == 0 || (mMoving && !mSlow))
693
int pointerDx = pointerX - lastPointerX;
693
int pointerDx = CompGlobal::instance ().pointerX () - CompGlobal::instance ().lastPointerX ();
696
696
if (direction == -1)
698
warpX = pointerX + screen->width ();
698
warpX = CompGlobal::instance ().pointerX () + screen->width ();
699
699
screen->warpPointer (screen->width () - 10, 0);
700
lastPointerX = warpX - pointerDx;
700
CompGlobal::instance ().setLastPointerX (warpX - pointerDx);
701
701
rotate (NULL, 0, o, direction);
703
703
XWarpPointer (screen->dpy (), None, None, 0, 0, 0, 0, -1, 0);
704
mSavedPointer.setX (lastPointerX - 9);
704
mSavedPointer.setX (CompGlobal::instance ().lastPointerX () - 9);
708
warpX = pointerX - screen->width ();
708
warpX = CompGlobal::instance ().pointerX () - screen->width ();
709
709
screen->warpPointer (10 - screen->width (), 0);
710
lastPointerX = warpX - pointerDx;
710
CompGlobal::instance ().setLastPointerX (warpX - pointerDx);
711
711
rotate (NULL, 0, o, direction);
713
713
XWarpPointer (screen->dpy (), None, None, 0, 0, 0, 0, 1, 0);
714
mSavedPointer.setX (lastPointerX + 9);
714
mSavedPointer.setX (CompGlobal::instance ().lastPointerX () + 9);
807
807
o.push_back (CompOption ("y", CompOption::TypeInt));
809
809
o[0].value ().set ((int) screen->root ());
810
o[1].value ().set (CompOption::getIntOptionNamed (options, "x", pointerX));
811
o[2].value ().set (CompOption::getIntOptionNamed (options, "y", pointerY));
810
o[1].value ().set (CompOption::getIntOptionNamed (options, "x", CompGlobal::instance ().pointerX ()));
811
o[2].value ().set (CompOption::getIntOptionNamed (options, "y", CompGlobal::instance ().pointerY ()));
836
836
GLfloat pointerDx, pointerDy;
838
pointerDx = pointerX - lastPointerX;
839
pointerDy = pointerY - lastPointerY;
838
pointerDx = CompGlobal::instance ().pointerX () - CompGlobal::instance ().lastPointerX ();
839
pointerDy = CompGlobal::instance ().pointerY () - CompGlobal::instance ().lastPointerY ();
841
841
if (event->xmotion.x_root < 50 ||
842
842
event->xmotion.y_root < 50 ||
843
843
event->xmotion.x_root > screen->width () - 50 ||
844
844
event->xmotion.y_root > screen->height () - 50)
846
screen->warpPointer ((screen->width () / 2) - pointerX,
847
(screen->height () / 2) - pointerY);
846
screen->warpPointer ((screen->width () / 2) - CompGlobal::instance ().pointerX (),
847
(screen->height () / 2) - CompGlobal::instance ().pointerY ());
850
850
if (optionGetInvertY ())
861
mSavedPointer.setX (mSavedPointer.x () + pointerX - lastPointerX);
862
mSavedPointer.setY (mSavedPointer.y () + pointerY - lastPointerY);
861
mSavedPointer.setX (mSavedPointer.x () + CompGlobal::instance ().pointerX () - CompGlobal::instance ().lastPointerX ());
862
mSavedPointer.setY (mSavedPointer.y () + CompGlobal::instance ().pointerY () - CompGlobal::instance ().lastPointerY ());