Changeset View
Changeset View
Standalone View
Standalone View
effects/glide/glide.cpp
Show All 27 Lines | |||||
28 | 28 | | |||
29 | // Effect is based on fade effect by Philip Falkner | 29 | // Effect is based on fade effect by Philip Falkner | ||
30 | 30 | | |||
31 | namespace KWin | 31 | namespace KWin | ||
32 | { | 32 | { | ||
33 | 33 | | |||
34 | static const int IsGlideWindow = 0x22A982D4; | 34 | static const int IsGlideWindow = 0x22A982D4; | ||
35 | 35 | | |||
36 | GlideEffect::GlideEffect() | 36 | GlideEffect::GlideEffect() | ||
broulik: Any particular reason for using a `QSet`? (just curious) | |||||
romangg: Fast lookup. | |||||
37 | : Effect() | 37 | : Effect() | ||
38 | { | 38 | { | ||
39 | initConfig<GlideConfig>(); | 39 | initConfig<GlideConfig>(); | ||
40 | reconfigure(ReconfigureAll); | 40 | reconfigure(ReconfigureAll); | ||
41 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | 41 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | ||
42 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | 42 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | ||
43 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | 43 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | ||
44 | 44 | | |||
Show All 10 Lines | |||||
55 | 55 | | |||
56 | void GlideEffect::reconfigure(ReconfigureFlags) | 56 | void GlideEffect::reconfigure(ReconfigureFlags) | ||
57 | { | 57 | { | ||
58 | // Fetch config with KConfigXT | 58 | // Fetch config with KConfigXT | ||
59 | GlideConfig::self()->read(); | 59 | GlideConfig::self()->read(); | ||
60 | duration = animationTime<GlideConfig>(350); | 60 | duration = animationTime<GlideConfig>(350); | ||
61 | effect = (EffectStyle) GlideConfig::glideEffect(); | 61 | effect = (EffectStyle) GlideConfig::glideEffect(); | ||
62 | angle = GlideConfig::glideAngle(); | 62 | angle = GlideConfig::glideAngle(); | ||
63 | blacklist = GlideConfig::blacklist().toSet(); | ||||
63 | } | 64 | } | ||
64 | 65 | | |||
65 | void GlideEffect::prePaintScreen(ScreenPrePaintData& data, int time) | 66 | void GlideEffect::prePaintScreen(ScreenPrePaintData& data, int time) | ||
66 | { | 67 | { | ||
67 | if (!windows.isEmpty()) | 68 | if (!windows.isEmpty()) | ||
68 | data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; | 69 | data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; | ||
69 | effects->prePaintScreen(data, time); | 70 | effects->prePaintScreen(data, time); | ||
70 | } | 71 | } | ||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | |||||
204 | } | 205 | } | ||
205 | 206 | | |||
206 | bool GlideEffect::isGlideWindow(EffectWindow* w) | 207 | bool GlideEffect::isGlideWindow(EffectWindow* w) | ||
207 | { | 208 | { | ||
208 | if (effects->activeFullScreenEffect()) | 209 | if (effects->activeFullScreenEffect()) | ||
209 | return false; | 210 | return false; | ||
210 | if (!w->isVisible()) | 211 | if (!w->isVisible()) | ||
211 | return false; | 212 | return false; | ||
213 | if (blacklist.contains(w->windowClass())) | ||||
214 | return false; | ||||
212 | if (w->data(IsGlideWindow).toBool()) | 215 | if (w->data(IsGlideWindow).toBool()) | ||
213 | return true; | 216 | return true; | ||
214 | if (w->hasDecoration()) | 217 | if (w->hasDecoration()) | ||
215 | return true; | 218 | return true; | ||
216 | if (!w->isManaged() || w->isMenu() || w->isNotification() || w->isDesktop() || | 219 | if (!w->isManaged() || w->isMenu() || w->isNotification() || w->isDesktop() || | ||
217 | w->isDock() || w->isSplash() || w->isToolbar()) | 220 | w->isDock() || w->isSplash() || w->isToolbar()) | ||
218 | return false; | 221 | return false; | ||
219 | return true; | 222 | return true; | ||
Show All 35 Lines |
Any particular reason for using a QSet? (just curious)