Changeset View
Changeset View
Standalone View
Standalone View
effects/highlightwindow/highlightwindow.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | 46 | | |||
47 | HighlightWindowEffect::~HighlightWindowEffect() | 47 | HighlightWindowEffect::~HighlightWindowEffect() | ||
48 | { | 48 | { | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | static bool isInitiallyHidden(EffectWindow* w) | 51 | static bool isInitiallyHidden(EffectWindow* w) | ||
52 | { | 52 | { | ||
53 | // Is the window initially hidden until it is highlighted? | 53 | // Is the window initially hidden until it is highlighted? | ||
54 | return w->isMinimized() || !w->isCurrentTab() || !w->isOnCurrentDesktop(); | 54 | return w->isMinimized() || !w->isOnCurrentDesktop(); | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | void HighlightWindowEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) | 57 | void HighlightWindowEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) | ||
58 | { | 58 | { | ||
59 | // Calculate window opacities | 59 | // Calculate window opacities | ||
60 | QHash<EffectWindow*, float>::iterator opacity = m_windowOpacity.find(w); | 60 | QHash<EffectWindow*, float>::iterator opacity = m_windowOpacity.find(w); | ||
61 | if (!m_highlightedWindows.isEmpty()) { | 61 | if (!m_highlightedWindows.isEmpty()) { | ||
62 | // Initial fade out and changing highlight animation | 62 | // Initial fade out and changing highlight animation | ||
Show All 29 Lines | 90 | if (*opacity > 0.98f || *opacity < 0.02f) { | |||
92 | opacity = m_windowOpacity.end(); | 92 | opacity = m_windowOpacity.end(); | ||
93 | } | 93 | } | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | // Show tabbed windows and windows on other desktops if highlighted | 96 | // Show tabbed windows and windows on other desktops if highlighted | ||
97 | if (opacity != m_windowOpacity.end() && *opacity > 0.01) { | 97 | if (opacity != m_windowOpacity.end() && *opacity > 0.01) { | ||
98 | if (w->isMinimized()) | 98 | if (w->isMinimized()) | ||
99 | w->enablePainting(EffectWindow::PAINT_DISABLED_BY_MINIMIZE); | 99 | w->enablePainting(EffectWindow::PAINT_DISABLED_BY_MINIMIZE); | ||
100 | if (!w->isCurrentTab()) | | |||
101 | w->enablePainting(EffectWindow::PAINT_DISABLED_BY_TAB_GROUP); | | |||
102 | if (!w->isOnCurrentDesktop()) | 100 | if (!w->isOnCurrentDesktop()) | ||
103 | w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP); | 101 | w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP); | ||
104 | } | 102 | } | ||
105 | 103 | | |||
106 | effects->prePaintWindow(w, data, time); | 104 | effects->prePaintWindow(w, data, time); | ||
107 | } | 105 | } | ||
108 | 106 | | |||
109 | void HighlightWindowEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) | 107 | void HighlightWindowEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) | ||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |