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

(-)a/kwin-4.7.3/kwin/effects/boxswitch/boxswitch.cpp (+5 lines)
Lines 950-955 Link Here
950
    }
950
    }
951
}
951
}
952
952
953
bool BoxSwitchEffect::isActive() const
954
{
955
    return mActivated;
956
}
957
953
BoxSwitchEffect::ItemInfo::ItemInfo()
958
BoxSwitchEffect::ItemInfo::ItemInfo()
954
    : iconFrame(NULL)
959
    : iconFrame(NULL)
955
{
960
{
(-)a/kwin-4.7.3/kwin/effects/boxswitch/boxswitch.h (+1 lines)
Lines 55-60 Link Here
55
55
56
    virtual void windowInputMouseEvent(Window w, QEvent* e);
56
    virtual void windowInputMouseEvent(Window w, QEvent* e);
57
    virtual void* proxy();
57
    virtual void* proxy();
58
    virtual bool isActive() const;
58
    void activateFromProxy(int mode, bool animate, bool showText, float positioningFactor);
59
    void activateFromProxy(int mode, bool animate, bool showText, float positioningFactor);
59
    void paintWindowsBox(const QRegion& region);
60
    void paintWindowsBox(const QRegion& region);
60
61
(-)a/kwin-4.7.3/kwin/effects/coverswitch/coverswitch.cpp (+5 lines)
Lines 1000-1003 Link Here
1000
    }
1000
    }
1001
}
1001
}
1002
1002
1003
bool CoverSwitchEffect::isActive() const
1004
{
1005
    return mActivated || stop || stopRequested;
1006
}
1007
1003
} // namespace
1008
} // namespace
(-)a/kwin-4.7.3/kwin/effects/coverswitch/coverswitch.h (+1 lines)
Lines 48-53 Link Here
48
    virtual void postPaintScreen();
48
    virtual void postPaintScreen();
49
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
49
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
50
    virtual void windowInputMouseEvent(Window w, QEvent* e);
50
    virtual void windowInputMouseEvent(Window w, QEvent* e);
51
    virtual bool isActive() const;
51
52
52
    static bool supported();
53
    static bool supported();
53
54
(-)a/kwin-4.7.3/kwin/effects/cube/cube.cpp (+5 lines)
Lines 2064-2067 Link Here
2064
    m_cubeInsideEffects.removeAll(effect);
2064
    m_cubeInsideEffects.removeAll(effect);
2065
}
2065
}
2066
2066
2067
bool CubeEffect::isActive() const
2068
{
2069
    return activated;
2070
}
2071
2067
} // namespace
2072
} // namespace
(-)a/kwin-4.7.3/kwin/effects/cube/cube.h (+1 lines)
Lines 50-55 Link Here
50
    virtual bool borderActivated(ElectricBorder border);
50
    virtual bool borderActivated(ElectricBorder border);
51
    virtual void grabbedKeyboardEvent(QKeyEvent* e);
51
    virtual void grabbedKeyboardEvent(QKeyEvent* e);
52
    virtual void windowInputMouseEvent(Window w, QEvent* e);
52
    virtual void windowInputMouseEvent(Window w, QEvent* e);
53
    virtual bool isActive() const;
53
54
54
    // proxy functions
55
    // proxy functions
55
    virtual void* proxy();
56
    virtual void* proxy();
(-)a/kwin-4.7.3/kwin/effects/cube/cubeslide.cpp (+5 lines)
Lines 617-620 Link Here
617
    effects->addRepaintFull();
617
    effects->addRepaintFull();
618
}
618
}
619
619
620
bool CubeSlideEffect::isActive() const
621
{
622
    return !slideRotations.isEmpty();
623
}
624
620
} // namespace
625
} // namespace
(-)a/kwin-4.7.3/kwin/effects/cube/cubeslide.h (+1 lines)
Lines 42-47 Link Here
42
    virtual void postPaintScreen();
42
    virtual void postPaintScreen();
43
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
43
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
44
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
44
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
45
    virtual bool isActive() const;
45
46
46
    static bool supported();
47
    static bool supported();
47
48
(-)a/kwin-4.7.3/kwin/effects/dashboard/dashboard.cpp (+5 lines)
Lines 199-202 Link Here
199
    }
199
    }
200
}
200
}
201
201
202
bool DashboardEffect::isActive() const
203
{
204
    return transformWindow;
205
}
206
202
} // namespace
207
} // namespace
(-)a/kwin-4.7.3/kwin/effects/dashboard/dashboard.h (+1 lines)
Lines 43-48 Link Here
43
    virtual void propagate();
43
    virtual void propagate();
44
    virtual void reconfigure(ReconfigureFlags);
44
    virtual void reconfigure(ReconfigureFlags);
45
    virtual void unpropagate();
45
    virtual void unpropagate();
46
    virtual bool isActive() const;
46
47
47
public Q_SLOTS:
48
public Q_SLOTS:
48
    void slotWindowAdded(EffectWindow* c);
49
    void slotWindowAdded(EffectWindow* c);
(-)a/kwin-4.7.3/kwin/effects/desktopgrid/desktopgrid.cpp (-2 / +7 lines)
Lines 1223-1232 Link Here
1223
    shortcut = KShortcut(seq);
1223
    shortcut = KShortcut(seq);
1224
}
1224
}
1225
1225
1226
bool DesktopGridEffect::isMotionManagerMovingWindows()
1226
bool DesktopGridEffect::isMotionManagerMovingWindows() const
1227
{
1227
{
1228
    if (isUsingPresentWindows()) {
1228
    if (isUsingPresentWindows()) {
1229
        QList<WindowMotionManager>::iterator it;
1229
        QList<WindowMotionManager>::const_iterator it;
1230
        for (it = m_managers.begin(); it != m_managers.end(); ++it) {
1230
        for (it = m_managers.begin(); it != m_managers.end(); ++it) {
1231
            if ((*it).areWindowsMoving())
1231
            if ((*it).areWindowsMoving())
1232
                return true;
1232
                return true;
Lines 1374-1379 Link Here
1374
    effects->addRepaintFull();
1374
    effects->addRepaintFull();
1375
}
1375
}
1376
1376
1377
bool DesktopGridEffect::isActive() const
1378
{
1379
    return timeline.currentValue() != 0 || (isUsingPresentWindows() && isMotionManagerMovingWindows());
1380
}
1381
1377
/************************************************
1382
/************************************************
1378
* DesktopButtonView
1383
* DesktopButtonView
1379
************************************************/
1384
************************************************/
(-)a/kwin-4.7.3/kwin/effects/desktopgrid/desktopgrid.h (-1 / +2 lines)
Lines 75-80 Link Here
75
    virtual void windowInputMouseEvent(Window w, QEvent* e);
75
    virtual void windowInputMouseEvent(Window w, QEvent* e);
76
    virtual void grabbedKeyboardEvent(QKeyEvent* e);
76
    virtual void grabbedKeyboardEvent(QKeyEvent* e);
77
    virtual bool borderActivated(ElectricBorder border);
77
    virtual bool borderActivated(ElectricBorder border);
78
    virtual bool isActive() const;
78
79
79
    enum { LayoutPager, LayoutAutomatic, LayoutCustom }; // Layout modes
80
    enum { LayoutPager, LayoutAutomatic, LayoutCustom }; // Layout modes
80
81
Lines 106-112 Link Here
106
    void setup();
107
    void setup();
107
    void setupGrid();
108
    void setupGrid();
108
    void finish();
109
    void finish();
109
    bool isMotionManagerMovingWindows();
110
    bool isMotionManagerMovingWindows() const;
110
    bool isUsingPresentWindows() const;
111
    bool isUsingPresentWindows() const;
111
    QRectF moveGeometryToDesktop(int desktop) const;
112
    QRectF moveGeometryToDesktop(int desktop) const;
112
    void desktopsAdded(int old);
113
    void desktopsAdded(int old);
(-)a/kwin-4.7.3/kwin/effects/dialogparent/dialogparent.cpp (+5 lines)
Lines 95-98 Link Here
95
    effectStrength.remove(w);
95
    effectStrength.remove(w);
96
}
96
}
97
97
98
bool DialogParentEffect::isActive() const
99
{
100
    return !effectStrength.isEmpty();
101
}
102
98
} // namespace
103
} // namespace
(-)a/kwin-4.7.3/kwin/effects/dialogparent/dialogparent.h (+2 lines)
Lines 46-51 Link Here
46
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
46
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
47
    virtual void postPaintWindow(EffectWindow* w);
47
    virtual void postPaintWindow(EffectWindow* w);
48
48
49
    virtual bool isActive() const;
50
49
public Q_SLOTS:
51
public Q_SLOTS:
50
    void slotWindowClosed(EffectWindow *c);
52
    void slotWindowClosed(EffectWindow *c);
51
    void slotWindowActivated(EffectWindow *c);
53
    void slotWindowActivated(EffectWindow *c);
(-)a/kwin-4.7.3/kwin/effects/dimscreen/dimscreen.cpp (+6 lines)
Lines 108-111 Link Here
108
        }
108
        }
109
    }
109
    }
110
}
110
}
111
112
bool DimScreenEffect::isActive() const
113
{
114
    return mActivated;
115
}
116
111
} // namespace
117
} // namespace
(-)a/kwin-4.7.3/kwin/effects/dimscreen/dimscreen.h (+1 lines)
Lines 39-44 Link Here
39
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
39
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
40
    virtual void postPaintScreen();
40
    virtual void postPaintScreen();
41
    virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
41
    virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
42
    virtual bool isActive() const;
42
43
43
public Q_SLOTS:
44
public Q_SLOTS:
44
    void slotWindowActivated(EffectWindow *w);
45
    void slotWindowActivated(EffectWindow *w);
(-)a/kwin-4.7.3/kwin/effects/explosion/explosion.cpp (+5 lines)
Lines 202-206 Link Here
202
    mWindows.remove(c);
202
    mWindows.remove(c);
203
}
203
}
204
204
205
bool ExplosionEffect::isActive() const
206
{
207
    return mActiveAnimations > 0;
208
}
209
205
} // namespace
210
} // namespace
206
211
(-)a/kwin-4.7.3/kwin/effects/explosion/explosion.h (+1 lines)
Lines 47-52 Link Here
47
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
47
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
48
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
48
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
49
    virtual void postPaintScreen();
49
    virtual void postPaintScreen();
50
    virtual bool isActive() const;
50
51
51
    static bool supported();
52
    static bool supported();
52
53
(-)a/kwin-4.7.3/kwin/effects/fade/fade.cpp (+5 lines)
Lines 199-202 Link Here
199
    return (!w->isDesktop() && !w->isUtility());
199
    return (!w->isDesktop() && !w->isUtility());
200
}
200
}
201
201
202
bool FadeEffect::isActive() const
203
{
204
    return !windows.isEmpty();
205
}
206
202
} // namespace
207
} // namespace
(-)a/kwin-4.7.3/kwin/effects/fade/fade.h (+1 lines)
Lines 36-41 Link Here
36
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
36
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
37
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
37
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
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 bool isActive() const;
39
40
40
    // TODO react also on virtual desktop changes
41
    // TODO react also on virtual desktop changes
41
42
(-)a/kwin-4.7.3/kwin/effects/fadedesktop/fadedesktop.cpp (+5 lines)
Lines 107-112 Link Here
107
    effects->addRepaintFull();
107
    effects->addRepaintFull();
108
}
108
}
109
109
110
bool FadeDesktopEffect::isActive() const
111
{
112
    return m_fading;
113
}
114
110
} // namespace
115
} // namespace
111
116
112
#include "fadedesktop.moc"
117
#include "fadedesktop.moc"
(-)a/kwin-4.7.3/kwin/effects/fadedesktop/fadedesktop.h (+1 lines)
Lines 39-44 Link Here
39
    virtual void postPaintScreen();
39
    virtual void postPaintScreen();
40
    virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time);
40
    virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time);
41
    virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
41
    virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
42
    virtual bool isActive() const;
42
43
43
private Q_SLOTS:
44
private Q_SLOTS:
44
    void slotDesktopChanged(int old);
45
    void slotDesktopChanged(int old);
(-)a/kwin-4.7.3/kwin/effects/fallapart/fallapart.cpp (+5 lines)
Lines 160-163 Link Here
160
    windows.remove(c);
160
    windows.remove(c);
161
}
161
}
162
162
163
bool FallApartEffect::isActive() const
164
{
165
    return !windows.isEmpty();
166
}
167
163
} // namespace
168
} // namespace
(-)a/kwin-4.7.3/kwin/effects/fallapart/fallapart.h (+1 lines)
Lines 37-42 Link Here
37
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
37
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
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
    virtual bool isActive() const;
40
41
41
public Q_SLOTS:
42
public Q_SLOTS:
42
    void slotWindowClosed(EffectWindow *c);
43
    void slotWindowClosed(EffectWindow *c);
(-)a/kwin-4.7.3/kwin/effects/flipswitch/flipswitch.cpp (+5 lines)
Lines 934-939 Link Here
934
    }
934
    }
935
}
935
}
936
936
937
bool FlipSwitchEffect::isActive() const
938
{
939
    return m_active;
940
}
941
937
//*************************************************************
942
//*************************************************************
938
// Item Info
943
// Item Info
939
//*************************************************************
944
//*************************************************************
(-)a/kwin-4.7.3/kwin/effects/flipswitch/flipswitch.h (+1 lines)
Lines 47-52 Link Here
47
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
47
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
48
    virtual bool borderActivated(ElectricBorder border);
48
    virtual bool borderActivated(ElectricBorder border);
49
    virtual void grabbedKeyboardEvent(QKeyEvent* e);
49
    virtual void grabbedKeyboardEvent(QKeyEvent* e);
50
    virtual bool isActive() const;
50
51
51
    static bool supported();
52
    static bool supported();
52
private Q_SLOTS:
53
private Q_SLOTS:
(-)a/kwin-4.7.3/kwin/effects/glide/glide.cpp (+5 lines)
Lines 226-231 Link Here
226
    return true;
226
    return true;
227
}
227
}
228
228
229
bool GlideEffect::isActive() const
230
{
231
    return !windows.isEmpty();
232
}
233
229
GlideEffect::WindowInfo::WindowInfo()
234
GlideEffect::WindowInfo::WindowInfo()
230
    : deleted(false)
235
    : deleted(false)
231
    , added(false)
236
    , added(false)
(-)a/kwin-4.7.3/kwin/effects/glide/glide.h (+1 lines)
Lines 41-46 Link Here
41
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
41
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
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 postPaintWindow(EffectWindow* w);
43
    virtual void postPaintWindow(EffectWindow* w);
44
    virtual bool isActive() const;
44
45
45
    static bool supported();
46
    static bool supported();
46
public Q_SLOTS:
47
public Q_SLOTS:
(-)a/kwin-4.7.3/kwin/effects/highlightwindow/highlightwindow.cpp (+5 lines)
Lines 257-260 Link Here
257
        m_windowOpacity.constBegin().key()->addRepaintFull();
257
        m_windowOpacity.constBegin().key()->addRepaintFull();
258
}
258
}
259
259
260
bool HighlightWindowEffect::isActive() const
261
{
262
    return !m_windowOpacity.isEmpty();
263
}
264
260
} // namespace
265
} // namespace
(-)a/kwin-4.7.3/kwin/effects/highlightwindow/highlightwindow.h (+1 lines)
Lines 36-41 Link Here
36
36
37
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
37
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
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 bool isActive() const;
39
40
40
public Q_SLOTS:
41
public Q_SLOTS:
41
    void slotWindowAdded(EffectWindow* w);
42
    void slotWindowAdded(EffectWindow* w);
(-)a/kwin-4.7.3/kwin/effects/invert/invert.cpp (+5 lines)
Lines 161-166 Link Here
161
    effects->activeWindow()->addRepaintFull();
161
    effects->activeWindow()->addRepaintFull();
162
}
162
}
163
163
164
bool InvertEffect::isActive() const
165
{
166
    return m_valid && (m_allWindows || !m_windows.isEmpty());
167
}
168
164
} // namespace
169
} // namespace
165
170
166
#include "invert.moc"
171
#include "invert.moc"
(-)a/kwin-4.7.3/kwin/effects/invert/invert.h (+1 lines)
Lines 44-49 Link Here
44
    virtual void prePaintScreen(ScreenPrePaintData &data, int time);
44
    virtual void prePaintScreen(ScreenPrePaintData &data, int time);
45
    virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time);
45
    virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time);
46
    virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity);
46
    virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity);
47
    virtual bool isActive() const;
47
48
48
    static bool supported();
49
    static bool supported();
49
50
(-)a/kwin-4.7.3/kwin/effects/login/login.cpp (+5 lines)
Lines 96-99 Link Here
96
    return false;
96
    return false;
97
}
97
}
98
98
99
bool LoginEffect::isActive() const
100
{
101
    return login_window != NULL;
102
}
103
99
} // namespace
104
} // namespace
(-)a/kwin-4.7.3/kwin/effects/login/login.h (+1 lines)
Lines 37-42 Link Here
37
    virtual void postPaintScreen();
37
    virtual void postPaintScreen();
38
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
38
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
39
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
39
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
40
    virtual bool isActive() const;
40
41
41
public Q_SLOTS:
42
public Q_SLOTS:
42
    void slotWindowClosed(EffectWindow *w);
43
    void slotWindowClosed(EffectWindow *w);
(-)a/kwin-4.7.3/kwin/effects/logout/logout.cpp (+5 lines)
Lines 396-399 Link Here
396
    canDoPersistent = true;
396
    canDoPersistent = true;
397
}
397
}
398
398
399
bool LogoutEffect::isActive() const
400
{
401
    return progress != 0;
402
}
403
399
} // namespace
404
} // namespace
(-)a/kwin-4.7.3/kwin/effects/logout/logout.h (+1 lines)
Lines 44-49 Link Here
44
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
44
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
45
    virtual void postPaintScreen();
45
    virtual void postPaintScreen();
46
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
46
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
47
    virtual bool isActive() const;
47
public Q_SLOTS:
48
public Q_SLOTS:
48
    void slotWindowAdded(EffectWindow* w);
49
    void slotWindowAdded(EffectWindow* w);
49
    void slotWindowClosed(EffectWindow *w);
50
    void slotWindowClosed(EffectWindow *w);
(-)a/kwin-4.7.3/kwin/effects/lookingglass/lookingglass.cpp (+5 lines)
Lines 247-252 Link Here
247
    }
247
    }
248
}
248
}
249
249
250
bool LookingGlassEffect::isActive() const
251
{
252
    return m_valid && m_enabled;
253
}
254
250
} // namespace
255
} // namespace
251
256
252
#include "lookingglass.moc"
257
#include "lookingglass.moc"
(-)a/kwin-4.7.3/kwin/effects/lookingglass/lookingglass.h (+1 lines)
Lines 48-53 Link Here
48
48
49
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
49
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
50
    virtual void postPaintScreen();
50
    virtual void postPaintScreen();
51
    virtual bool isActive() const;
51
52
52
    static bool supported();
53
    static bool supported();
53
54
(-)a/kwin-4.7.3/kwin/effects/magiclamp/magiclamp.cpp (+5 lines)
Lines 353-356 Link Here
353
    mTimeLineWindows[w]->setCurrentTime(mAnimationDuration);
353
    mTimeLineWindows[w]->setCurrentTime(mAnimationDuration);
354
}
354
}
355
355
356
bool MagicLampEffect::isActive() const
357
{
358
    return !mTimeLineWindows.isEmpty();
359
}
360
356
} // namespace
361
} // namespace
(-)a/kwin-4.7.3/kwin/effects/magiclamp/magiclamp.h (+1 lines)
Lines 40-45 Link Here
40
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
40
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
41
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
41
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
42
    virtual void postPaintScreen();
42
    virtual void postPaintScreen();
43
    virtual bool isActive() const;
43
44
44
    static bool supported();
45
    static bool supported();
45
46
(-)a/kwin-4.7.3/kwin/effects/magnifier/magnifier.cpp (+5 lines)
Lines 209-214 Link Here
209
        effects->addRepaintFull();
209
        effects->addRepaintFull();
210
}
210
}
211
211
212
bool MagnifierEffect::isActive() const
213
{
214
    return zoom != 1.0 || zoom != target_zoom;
215
}
216
212
} // namespace
217
} // namespace
213
218
214
#include "magnifier.moc"
219
#include "magnifier.moc"
(-)a/kwin-4.7.3/kwin/effects/magnifier/magnifier.h (+1 lines)
Lines 36-41 Link Here
36
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
36
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
37
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
37
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
38
    virtual void postPaintScreen();
38
    virtual void postPaintScreen();
39
    virtual bool isActive() const;
39
    static bool supported();
40
    static bool supported();
40
private slots:
41
private slots:
41
    void zoomIn();
42
    void zoomIn();
(-)a/kwin-4.7.3/kwin/effects/minimizeanimation/minimizeanimation.cpp (+5 lines)
Lines 148-152 Link Here
148
    timeline->setCurrentTime(timeline->duration());
148
    timeline->setCurrentTime(timeline->duration());
149
}
149
}
150
150
151
bool MinimizeAnimationEffect::isActive() const
152
{
153
    return !mTimeLineWindows.isEmpty();
154
}
155
151
} // namespace
156
} // namespace
152
157
(-)a/kwin-4.7.3/kwin/effects/minimizeanimation/minimizeanimation.h (+1 lines)
Lines 43-48 Link Here
43
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
43
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
44
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
44
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
45
    virtual void postPaintScreen();
45
    virtual void postPaintScreen();
46
    virtual bool isActive() const;
46
47
47
public Q_SLOTS:
48
public Q_SLOTS:
48
    void slotWindowDeleted(EffectWindow *w);
49
    void slotWindowDeleted(EffectWindow *w);
(-)a/kwin-4.7.3/kwin/effects/mousemark/mousemark.cpp (+6 lines)
Lines 186-191 Link Here
186
    return ret;
186
    return ret;
187
}
187
}
188
188
189
bool MouseMarkEffect::isActive() const
190
{
191
    return !marks.isEmpty() || !drawing.isEmpty();
192
}
193
194
189
} // namespace
195
} // namespace
190
196
191
#include "mousemark.moc"
197
#include "mousemark.moc"
(-)a/kwin-4.7.3/kwin/effects/mousemark/mousemark.h (+1 lines)
Lines 36-41 Link Here
36
    ~MouseMarkEffect();
36
    ~MouseMarkEffect();
37
    virtual void reconfigure(ReconfigureFlags);
37
    virtual void reconfigure(ReconfigureFlags);
38
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
38
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
39
    virtual bool isActive() const;
39
private slots:
40
private slots:
40
    void clear();
41
    void clear();
41
    void clearLast();
42
    void clearLast();
(-)a/kwin-4.7.3/kwin/effects/outline/outline.cpp (+5 lines)
Lines 75-78 Link Here
75
    effects->addRepaint(geometry);
75
    effects->addRepaint(geometry);
76
}
76
}
77
77
78
bool OutlineEffect::isActive() const
79
{
80
    return m_active;
81
}
82
78
} // namespace
83
} // namespace
(-)a/kwin-4.7.3/kwin/effects/outline/outline.h (+1 lines)
Lines 35-40 Link Here
35
35
36
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
36
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
37
    virtual bool provides(Feature feature);
37
    virtual bool provides(Feature feature);
38
    virtual bool isActive() const;
38
39
39
public Q_SLOTS:
40
public Q_SLOTS:
40
    void slotShowOutline(const QRect &geometry);
41
    void slotShowOutline(const QRect &geometry);
(-)a/kwin-4.7.3/kwin/effects/presentwindows/presentwindows.cpp (+5 lines)
Lines 1967-1972 Link Here
1967
    shortcutClass = KShortcut(seq);
1967
    shortcutClass = KShortcut(seq);
1968
}
1968
}
1969
1969
1970
bool PresentWindowsEffect::isActive() const
1971
{
1972
    return m_activated || m_motionManager.managingWindows();
1973
}
1974
1970
/************************************************
1975
/************************************************
1971
* CloseWindowView
1976
* CloseWindowView
1972
************************************************/
1977
************************************************/
(-)a/kwin-4.7.3/kwin/effects/presentwindows/presentwindows.h (+1 lines)
Lines 103-108 Link Here
103
    virtual bool borderActivated(ElectricBorder border);
103
    virtual bool borderActivated(ElectricBorder border);
104
    virtual void windowInputMouseEvent(Window w, QEvent *e);
104
    virtual void windowInputMouseEvent(Window w, QEvent *e);
105
    virtual void grabbedKeyboardEvent(QKeyEvent *e);
105
    virtual void grabbedKeyboardEvent(QKeyEvent *e);
106
    virtual bool isActive() const;
106
107
107
    enum { LayoutNatural, LayoutRegularGrid, LayoutFlexibleGrid }; // Layout modes
108
    enum { LayoutNatural, LayoutRegularGrid, LayoutFlexibleGrid }; // Layout modes
108
    enum PresentWindowsMode {
109
    enum PresentWindowsMode {
(-)a/kwin-4.7.3/kwin/effects/scalein/scalein.cpp (+5 lines)
Lines 95-98 Link Here
95
    delete mTimeLineWindows.take(c);
95
    delete mTimeLineWindows.take(c);
96
}
96
}
97
97
98
bool ScaleInEffect::isActive() const
99
{
100
    return !mTimeLineWindows.isEmpty();
101
}
102
98
} // namespace
103
} // namespace
(-)a/kwin-4.7.3/kwin/effects/scalein/scalein.h (+1 lines)
Lines 38-43 Link Here
38
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
38
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
39
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
39
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
40
    virtual void postPaintWindow(EffectWindow* w);
40
    virtual void postPaintWindow(EffectWindow* w);
41
    virtual bool isActive() const;
41
    // TODO react also on virtual desktop changes
42
    // TODO react also on virtual desktop changes
42
public Q_SLOTS:
43
public Q_SLOTS:
43
    void slotWindowAdded(EffectWindow* c);
44
    void slotWindowAdded(EffectWindow* c);
(-)a/kwin-4.7.3/kwin/effects/screenshot/screenshot.cpp (+5 lines)
Lines 200-203 Link Here
200
    img = img.mirrored();
200
    img = img.mirrored();
201
}
201
}
202
202
203
bool ScreenShotEffect::isActive() const
204
{
205
    return m_scheduledScreenshot != NULL;
206
}
207
203
} // namespace
208
} // namespace
(-)a/kwin-4.7.3/kwin/effects/screenshot/screenshot.h (+1 lines)
Lines 40-45 Link Here
40
    ScreenShotEffect();
40
    ScreenShotEffect();
41
    virtual ~ScreenShotEffect();
41
    virtual ~ScreenShotEffect();
42
    virtual void postPaintScreen();
42
    virtual void postPaintScreen();
43
    virtual bool isActive() const;
43
44
44
    static bool supported();
45
    static bool supported();
45
    static void convertFromGLImage(QImage &img, int w, int h);
46
    static void convertFromGLImage(QImage &img, int w, int h);
(-)a/kwin-4.7.3/kwin/effects/sheet/sheet.cpp (+5 lines)
Lines 186-191 Link Here
186
    return (w->isModal() || w->data(IsSheetWindow).toBool());
186
    return (w->isModal() || w->data(IsSheetWindow).toBool());
187
}
187
}
188
188
189
bool SheetEffect::isActive() const
190
{
191
    return !windows.isEmpty();
192
}
193
189
SheetEffect::WindowInfo::WindowInfo()
194
SheetEffect::WindowInfo::WindowInfo()
190
    : deleted(false)
195
    : deleted(false)
191
    , added(false)
196
    , added(false)
(-)a/kwin-4.7.3/kwin/effects/sheet/sheet.h (+1 lines)
Lines 40-45 Link Here
40
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
40
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
41
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
41
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
42
    virtual void postPaintWindow(EffectWindow* w);
42
    virtual void postPaintWindow(EffectWindow* w);
43
    virtual bool isActive() const;
43
44
44
    static bool supported();
45
    static bool supported();
45
46
(-)a/kwin-4.7.3/kwin/effects/slide/slide.cpp (+5 lines)
Lines 227-232 Link Here
227
    effects->addRepaintFull();
227
    effects->addRepaintFull();
228
}
228
}
229
229
230
bool SlideEffect::isActive() const
231
{
232
    return slide;
233
}
234
230
} // namespace
235
} // namespace
231
236
232
#include "slide.moc"
237
#include "slide.moc"
(-)a/kwin-4.7.3/kwin/effects/slide/slide.h (+1 lines)
Lines 41-46 Link Here
41
    virtual void postPaintScreen();
41
    virtual void postPaintScreen();
42
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
42
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
43
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
43
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
44
    virtual bool isActive() const;
44
45
45
private Q_SLOTS:
46
private Q_SLOTS:
46
    void slotDesktopChanged(int old, int current);
47
    void slotDesktopChanged(int old, int current);
(-)a/kwin-4.7.3/kwin/effects/slideback/slideback.cpp (+5 lines)
Lines 373-376 Link Here
373
    return modalGroupGeometry;
373
    return modalGroupGeometry;
374
}
374
}
375
375
376
bool SlideBackEffect::isActive() const
377
{
378
    return motionManager.managingWindows();
379
}
380
376
} //Namespace
381
} //Namespace
(-)a/kwin-4.7.3/kwin/effects/slideback/slideback.h (+1 lines)
Lines 40-45 Link Here
40
40
41
    virtual void prePaintScreen(ScreenPrePaintData &data, int time);
41
    virtual void prePaintScreen(ScreenPrePaintData &data, int time);
42
    virtual void postPaintScreen();
42
    virtual void postPaintScreen();
43
    virtual bool isActive() const;
43
44
44
public Q_SLOTS:
45
public Q_SLOTS:
45
    void slotWindowAdded(EffectWindow *w);
46
    void slotWindowAdded(EffectWindow *w);
(-)a/kwin-4.7.3/kwin/effects/slidingpopups/slidingpopups.cpp (+6 lines)
Lines 243-246 Link Here
243
    }
243
    }
244
    mWindowsData[ w ] = animData;
244
    mWindowsData[ w ] = animData;
245
}
245
}
246
247
bool SlidingPopupsEffect::isActive() const
248
{
249
    return !mAppearingWindows.isEmpty() || !mDisappearingWindows.isEmpty();
250
}
251
246
} // namespace
252
} // namespace
(-)a/kwin-4.7.3/kwin/effects/slidingpopups/slidingpopups.h (+1 lines)
Lines 41-46 Link Here
41
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
41
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
42
    virtual void postPaintWindow(EffectWindow* w);
42
    virtual void postPaintWindow(EffectWindow* w);
43
    virtual void reconfigure(ReconfigureFlags flags);
43
    virtual void reconfigure(ReconfigureFlags flags);
44
    virtual bool isActive() const;
44
    // TODO react also on virtual desktop changes
45
    // TODO react also on virtual desktop changes
45
46
46
public Q_SLOTS:
47
public Q_SLOTS:
(-)a/kwin-4.7.3/kwin/effects/snaphelper/snaphelper.cpp (+5 lines)
Lines 216-219 Link Here
216
    }
216
    }
217
}
217
}
218
218
219
bool SnapHelperEffect::isActive() const
220
{
221
    return m_timeline.currentValue() != 0.0;
222
}
223
219
} // namespace
224
} // namespace
(-)a/kwin-4.7.3/kwin/effects/snaphelper/snaphelper.h (+1 lines)
Lines 39-44 Link Here
39
39
40
    virtual void prePaintScreen(ScreenPrePaintData &data, int time);
40
    virtual void prePaintScreen(ScreenPrePaintData &data, int time);
41
    virtual void postPaintScreen();
41
    virtual void postPaintScreen();
42
    virtual bool isActive() const;
42
43
43
    static bool supported();
44
    static bool supported();
44
45
(-)a/kwin-4.7.3/kwin/effects/startupfeedback/startupfeedback.cpp (+5 lines)
Lines 417-420 Link Here
417
    return rect;
417
    return rect;
418
}
418
}
419
419
420
bool StartupFeedbackEffect::isActive() const
421
{
422
    return m_active;
423
}
424
420
} // namespace
425
} // namespace
(-)a/kwin-4.7.3/kwin/effects/startupfeedback/startupfeedback.h (+1 lines)
Lines 41-46 Link Here
41
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
41
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
42
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
42
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
43
    virtual void postPaintScreen();
43
    virtual void postPaintScreen();
44
    virtual bool isActive() const;
44
45
45
    static bool supported();
46
    static bool supported();
46
47
(-)a/kwin-4.7.3/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp (+5 lines)
Lines 161-164 Link Here
161
    }
161
    }
162
}
162
}
163
163
164
bool TaskbarThumbnailEffect::isActive() const
165
{
166
    return !thumbnails.isEmpty();
167
}
168
164
} // namespace
169
} // namespace
(-)a/kwin-4.7.3/kwin/effects/taskbarthumbnail/taskbarthumbnail.h (+1 lines)
Lines 38-43 Link Here
38
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
38
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
39
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
39
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
40
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
40
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
41
    virtual bool isActive() const;
41
42
42
public Q_SLOTS:
43
public Q_SLOTS:
43
    void slotWindowAdded(EffectWindow *w);
44
    void slotWindowAdded(EffectWindow *w);
(-)a/kwin-4.7.3/kwin/effects/thumbnailaside/thumbnailaside.cpp (+5 lines)
Lines 172-177 Link Here
172
    effects->addRepaint(d.rect);
172
    effects->addRepaint(d.rect);
173
}
173
}
174
174
175
bool ThumbnailAsideEffect::isActive() const
176
{
177
    return !windows.isEmpty();
178
}
179
175
} // namespace
180
} // namespace
176
181
177
#include "thumbnailaside.moc"
182
#include "thumbnailaside.moc"
(-)a/kwin-4.7.3/kwin/effects/thumbnailaside/thumbnailaside.h (+1 lines)
Lines 48-53 Link Here
48
    void slotWindowClosed(EffectWindow *w);
48
    void slotWindowClosed(EffectWindow *w);
49
    void slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old);
49
    void slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old);
50
    void slotWindowDamaged(EffectWindow* w, const QRect& damage);
50
    void slotWindowDamaged(EffectWindow* w, const QRect& damage);
51
    virtual bool isActive() const;
51
private:
52
private:
52
    void addThumbnail(EffectWindow* w);
53
    void addThumbnail(EffectWindow* w);
53
    void removeThumbnail(EffectWindow* w);
54
    void removeThumbnail(EffectWindow* w);
(-)a/kwin-4.7.3/kwin/effects/trackmouse/trackmouse.cpp (+5 lines)
Lines 213-216 Link Here
213
#endif
213
#endif
214
}
214
}
215
215
216
bool TrackMouseEffect::isActive() const
217
{
218
    return active;
219
}
220
216
} // namespace
221
} // namespace
(-)a/kwin-4.7.3/kwin/effects/trackmouse/trackmouse.h (+1 lines)
Lines 41-46 Link Here
41
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
41
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
42
    virtual void postPaintScreen();
42
    virtual void postPaintScreen();
43
    virtual void reconfigure(ReconfigureFlags);
43
    virtual void reconfigure(ReconfigureFlags);
44
    virtual bool isActive() const;
44
private slots:
45
private slots:
45
    void toggle();
46
    void toggle();
46
    void slotMouseChanged(const QPoint& pos, const QPoint& old,
47
    void slotMouseChanged(const QPoint& pos, const QPoint& old,
(-)a/kwin-4.7.3/kwin/effects/windowgeometry/windowgeometry.cpp (+4 lines)
Lines 178-180 Link Here
178
    }
178
    }
179
}
179
}
180
180
181
bool WindowGeometry::isActive() const
182
{
183
    return iAmActive;
184
}
(-)a/kwin-4.7.3/kwin/effects/windowgeometry/windowgeometry.h (+1 lines)
Lines 38-43 Link Here
38
    }
38
    }
39
    void reconfigure(ReconfigureFlags);
39
    void reconfigure(ReconfigureFlags);
40
    void paintScreen(int mask, QRegion region, ScreenPaintData &data);
40
    void paintScreen(int mask, QRegion region, ScreenPaintData &data);
41
    virtual bool isActive() const;
41
42
42
private slots:
43
private slots:
43
    void toggle();
44
    void toggle();
(-)a/kwin-4.7.3/kwin/effects/wobblywindows/wobblywindows.cpp (+4 lines)
Lines 1218-1223 Link Here
1218
    wwi.buffer = tmp;
1218
    wwi.buffer = tmp;
1219
}
1219
}
1220
1220
1221
bool WobblyWindowsEffect::isActive() const
1222
{
1223
    return !windows.isEmpty();
1224
}
1221
1225
1222
} // namespace KWin
1226
} // namespace KWin
1223
1227
(-)a/kwin-4.7.3/kwin/effects/wobblywindows/wobblywindows.h (+1 lines)
Lines 35-40 Link Here
35
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
35
    virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
36
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
36
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
37
    virtual void postPaintScreen();
37
    virtual void postPaintScreen();
38
    virtual bool isActive() const;
38
39
39
    // Wobbly model parameters
40
    // Wobbly model parameters
40
    void setStiffness(qreal stiffness);
41
    void setStiffness(qreal stiffness);
(-)a/kwin-4.7.3/kwin/effects/zoom/zoom.cpp (+5 lines)
Lines 496-501 Link Here
496
    }
496
    }
497
}
497
}
498
498
499
bool ZoomEffect::isActive() const
500
{
501
    return zoom != 1.0 || zoom != target_zoom;
502
}
503
499
} // namespace
504
} // namespace
500
505
501
#include "zoom.moc"
506
#include "zoom.moc"
(-)a/kwin-4.7.3/kwin/effects/zoom/zoom.h (+1 lines)
Lines 43-48 Link Here
43
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
43
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
44
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
44
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
45
    virtual void postPaintScreen();
45
    virtual void postPaintScreen();
46
    virtual bool isActive() const;
46
private slots:
47
private slots:
47
    void zoomIn();
48
    void zoomIn();
48
    void zoomOut();
49
    void zoomOut();
(-)a/kwin-4.7.3/kwin/effects.cpp (-40 / +38 lines)
Lines 95-101 Link Here
95
    , fullscreen_effect(0)
95
    , fullscreen_effect(0)
96
    , next_window_quad_type(EFFECT_QUAD_TYPE_START)
96
    , next_window_quad_type(EFFECT_QUAD_TYPE_START)
97
    , mouse_poll_ref_count(0)
97
    , mouse_poll_ref_count(0)
98
    , current_paint_effectframe(0)
99
{
98
{
100
    Workspace *ws = Workspace::self();
99
    Workspace *ws = Workspace::self();
101
    connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChanged(int)));
100
    connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChanged(int)));
Lines 199-252 Link Here
199
// the idea is that effects call this function again which calls the next one
198
// the idea is that effects call this function again which calls the next one
200
void EffectsHandlerImpl::prePaintScreen(ScreenPrePaintData& data, int time)
199
void EffectsHandlerImpl::prePaintScreen(ScreenPrePaintData& data, int time)
201
{
200
{
202
    if (current_paint_screen < loaded_effects.size()) {
201
    if (m_currentPaintScreenIterator != m_activeEffects.end()) {
203
        loaded_effects.at(current_paint_screen++).second->prePaintScreen(data, time);
202
        (*m_currentPaintScreenIterator++)->prePaintScreen(data, time);
204
        --current_paint_screen;
203
        --m_currentPaintScreenIterator;
205
    }
204
    }
206
    // no special final code
205
    // no special final code
207
}
206
}
208
207
209
void EffectsHandlerImpl::paintScreen(int mask, QRegion region, ScreenPaintData& data)
208
void EffectsHandlerImpl::paintScreen(int mask, QRegion region, ScreenPaintData& data)
210
{
209
{
211
    if (current_paint_screen < loaded_effects.size()) {
210
    if (m_currentPaintScreenIterator != m_activeEffects.end()) {
212
        loaded_effects.at(current_paint_screen++).second->paintScreen(mask, region, data);
211
        (*m_currentPaintScreenIterator++)->paintScreen(mask, region, data);
213
        --current_paint_screen;
212
        --m_currentPaintScreenIterator;
214
    } else
213
    } else
215
        scene->finalPaintScreen(mask, region, data);
214
        scene->finalPaintScreen(mask, region, data);
216
}
215
}
217
216
218
void EffectsHandlerImpl::postPaintScreen()
217
void EffectsHandlerImpl::postPaintScreen()
219
{
218
{
220
    if (current_paint_screen < loaded_effects.size()) {
219
    if (m_currentPaintScreenIterator != m_activeEffects.end()) {
221
        loaded_effects.at(current_paint_screen++).second->postPaintScreen();
220
        (*m_currentPaintScreenIterator++)->postPaintScreen();
222
        --current_paint_screen;
221
        --m_currentPaintScreenIterator;
223
    }
222
    }
224
    // no special final code
223
    // no special final code
225
}
224
}
226
225
227
void EffectsHandlerImpl::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time)
226
void EffectsHandlerImpl::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time)
228
{
227
{
229
    if (current_paint_window < loaded_effects.size()) {
228
    if (m_currentPaintWindowIterator != m_activeEffects.end()) {
230
        loaded_effects.at(current_paint_window++).second->prePaintWindow(w, data, time);
229
        (*m_currentPaintWindowIterator++)->prePaintWindow(w, data, time);
231
        --current_paint_window;
230
        --m_currentPaintWindowIterator;
232
    }
231
    }
233
    // no special final code
232
    // no special final code
234
}
233
}
235
234
236
void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
235
void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
237
{
236
{
238
    if (current_paint_window < loaded_effects.size()) {
237
    if (m_currentPaintWindowIterator != m_activeEffects.end()) {
239
        loaded_effects.at(current_paint_window++).second->paintWindow(w, mask, region, data);
238
        (*m_currentPaintWindowIterator++)->paintWindow(w, mask, region, data);
240
        --current_paint_window;
239
        --m_currentPaintWindowIterator;
241
    } else
240
    } else
242
        scene->finalPaintWindow(static_cast<EffectWindowImpl*>(w), mask, region, data);
241
        scene->finalPaintWindow(static_cast<EffectWindowImpl*>(w), mask, region, data);
243
}
242
}
244
243
245
void EffectsHandlerImpl::paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity)
244
void EffectsHandlerImpl::paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity)
246
{
245
{
247
    if (current_paint_effectframe < loaded_effects.size()) {
246
    if (m_currentPaintEffectFrameIterator != m_activeEffects.end()) {
248
        loaded_effects.at(current_paint_effectframe++).second->paintEffectFrame(frame, region, opacity, frameOpacity);
247
        (*m_currentPaintEffectFrameIterator++)->paintEffectFrame(frame, region, opacity, frameOpacity);
249
        --current_paint_effectframe;
248
        --m_currentPaintEffectFrameIterator;
250
    } else {
249
    } else {
251
        const EffectFrameImpl* frameImpl = static_cast<const EffectFrameImpl*>(frame);
250
        const EffectFrameImpl* frameImpl = static_cast<const EffectFrameImpl*>(frame);
252
        frameImpl->finalRender(region, opacity, frameOpacity);
251
        frameImpl->finalRender(region, opacity, frameOpacity);
Lines 255-263 Link Here
255
254
256
void EffectsHandlerImpl::postPaintWindow(EffectWindow* w)
255
void EffectsHandlerImpl::postPaintWindow(EffectWindow* w)
257
{
256
{
258
    if (current_paint_window < loaded_effects.size()) {
257
    if (m_currentPaintWindowIterator != m_activeEffects.end()) {
259
        loaded_effects.at(current_paint_window++).second->postPaintWindow(w);
258
        (*m_currentPaintWindowIterator++)->postPaintWindow(w);
260
        --current_paint_window;
259
        --m_currentPaintWindowIterator;
261
    }
260
    }
262
    // no special final code
261
    // no special final code
263
}
262
}
Lines 272-289 Link Here
272
271
273
void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
272
void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
274
{
273
{
275
    if (current_draw_window < loaded_effects.size()) {
274
    if (m_currentDrawWindowIterator != m_activeEffects.end()) {
276
        loaded_effects.at(current_draw_window++).second->drawWindow(w, mask, region, data);
275
        (*m_currentDrawWindowIterator++)->drawWindow(w, mask, region, data);
277
        --current_draw_window;
276
        --m_currentDrawWindowIterator;
278
    } else
277
    } else
279
        scene->finalDrawWindow(static_cast<EffectWindowImpl*>(w), mask, region, data);
278
        scene->finalDrawWindow(static_cast<EffectWindowImpl*>(w), mask, region, data);
280
}
279
}
281
280
282
void EffectsHandlerImpl::buildQuads(EffectWindow* w, WindowQuadList& quadList)
281
void EffectsHandlerImpl::buildQuads(EffectWindow* w, WindowQuadList& quadList)
283
{
282
{
284
    if (current_build_quads < loaded_effects.size()) {
283
    if (m_currentBuildQuadsIterator != m_activeEffects.end()) {
285
        loaded_effects.at(current_build_quads++).second->buildQuads(w, quadList);
284
        (*m_currentBuildQuadsIterator++)->buildQuads(w, quadList);
286
        --current_build_quads;
285
        --m_currentBuildQuadsIterator;
287
    }
286
    }
288
}
287
}
289
288
Lines 305-314 Link Here
305
// start another painting pass
304
// start another painting pass
306
void EffectsHandlerImpl::startPaint()
305
void EffectsHandlerImpl::startPaint()
307
{
306
{
308
    assert(current_paint_screen == 0);
307
    m_activeEffects.clear();
309
    assert(current_paint_window == 0);
308
    for(QVector< KWin::EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it) {
310
    assert(current_draw_window == 0);
309
        if (it->second->isActive()) {
311
    assert(current_build_quads == 0);
310
            m_activeEffects << it->second;
311
        }
312
    }
313
    m_currentDrawWindowIterator = m_activeEffects.begin();
314
    m_currentPaintWindowIterator = m_activeEffects.begin();
315
    m_currentPaintScreenIterator = m_activeEffects.begin();
316
    m_currentPaintEffectFrameIterator = m_activeEffects.begin();
317
    m_currentBuildQuadsIterator = m_activeEffects.begin();
312
}
318
}
313
319
314
void EffectsHandlerImpl::slotClientMaximized(KWin::Client *c, KDecorationDefines::MaximizeMode maxMode)
320
void EffectsHandlerImpl::slotClientMaximized(KWin::Client *c, KDecorationDefines::MaximizeMode maxMode)
Lines 1022-1031 Link Here
1022
bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault)
1028
bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault)
1023
{
1029
{
1024
    Workspace::self()->addRepaintFull();
1030
    Workspace::self()->addRepaintFull();
1025
    assert(current_paint_screen == 0);
1026
    assert(current_paint_window == 0);
1027
    assert(current_draw_window == 0);
1028
    assert(current_build_quads == 0);
1029
1031
1030
    if (!name.startsWith(QLatin1String("kwin4_effect_")))
1032
    if (!name.startsWith(QLatin1String("kwin4_effect_")))
1031
        kWarning(1212) << "Effect names usually have kwin4_effect_ prefix" ;
1033
        kWarning(1212) << "Effect names usually have kwin4_effect_ prefix" ;
Lines 1134-1143 Link Here
1134
void EffectsHandlerImpl::unloadEffect(const QString& name)
1136
void EffectsHandlerImpl::unloadEffect(const QString& name)
1135
{
1137
{
1136
    Workspace::self()->addRepaintFull();
1138
    Workspace::self()->addRepaintFull();
1137
    assert(current_paint_screen == 0);
1138
    assert(current_paint_window == 0);
1139
    assert(current_draw_window == 0);
1140
    assert(current_build_quads == 0);
1141
1139
1142
    for (QMap< int, EffectPair >::iterator it = effect_order.begin(); it != effect_order.end(); ++it) {
1140
    for (QMap< int, EffectPair >::iterator it = effect_order.begin(); it != effect_order.end(); ++it) {
1143
        if (it.value().first == name) {
1141
        if (it.value().first == name) {
(-)a/kwin-4.7.3/kwin/effects.h (-1 / +8 lines)
Lines 208-214 Link Here
208
    QHash< long, int > registered_atoms;
208
    QHash< long, int > registered_atoms;
209
    int next_window_quad_type;
209
    int next_window_quad_type;
210
    int mouse_poll_ref_count;
210
    int mouse_poll_ref_count;
211
    int current_paint_effectframe;
211
212
private:
213
    QList< Effect* > m_activeEffects;
214
    QList< Effect* >::iterator m_currentDrawWindowIterator;
215
    QList< Effect* >::iterator m_currentPaintWindowIterator;
216
    QList< Effect* >::iterator m_currentPaintEffectFrameIterator;
217
    QList< Effect* >::iterator m_currentPaintScreenIterator;
218
    QList< Effect* >::iterator m_currentBuildQuadsIterator;
212
};
219
};
213
220
214
class EffectWindowImpl : public EffectWindow
221
class EffectWindowImpl : public EffectWindow
(-)a/kwin-4.7.3/kwin/libkwineffects/kwineffects.cpp (-5 / +6 lines)
Lines 172-177 Link Here
172
    return false;
172
    return false;
173
}
173
}
174
174
175
bool Effect::isActive() const
176
{
177
    return true;
178
}
179
175
void Effect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
180
void Effect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
176
{
181
{
177
    effects->drawWindow(w, mask, region, data);
182
    effects->drawWindow(w, mask, region, data);
Lines 230-240 Link Here
230
//****************************************
235
//****************************************
231
236
232
EffectsHandler::EffectsHandler(CompositingType type)
237
EffectsHandler::EffectsHandler(CompositingType type)
233
    : current_paint_screen(0)
238
    : compositing_type(type)
234
    , current_paint_window(0)
235
    , current_draw_window(0)
236
    , current_build_quads(0)
237
    , compositing_type(type)
238
{
239
{
239
    if (compositing_type == NoCompositing)
240
    if (compositing_type == NoCompositing)
240
        return;
241
        return;
(-)a/kwin-4.7.3/kwin/libkwineffects/kwineffects.h (-8 / +21 lines)
Lines 447-452 Link Here
447
447
448
    virtual bool borderActivated(ElectricBorder border);
448
    virtual bool borderActivated(ElectricBorder border);
449
449
450
    /**
451
     * Overwrite this method to indicate whether your effect will be doing something in
452
     * the next frame to be rendered. If the method returns @c false the effect will be
453
     * excluded from the chained methods in the next rendered frame.
454
     *
455
     * This method is called always directly before the paint loop begins. So it is totally
456
     * fine to e.g. react on a window event, issue a repaint to trigger an animation and
457
     * change a flag to indicate that this method returns @c true.
458
     *
459
     * As the method is called each frame, you should not perform complex calculations.
460
     * Best use just a boolean flag.
461
     *
462
     * The default implementation of this method returns @c true.
463
     * @since 4.8
464
     **/
465
    virtual bool isActive() const;
466
450
    static int displayWidth();
467
    static int displayWidth();
451
    static int displayHeight();
468
    static int displayHeight();
452
    static QPoint cursorPos();
469
    static QPoint cursorPos();
Lines 1023-1032 Link Here
1023
    QHash< QString, KLibrary* > effect_libraries;
1040
    QHash< QString, KLibrary* > effect_libraries;
1024
    QList< InputWindowPair > input_windows;
1041
    QList< InputWindowPair > input_windows;
1025
    //QHash< QString, EffectFactory* > effect_factories;
1042
    //QHash< QString, EffectFactory* > effect_factories;
1026
    int current_paint_screen;
1027
    int current_paint_window;
1028
    int current_draw_window;
1029
    int current_build_quads;
1030
    CompositingType compositing_type;
1043
    CompositingType compositing_type;
1031
};
1044
};
1032
1045
Lines 1739-1752 Link Here
1739
     * Returns whether or not a specified window is being managed
1752
     * Returns whether or not a specified window is being managed
1740
     * by this manager object.
1753
     * by this manager object.
1741
     */
1754
     */
1742
    inline bool isManaging(EffectWindow *w) {
1755
    inline bool isManaging(EffectWindow *w) const {
1743
        return m_managedWindows.contains(w);
1756
        return m_managedWindows.contains(w);
1744
    }
1757
    }
1745
    /**
1758
    /**
1746
     * Returns whether or not this manager object is actually
1759
     * Returns whether or not this manager object is actually
1747
     * managing any windows or not.
1760
     * managing any windows or not.
1748
     */
1761
     */
1749
    inline bool managingWindows() {
1762
    inline bool managingWindows() const {
1750
        return !m_managedWindows.empty();
1763
        return !m_managedWindows.empty();
1751
    }
1764
    }
1752
    /**
1765
    /**
Lines 1754-1767 Link Here
1754
     * or not. Can be used to see if an effect should be
1767
     * or not. Can be used to see if an effect should be
1755
     * processed and displayed or not.
1768
     * processed and displayed or not.
1756
     */
1769
     */
1757
    inline bool areWindowsMoving() {
1770
    inline bool areWindowsMoving() const {
1758
        return !m_movingWindowsSet.isEmpty();
1771
        return !m_movingWindowsSet.isEmpty();
1759
    }
1772
    }
1760
    /**
1773
    /**
1761
     * Returns whether a window has reached its targets yet
1774
     * Returns whether a window has reached its targets yet
1762
     * or not.
1775
     * or not.
1763
     */
1776
     */
1764
    inline bool isWindowMoving(EffectWindow *w) {
1777
    inline bool isWindowMoving(EffectWindow *w) const {
1765
        return m_movingWindowsSet.contains(w);
1778
        return m_movingWindowsSet.contains(w);
1766
    }
1779
    }
1767
1780

Return to bug 389467