Changeset View
Changeset View
Standalone View
Standalone View
effects/desktopgrid/desktopgrid.cpp
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Line(s) | 142 | if (timeline.currentValue() != 0 || activated || (isUsingPresentWindows() && isMotionManagerMovingWindows())) { | |||
---|---|---|---|---|---|
157 | } | 157 | } | ||
158 | // PAINT_SCREEN_BACKGROUND_FIRST is needed because screen will be actually painted more than once, | 158 | // PAINT_SCREEN_BACKGROUND_FIRST is needed because screen will be actually painted more than once, | ||
159 | // so with normal screen painting second screen paint would erase parts of the first paint | 159 | // so with normal screen painting second screen paint would erase parts of the first paint | ||
160 | if (timeline.currentValue() != 0 || (isUsingPresentWindows() && isMotionManagerMovingWindows())) | 160 | if (timeline.currentValue() != 0 || (isUsingPresentWindows() && isMotionManagerMovingWindows())) | ||
161 | data.mask |= PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_BACKGROUND_FIRST; | 161 | data.mask |= PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_BACKGROUND_FIRST; | ||
162 | if (!activated && timeline.currentValue() == 0 && !(isUsingPresentWindows() && isMotionManagerMovingWindows())) | 162 | if (!activated && timeline.currentValue() == 0 && !(isUsingPresentWindows() && isMotionManagerMovingWindows())) | ||
163 | finish(); | 163 | finish(); | ||
164 | } | 164 | } | ||
165 | | ||||
166 | for (auto const &w : effects->stackingOrder()) { | ||||
graesslin: please don't use foreach for new code. There is a risk that it gets removed in Qt 6, see https… | |||||
qAsConst can't be used on functions, only variables. See: http://doc.qt.io/qt-5/qtglobal.html#qAsConst AFAIK for (auto const &w : effects->stackingOrder()) also operates on references, without deep copying, like qAsConst. anemeth: `qAsConst` can't be used on functions, only variables. See: http://doc.qt.io/qt-5/qtglobal. | |||||
167 | m_windowForceBlurRoleState[w] = w->data(WindowForceBlurRole).toBool(); | ||||
168 | w->setData(WindowForceBlurRole, QVariant(true)); | ||||
169 | } | ||||
170 | | ||||
165 | effects->prePaintScreen(data, time); | 171 | effects->prePaintScreen(data, time); | ||
166 | } | 172 | } | ||
167 | 173 | | |||
168 | void DesktopGridEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | 174 | void DesktopGridEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | ||
169 | { | 175 | { | ||
170 | if (timeline.currentValue() == 0 && !isUsingPresentWindows()) { | 176 | if (timeline.currentValue() == 0 && !isUsingPresentWindows()) { | ||
171 | effects->paintScreen(mask, region, data); | 177 | effects->paintScreen(mask, region, data); | ||
172 | return; | 178 | return; | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 249 | if (activated) { | |||
244 | for (int i = 0; i < effects->numberOfDesktops(); i++) { | 250 | for (int i = 0; i < effects->numberOfDesktops(); i++) { | ||
245 | if (hoverTimeline[i]->currentValue() != 0.0 && hoverTimeline[i]->currentValue() != 1.0) { | 251 | if (hoverTimeline[i]->currentValue() != 0.0 && hoverTimeline[i]->currentValue() != 1.0) { | ||
246 | // Repaint during soft highlighting | 252 | // Repaint during soft highlighting | ||
247 | effects->addRepaintFull(); | 253 | effects->addRepaintFull(); | ||
248 | break; | 254 | break; | ||
249 | } | 255 | } | ||
250 | } | 256 | } | ||
251 | } | 257 | } | ||
258 | | ||||
259 | for (auto &w : effects->stackingOrder()) { | ||||
260 | w->setData(WindowForceBlurRole, m_windowForceBlurRoleState.value(w, false)); | ||||
261 | } | ||||
262 | | ||||
252 | effects->postPaintScreen(); | 263 | effects->postPaintScreen(); | ||
253 | } | 264 | } | ||
254 | 265 | | |||
255 | //----------------------------------------------------------------------------- | 266 | //----------------------------------------------------------------------------- | ||
256 | // Window painting | 267 | // Window painting | ||
257 | 268 | | |||
258 | void DesktopGridEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) | 269 | void DesktopGridEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) | ||
259 | { | 270 | { | ||
▲ Show 20 Lines • Show All 1202 Lines • Show Last 20 Lines |
please don't use foreach for new code. There is a risk that it gets removed in Qt 6, see https://www.kdab.com/goodbye-q_foreach/
use
instead