623
GRID_WINDOW (screen->findWindow
624
(CompOption::getIntOptionNamed (o, "window")));
626
if ((gw->pointerBufDx > SNAPOFF_THRESHOLD ||
627
gw->pointerBufDy > SNAPOFF_THRESHOLD ||
628
gw->pointerBufDx < -SNAPOFF_THRESHOLD ||
629
gw->pointerBufDy < -SNAPOFF_THRESHOLD) &&
631
optionGetSnapbackWindows ())
632
restoreWindow (0, 0, o);
645
w = screen->findWindow (CompOption::getIntOptionNamed (o, "window"));
651
if ((gw->pointerBufDx > SNAPOFF_THRESHOLD ||
652
gw->pointerBufDy > SNAPOFF_THRESHOLD ||
653
gw->pointerBufDx < -SNAPOFF_THRESHOLD ||
654
gw->pointerBufDy < -SNAPOFF_THRESHOLD) &&
656
optionGetSnapbackWindows ())
657
restoreWindow (0, 0, o);
668
693
if (window == gScreen->mGrabWindow)
670
695
gScreen->initiateCommon
671
(0, 0, gScreen->o, gScreen->edgeToGridType (), true);
696
(0, 0, gScreen->o, gScreen->edgeToGridType (), true,
697
gScreen->edge != gScreen->lastResizeEdge);
673
699
screen->handleEventSetEnabled (gScreen, false);
674
700
gScreen->mGrabWindow = NULL;
701
gScreen->o[0].value ().set (0);
675
702
gScreen->cScreen->damageRegion (gScreen->desiredSlot);
705
gScreen->lastResizeEdge = gScreen->edge;
678
706
gScreen->edge = NoEdge;
680
708
window->ungrabNotify ();
686
714
window->moveNotify (dx, dy, immediate);
716
if (isGridResized && !isGridMaximized && !GridScreen::get (screen)->mSwitchingVp)
718
if (window->grabbed ())
724
/* Do not allow the window to be moved while it
726
dx = currentSize.x () - window->geometry ().x ();
727
dy = currentSize.y () - window->geometry ().y ();
729
window->move (dx, dy);
734
GridWindow::stateChangeNotify (unsigned int lastState)
736
if (lastState & MAXIMIZE_STATE &&
737
!(window->state () & MAXIMIZE_STATE))
738
lastTarget = GridUnknown;
739
else if (!(lastState & MAXIMIZE_STATE) &&
740
window->state () & MAXIMIZE_STATE)
741
lastTarget = GridMaximize;
743
window->stateChangeNotify (lastState);
693
747
GridScreen::restoreWindow (CompAction *action,
694
748
CompAction::State state,
826
882
glScreen (GLScreen::get (screen)),
827
883
centerCheck (false),
828
884
mGrabWindow (NULL),
888
o.push_back (CompOption ("window", CompOption::TypeInt));
832
890
ScreenInterface::setHandler (screen, false);
891
screen->handleCompizEventSetEnabled (this, true);
833
892
CompositeScreenInterface::setHandler (cScreen, false);
834
893
GLScreenInterface::setHandler (glScreen, false);
836
edge = lastEdge = NoEdge;
895
edge = lastEdge = lastResizeEdge = NoEdge;
837
896
currentWorkarea = lastWorkarea = screen->getWorkareaForOutput
838
897
(screen->outputDeviceForPoint (pointerX, pointerY));
840
899
animations.clear ();
842
#define GRIDSET(opt,where,resize) \
901
#define GRIDSET(opt,where,resize,key) \
843
902
optionSet##opt##Initiate (boost::bind (&GridScreen::initiateCommon, this, \
844
_1, _2, _3, where, resize))
903
_1, _2, _3, where, resize, key))
846
GRIDSET (PutCenterKey, GridCenter, true);
847
GRIDSET (PutLeftKey, GridLeft, true);
848
GRIDSET (PutRightKey, GridRight, true);
849
GRIDSET (PutTopKey, GridTop, true);
850
GRIDSET (PutBottomKey, GridBottom, true);
851
GRIDSET (PutTopleftKey, GridTopLeft, true);
852
GRIDSET (PutToprightKey, GridTopRight, true);
853
GRIDSET (PutBottomleftKey, GridBottomLeft, true);
854
GRIDSET (PutBottomrightKey, GridBottomRight, true);
855
GRIDSET (PutMaximizeKey, GridMaximize, true);
905
GRIDSET (PutCenterKey, GridCenter, true, true);
906
GRIDSET (PutLeftKey, GridLeft, true, true);
907
GRIDSET (PutRightKey, GridRight, true, true);
908
GRIDSET (PutTopKey, GridTop, true, true);
909
GRIDSET (PutBottomKey, GridBottom, true, true);
910
GRIDSET (PutTopleftKey, GridTopLeft, true, true);
911
GRIDSET (PutToprightKey, GridTopRight, true, true);
912
GRIDSET (PutBottomleftKey, GridBottomLeft, true, true);
913
GRIDSET (PutBottomrightKey, GridBottomRight, true, true);
914
GRIDSET (PutMaximizeKey, GridMaximize, true, true);