Changeset View
Changeset View
Standalone View
Standalone View
effects/glide/glide.cpp
Show All 18 Lines | |||||
19 | You should have received a copy of the GNU General Public License | 19 | You should have received a copy of the GNU General Public License | ||
20 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | *********************************************************************/ | 21 | *********************************************************************/ | ||
22 | 22 | | |||
23 | #include "glide.h" | 23 | #include "glide.h" | ||
24 | // KConfigSkeleton | 24 | // KConfigSkeleton | ||
25 | #include "glideconfig.h" | 25 | #include "glideconfig.h" | ||
26 | 26 | | |||
27 | #include <QSet> | ||||
28 | #include <QString> | ||||
27 | #include <QTimeLine> | 29 | #include <QTimeLine> | ||
28 | 30 | | |||
29 | // Effect is based on fade effect by Philip Falkner | 31 | // Effect is based on fade effect by Philip Falkner | ||
30 | 32 | | |||
31 | namespace KWin | 33 | namespace KWin | ||
32 | { | 34 | { | ||
33 | 35 | | |||
34 | static const int IsGlideWindow = 0x22A982D4; | 36 | static const int IsGlideWindow = 0x22A982D4; | ||
35 | 37 | | |||
38 | static const QSet<QString> s_blacklist { | ||||
broulik: Any particular reason for using a `QSet`? (just curious) | |||||
romangg: Fast lookup. | |||||
39 | "ksmserver ksmserver", | ||||
40 | "ksplashx ksplashx", | ||||
41 | "ksplashsimple ksplashsimple", | ||||
42 | "ksplashqml ksplashqml" | ||||
43 | }; | ||||
44 | | ||||
36 | GlideEffect::GlideEffect() | 45 | GlideEffect::GlideEffect() | ||
37 | : Effect() | 46 | : Effect() | ||
38 | { | 47 | { | ||
39 | initConfig<GlideConfig>(); | 48 | initConfig<GlideConfig>(); | ||
40 | reconfigure(ReconfigureAll); | 49 | reconfigure(ReconfigureAll); | ||
41 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | 50 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | ||
42 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | 51 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | ||
43 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | 52 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | ||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | |||||
204 | } | 213 | } | ||
205 | 214 | | |||
206 | bool GlideEffect::isGlideWindow(EffectWindow* w) | 215 | bool GlideEffect::isGlideWindow(EffectWindow* w) | ||
207 | { | 216 | { | ||
208 | if (effects->activeFullScreenEffect()) | 217 | if (effects->activeFullScreenEffect()) | ||
209 | return false; | 218 | return false; | ||
210 | if (!w->isVisible()) | 219 | if (!w->isVisible()) | ||
211 | return false; | 220 | return false; | ||
221 | if (s_blacklist.contains(w->windowClass())) | ||||
222 | return false; | ||||
212 | if (w->data(IsGlideWindow).toBool()) | 223 | if (w->data(IsGlideWindow).toBool()) | ||
213 | return true; | 224 | return true; | ||
214 | if (w->hasDecoration()) | 225 | if (w->hasDecoration()) | ||
215 | return true; | 226 | return true; | ||
216 | if (!w->isManaged() || w->isMenu() || w->isNotification() || w->isDesktop() || | 227 | if (!w->isManaged() || w->isMenu() || w->isNotification() || w->isDesktop() || | ||
217 | w->isDock() || w->isSplash() || w->isToolbar()) | 228 | w->isDock() || w->isSplash() || w->isToolbar()) | ||
218 | return false; | 229 | return false; | ||
219 | return true; | 230 | return true; | ||
Show All 35 Lines |
Any particular reason for using a QSet? (just curious)