502
496
moveViewport (-dx, -dy, None);
504
if (event->xclient.message_type == Atoms::xdndEnter)
509
else if (event->xclient.message_type == Atoms::xdndLeave)
516
if (event->xfocus.mode == NotifyGrab)
518
else if (event->xfocus.mode == NotifyUngrab)
503
/* Edges on when grabbed */
504
if (!optionGetEdgeflipPointer ())
506
if (event->xfocus.mode == NotifyGrab)
508
else if (event->xfocus.mode == NotifyUngrab)
522
512
case ConfigureNotify:
524
if (event->xconfigure.window == screen->root ())
525
updateScreenEdgeRegions ();
534
* Borrowed this from PrivateScreen::updateScreenEdges
523
* When a dnd type window is mapped toggle edge flip dnd windows back on
524
* _NET_WM_WINDOW_TYPE_DND windows. This will not detect all dnd windows
525
* but it will detect the EWMH-compliant ones without resorting to
526
* hacks involving selection stealing.
538
#define SCREEN_EDGE_NUM 8
541
WallScreen::updateScreenEdgeRegions ()
543
edgeRegion = CompRegion (0, 0, screen->width (), screen->height ());
544
noEdgeRegion = CompRegion (0, 0, screen->width (), screen->height ());
546
struct screenEdgeGeometry {
551
} geometry[SCREEN_EDGE_NUM] = {
552
{ 0, 0, 0, 2, 0, 2, 1, -4 }, /* left */
553
{ 1, -2, 0, 2, 0, 2, 1, -4 }, /* right */
554
{ 0, 2, 0, 0, 1, -4, 0, 2 }, /* top */
555
{ 0, 2, 1, -2, 1, -4, 0, 2 }, /* bottom */
556
{ 0, 0, 0, 0, 0, 2, 0, 2 }, /* top-left */
557
{ 1, -2, 0, 0, 0, 2, 0, 2 }, /* top-right */
558
{ 0, 0, 1, -2, 0, 2, 0, 2 }, /* bottom-left */
559
{ 1, -2, 1, -2, 0, 2, 0, 2 } /* bottom-right */
562
for (unsigned int i = 0; i < SCREEN_EDGE_NUM; i++)
564
CompRegion edge (geometry[i].xw * screen->width () +
566
geometry[i].yh * screen->height () +
568
geometry[i].ww * screen->width () +
570
geometry[i].hh * screen->height () +
573
noEdgeRegion -= edgeRegion;
576
edgeRegion -= noEdgeRegion;
579
#undef SCREEN_EDGE_NUM
582
WallScreen::positionUpdate (const CompPoint &pos)
587
if (edgeRegion.contains (pos))
589
else if (noEdgeRegion.contains (pos))
591
if (!screen->grabbed ())
529
WallWindow::windowNotify (CompWindowNotify n)
531
WallScreen *ws = WallScreen::get (screen);
532
bool toggleOnDnd = ws->optionGetEdgeflipDnd ();
536
case CompWindowNotifyMap:
537
if (window->type () & CompWindowTypeDndMask && toggleOnDnd)
538
ws->toggleEdges (true);
540
case CompWindowNotifyUnmap:
541
if (window->type () & CompWindowTypeDndMask && toggleOnDnd)
542
ws->toggleEdges (false);
548
window->windowNotify (n);
655
609
WallWindow::grabNotify (int x,
660
WallScreen::get (screen)->toggleEdges (true);
661
WallScreen::get (screen)->edgeDrag = true;
614
if (mask & (CompWindowGrabMoveMask | CompWindowGrabButtonMask))
615
WallScreen::get (screen)->windowIsDragMoved = true;
663
window->grabNotify (x, y, width, height);
617
window->grabNotify (x, y, state, mask);
667
621
WallWindow::ungrabNotify ()
669
WallScreen::get (screen)->edgeDrag = false;
623
WallScreen::get (screen)->windowIsDragMoved = false;
671
625
window->ungrabNotify ();
810
764
WallScreen::initiateFlip (Direction direction,
811
765
CompAction::State state)
767
CompOption::Vector o (0);
814
770
int amountX, amountY;
816
if (screen->otherGrabExist ("wall", "move", "group-drag", 0))
819
if (state & CompAction::StateInitEdgeDnd)
821
if (!optionGetEdgeflipDnd ())
824
if (screen->otherGrabExist ("wall", 0))
827
else if (screen->grabExist ("move"))
829
if (!optionGetEdgeflipMove ())
832
else if (screen->grabExist ("group-drag"))
834
if (!optionGetEdgeflipDnd ())
837
else if (!optionGetEdgeflipPointer ())
772
const bool allowFlipDnd = (state & CompAction::StateInitEdgeDnd) &&
773
optionGetEdgeflipDnd ();
774
const bool allowFlipMove = (windowIsDragMoved &&
775
optionGetEdgeflipMove ());
776
const bool allowFlipPointer = optionGetEdgeflipPointer ();
1778
1725
WallPluginVTable::init ()
1780
if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1782
if (!CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI))
1784
if (!CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
1786
if (!CompPlugin::checkPluginABI ("mousepoll", COMPIZ_MOUSEPOLL_ABI))
1727
if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
1728
CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
1729
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))