bool RotateScreen::rotateWithWindow (CompAction *action, CompAction::State state, CompOption::Vector &options, int direction) { if (screen->vpSize ().width () < 2 || !direction) return false; Window xid = CompOption::getIntOptionNamed (options, "window"); if (mMoveWindow != xid) { releaseMoveWindow (); if (!mGrabIndex && !mMoving) { CompWindow *w = screen->findWindow (xid); if (w && !(w->type () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)) && !(w->state () & CompWindowStateStickyMask)) { mMoveWindow = w->id (); mMoveWindowX = w->x (); if (optionGetRaiseOnRotate ()) w->raise (); } } } if (!mGrabIndex) { CompOption::Vector o (0); o.push_back (CompOption ("root", CompOption::TypeInt)); o.push_back (CompOption ("x", CompOption::TypeInt)); o.push_back (CompOption ("y", CompOption::TypeInt)); o[0].value ().set ((int) screen->root ()); o[1].value ().set (CompOption::getIntOptionNamed (options, "x", 0)); o[2].value ().set (CompOption::getIntOptionNamed (options, "y", 0)); initiate (NULL, 0, o); } if (mGrabIndex) { mMoving = true; mMoveTo += 360.0f / screen->vpSize ().width () * direction; mGrabbed = false; cScreen->damageScreen (); } return false; }
bool WallScreen::moveViewport (int x, int y, Window moveWin) { CompOption::Vector o(0); if (!x && !y) return false; if (screen->otherGrabExist ("move", "switcher", "group-drag", "wall", 0)) return false; if (!checkDestination (x, y)) return false; if (moveWindow != moveWin) { CompWindow *w; releaseMoveWindow (); w = screen->findWindow (moveWin); if (w) { if (!(w->type () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask))) { if (!(w->state () & CompWindowStateStickyMask)) { moveWindow = w->id (); moveWindowX = w->x (); moveWindowY = w->y (); w->raise (); } } } } if (!moving) { curPosX = screen->vp ().x (); curPosY = screen->vp ().y (); } gotoX = screen->vp ().x () - x; gotoY = screen->vp ().y () - y; determineMovementAngle (); screen->handleCompizEvent ("wall", "start_viewport_switch", o); if (!grabIndex) grabIndex = screen->pushGrab (screen->invisibleCursor (), "wall"); screen->moveViewport (x, y, true); moving = true; focusDefault = true; boxOutputDevice = screen->outputDeviceForPoint (pointerX, pointerY); if (optionGetShowSwitcher ()) boxTimeout = optionGetPreviewTimeout () * 1000; else boxTimeout = 0; timer = optionGetSlideDuration () * 1000; cScreen->damageScreen (); return true; }