Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 295511
Collapse All | Expand All

(-)a/kwin/effects/magiclamp/magiclamp.cpp (+5 lines)
Lines 301-306 void MagicLampEffect::postPaintScreen() Link Here
301
    effects->postPaintScreen();
301
    effects->postPaintScreen();
302
    }
302
    }
303
303
304
void MagicLampEffect::windowDeleted( EffectWindow* w )
305
{
306
    mTimeLineWindows.remove( w );
307
}
308
304
void MagicLampEffect::windowMinimized( EffectWindow* w )
309
void MagicLampEffect::windowMinimized( EffectWindow* w )
305
    {
310
    {
306
    mTimeLineWindows[w].setCurveShape(TimeLine::LinearCurve);
311
    mTimeLineWindows[w].setCurveShape(TimeLine::LinearCurve);
(-)a/kwin/effects/magiclamp/magiclamp.h (+1 lines)
Lines 38-43 class MagicLampEffect Link Here
38
        virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
38
        virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
39
        virtual void postPaintScreen();
39
        virtual void postPaintScreen();
40
40
41
        virtual void windowDeleted( EffectWindow* c );
41
        virtual void windowMinimized( EffectWindow* c );
42
        virtual void windowMinimized( EffectWindow* c );
42
        virtual void windowUnminimized( EffectWindow* c );
43
        virtual void windowUnminimized( EffectWindow* c );
43
44
(-)a/kwin/effects/minimizeanimation/minimizeanimation.cpp (-29 / +42 lines)
Lines 39-72 void MinimizeAnimationEffect::prePaintScreen( ScreenPrePaintData& data, int time Link Here
39
        //  whole screen won't be repainted, resulting in artefacts
39
        //  whole screen won't be repainted, resulting in artefacts
40
        data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS;
40
        data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS;
41
41
42
    effects->prePaintScreen(data, time);
42
    QHash< EffectWindow*, TimeLine >::iterator entry = mTimeLineWindows.begin();
43
    }
43
    bool erase = false;
44
44
    while( entry != mTimeLineWindows.end() )
45
void MinimizeAnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
46
    {
47
    if( mTimeLineWindows.contains( w ))
48
        {
45
        {
49
        if( w->isMinimized() )
46
        TimeLine &timeline = entry.value();
47
        if( entry.key()->isMinimized() )
50
            {
48
            {
51
            mTimeLineWindows[w].addTime(time);
49
            timeline.addTime(time);
52
            if( mTimeLineWindows[w].progress() >= 1.0f )
50
            erase = (timeline.progress() >= 1.0f);
53
                mTimeLineWindows.remove( w );
54
            }
51
            }
55
        else
52
        else
56
            {
53
            {
57
            mTimeLineWindows[w].removeTime(time);
54
            timeline.removeTime(time);
58
            if( mTimeLineWindows[w].progress() <= 0.0f )
55
            erase = (timeline.progress() <= 0.0f);
59
                mTimeLineWindows.remove( w );
60
            }
56
            }
57
        if( erase )
58
            entry = mTimeLineWindows.erase( entry );
59
        else
60
            ++entry;
61
        }
61
62
62
        // Schedule window for transformation if the animation is still in
63
    effects->prePaintScreen(data, time);
63
        //  progress
64
    }
64
        if( mTimeLineWindows.contains( w ))
65
65
            {
66
void MinimizeAnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
66
            // We'll transform this window
67
    {
67
            data.setTransformed();
68
    // Schedule window for transformation if the animation is still in
68
            w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE );
69
    //  progress
69
            }
70
    if( mTimeLineWindows.contains( w ) )
71
        {
72
        // We'll transform this window
73
        data.setTransformed();
74
        w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE );
70
        }
75
        }
71
76
72
    effects->prePaintWindow( w, data, time );
77
    effects->prePaintWindow( w, data, time );
Lines 74-83 void MinimizeAnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintDat Link Here
74
79
75
void MinimizeAnimationEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
80
void MinimizeAnimationEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
76
    {
81
    {
77
    if( mTimeLineWindows.contains( w ))
82
    QHash< EffectWindow*, TimeLine >::const_iterator entry = mTimeLineWindows.find(w);
83
    if( entry != mTimeLineWindows.constEnd() )
78
    {
84
    {
79
        // 0 = not minimized, 1 = fully minimized
85
        // 0 = not minimized, 1 = fully minimized
80
        double progress = mTimeLineWindows[w].value();
86
        double progress = entry->value();
81
87
82
        QRect geo = w->geometry();
88
        QRect geo = w->geometry();
83
        QRect icon = w->iconGeometry();
89
        QRect icon = w->iconGeometry();
Lines 107-124 void MinimizeAnimationEffect::postPaintScreen() Link Here
107
    effects->postPaintScreen();
113
    effects->postPaintScreen();
108
    }
114
    }
109
115
116
void MinimizeAnimationEffect::windowDeleted( EffectWindow* w )
117
    {
118
        mTimeLineWindows.remove( w );
119
    }
120
110
void MinimizeAnimationEffect::windowMinimized( EffectWindow* w )
121
void MinimizeAnimationEffect::windowMinimized( EffectWindow* w )
111
    {
122
    {
112
    mTimeLineWindows[w].setCurveShape(TimeLine::EaseInCurve);
123
    TimeLine &timeline = mTimeLineWindows[w];
113
    mTimeLineWindows[w].setDuration( animationTime( 250 ));
124
    timeline.setCurveShape(TimeLine::EaseInCurve);
114
    mTimeLineWindows[w].setProgress(0.0f);
125
    timeline.setDuration( animationTime( 250 ));
126
    timeline.setProgress(0.0f);
115
    }
127
    }
116
128
117
void MinimizeAnimationEffect::windowUnminimized( EffectWindow* w )
129
void MinimizeAnimationEffect::windowUnminimized( EffectWindow* w )
118
    {
130
    {
119
    mTimeLineWindows[w].setCurveShape(TimeLine::EaseOutCurve);
131
    TimeLine &timeline = mTimeLineWindows[w];
120
    mTimeLineWindows[w].setDuration( animationTime( 250 ));
132
    timeline.setCurveShape(TimeLine::EaseOutCurve);
121
    mTimeLineWindows[w].setProgress(1.0f);
133
    timeline.setDuration( animationTime( 250 ));
134
    timeline.setProgress(1.0f);
122
    }
135
    }
123
136
124
} // namespace
137
} // namespace
(-)a/kwin/effects/minimizeanimation/minimizeanimation.h (+1 lines)
Lines 42-47 class MinimizeAnimationEffect Link Here
42
        virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
42
        virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
43
        virtual void postPaintScreen();
43
        virtual void postPaintScreen();
44
44
45
        virtual void windowDeleted( EffectWindow* c );
45
        virtual void windowMinimized( EffectWindow* c );
46
        virtual void windowMinimized( EffectWindow* c );
46
        virtual void windowUnminimized( EffectWindow* c );
47
        virtual void windowUnminimized( EffectWindow* c );
47
48

Return to bug 295511