~compiz-team/compiz/windowtiles

« back to all changes in this revision

Viewing changes to src/tiles.cpp

  • Committer: Sam Spilsbury
  • Date: 2012-12-02 07:39:28 UTC
  • Revision ID: sam.spilsbury@canonical.com-20121202073928-0pws1t3r5izu1dqo
Track window unmaximize, untrack the window if so, and keep tracking it if
we're grabbed while unmaximizing

Show diffs side-by-side

added added

removed removed

Lines of Context:
380
380
{
381
381
    priv->window->grabNotify (x, y, state, mask);
382
382
 
 
383
    priv->mGrabMask = mask;
 
384
    priv->mGrabGeometry = priv->window->serverBorderRect ();
 
385
 
383
386
    if (mask & (CompWindowGrabMoveMask))
384
387
    {
385
388
        TileInterface::Ptr tp (priv->mTile);
410
413
        TilesScreen::get (screen)->addResizingWindow (this);
411
414
        priv->gWindow->glPaintSetEnabled (this, false);
412
415
    }
413
 
    else
414
 
        return;
415
 
 
416
 
    priv->mGrabMask = mask;
417
 
    priv->mGrabGeometry = priv->window->serverBorderRect ();
418
416
}
419
417
 
420
418
void
457
455
    if (lostState)
458
456
        TilesScreen::get (screen)->handleStateLoss (this, lostState);
459
457
 
 
458
    /* re-track this window */
 
459
    if (!priv->mGrabTracker &&
 
460
        priv->mGrabMask & CompWindowGrabMoveMask)
 
461
    {
 
462
        priv->mGrabTracker =
 
463
            priv->mGrabTrackerFinder->findTracker (this,
 
464
                                                   CompPoint (pointerX,
 
465
                                                              pointerY));
 
466
 
 
467
        if (priv->mGrabTracker)
 
468
        {
 
469
            if (!priv->mGrabTracker->addGrabbedWindow (this,
 
470
                                                       this,
 
471
                                                       this,
 
472
                                                       this,
 
473
                                                       this,
 
474
                                                       boost::bind (&WindowMonitorInterface::monitorWorkArea, this),
 
475
                                                       CompPoint (pointerX, pointerY)))
 
476
                priv->mGrabTracker = NULL;
 
477
            }
 
478
            else
 
479
            {
 
480
                if (!priv->mTile)
 
481
                    priv->window->moveNotifySetEnabled (this, true);
 
482
            }
 
483
        }
 
484
    }
 
485
 
460
486
    priv->window->stateChangeNotify (lastState);
461
487
}
462
488
 
903
929
void
904
930
TilesScreen::removeGrabbedWindow (DropCommitInterface *tw)
905
931
{
906
 
    auto it = std::find_if (priv->mDraggedWindows.begin (), priv->mDraggedWindows.end (), boost::bind (dropCommitInterfaceInDraggedWindowInfo, _1, tw));
 
932
    auto it = std::find_if (priv->mDraggedWindows.begin (),
 
933
                            priv->mDraggedWindows.end (),
 
934
                            boost::bind (dropCommitInterfaceInDraggedWindowInfo, _1, tw));
907
935
 
908
936
    if (it != priv->mDraggedWindows.end ())
909
937
    {