~smspillaz/compiz-expo-plugin/oneiric.fix_963767

« back to all changes in this revision

Viewing changes to src/expo.cpp

  • Committer: Sam Spilsbury
  • Date: 2011-10-07 15:14:32 UTC
  • mfrom: (155.1.2 oneiric)
  • Revision ID: sam.spilsbury@canonical.com-20111007151432-32t0a8mkxb08pk6j
MergeĀ lp:~compiz-team/compiz-expo-plugin/oneiric.fix_868121

Show diffs side-by-side

added added

removed removed

Lines of Context:
444
444
    screen->handleEventSetEnabled (this, enable);
445
445
    cScreen->preparePaintSetEnabled (this, enable);
446
446
    cScreen->paintSetEnabled (this, enable);
447
 
    cScreen->getWindowPaintListSetEnabled (this, false);
448
447
    cScreen->donePaintSetEnabled (this, enable);
449
448
    gScreen->glPaintOutputSetEnabled (this, enable);
450
449
    gScreen->glPaintTransformedOutputSetEnabled (this, enable);
784
783
                               DEFAULT_Z_CAMERA - curveDistance);
785
784
    }
786
785
 
787
 
    cScreen->getWindowPaintListSetEnabled (this, paintingDndWindow);
 
786
    if (paintingDndWindow)
 
787
        cScreen->getWindowPaintListSetEnabled (this, true);
788
788
    gScreen->glPaintTransformedOutput (attrib, sTransform3,
789
789
                                       screen->region (), output,
790
790
                                       mask);
791
791
 
792
 
    cScreen->getWindowPaintListSetEnabled (this, !paintingDndWindow);
 
792
    if (paintingDndWindow)
 
793
        cScreen->getWindowPaintListSetEnabled (this, false);
793
794
 
794
795
    if (!reflection && !paintingDndWindow)
795
796
    {
821
822
    invertTransformedVertex (attrib, sTransform3, output, br);
822
823
 
823
824
    viewport_size = CompSize (br[0] - tl[0], br[1] - tl[1]);
 
825
 
 
826
    cScreen->setWindowPaintOffset (0, 0);
824
827
}
825
828
 
826
829
void
1105
1108
 
1106
1109
    expoActive = false;
1107
1110
 
1108
 
    cScreen->setWindowPaintOffset (0, 0);
1109
 
 
1110
1111
    gScreen->glPaintTransformedOutputSetCurrentIndex (glPaintTransformedOutputIndex);
1111
1112
    gScreen->setTextureFilter (oldFilter);
1112
1113
}
1437
1438
{
1438
1439
    GLMatrix            wTransform (transform);
1439
1440
    GLWindowPaintAttrib wAttrib (attrib);
1440
 
    CompPoint           vp;
1441
1441
    CompRegion          clip (region);
1442
1442
 
1443
 
    screen->viewportForGeometry (window->geometry (), vp);
1444
 
 
1445
1443
    if (eScreen->expoActive)
1446
1444
    {
1447
 
        float opacity = 1.0;
1448
 
        bool  hide;
1449
 
        bool  zoomAnim;
 
1445
        float     opacity = 1.0;
 
1446
        bool      hide;
 
1447
        bool      zoomAnim;
 
1448
        CompPoint vp;
 
1449
        screen->viewportForGeometry (window->geometry (), vp);
1450
1450
 
1451
1451
        zoomAnim = eScreen->optionGetExpoAnimation () ==
1452
1452
                   ExpoScreen::ExpoAnimationZoom;
1477
1477
            mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
1478
1478
        else
1479
1479
            wAttrib.opacity = wAttrib.opacity * opacity;
1480
 
    }
1481
 
 
1482
 
    /* Stretch maximized windows a little so that you don't
1483
 
     * have an awkward gap */
1484
 
 
1485
 
    if (window->state () & MAXIMIZE_STATE)
1486
 
    {
1487
 
        CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
1488
 
        float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
1489
 
        wTransform.translate (window->x () + window->width () / 2,
1490
 
                              window->y () + window->height (),
1491
 
                              0.0f);
1492
 
        wTransform.scale (1.0f, yS, 1.0f);
1493
 
        wTransform.translate (-(window->x () + window->width () / 2),
1494
 
                              -(window->y () + window->height ()),
1495
 
                              0.0f);
1496
 
 
1497
 
        if (eScreen->paintingVp != vp)
1498
 
            mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
1499
 
 
1500
 
        mask |= PAINT_WINDOW_TRANSFORMED_MASK;
1501
 
    }
 
1480
 
 
1481
        /* Stretch maximized windows a little so that you don't
 
1482
         * have an awkward gap */
 
1483
 
 
1484
        if (window->state () & MAXIMIZE_STATE &&
 
1485
                !window->border ().top)
 
1486
        {
 
1487
            CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
 
1488
            float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
 
1489
            wTransform.translate (window->x () + window->width () / 2,
 
1490
                                  window->y () + window->height (),
 
1491
                                  0.0f);
 
1492
            wTransform.scale (1.0f, yS, 1.0f);
 
1493
            wTransform.translate (-(window->x () + window->width () / 2),
 
1494
                                  -(window->y () + window->height ()),
 
1495
                                  0.0f);
 
1496
 
 
1497
            if (eScreen->paintingVp != vp)
 
1498
                mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
 
1499
 
 
1500
            mask |= PAINT_WINDOW_TRANSFORMED_MASK;
 
1501
        }
1502
1502
        
1503
 
    if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
1504
 
    {
1505
 
        if (!eScreen->paintingDndWindow)
1506
 
        {
1507
 
            mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
1508
 
        }
1509
 
        else
1510
 
        {
1511
 
            mask |= PAINT_WINDOW_TRANSFORMED_MASK;
1512
 
            clip = infiniteRegion;
 
1503
        if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
 
1504
        {
 
1505
            if (!eScreen->paintingDndWindow)
 
1506
            {
 
1507
                mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
 
1508
            }
 
1509
            else
 
1510
            {
 
1511
                mask |= PAINT_WINDOW_TRANSFORMED_MASK;
 
1512
                clip = infiniteRegion;
 
1513
            }
1513
1514
        }
1514
1515
    }
1515
1516