Commit d4c44220 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

effects/desktopgrid: Make the desktop grid not depend on nested prePaintWindow()

This is needed to allow the Compositor get the surface damage before
calling Scene::paint().
parent 0db64527
......@@ -352,16 +352,14 @@ void DesktopGridEffect::postPaintScreen()
void DesktopGridEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, std::chrono::milliseconds presentTime)
{
if (timeline.currentValue() != 0 || (isUsingPresentWindows() && isMotionManagerMovingWindows())) {
if (w->isOnDesktop(paintingDesktop)) {
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
if (w->isMinimized() && isUsingPresentWindows())
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_MINIMIZE);
data.mask |= PAINT_WINDOW_TRANSFORMED;
if (windowMove && wasWindowMove && windowMove->findModal() == w)
w->disablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
} else
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
if (w->isMinimized() && isUsingPresentWindows()) {
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_MINIMIZE);
}
if (windowMove && wasWindowMove && windowMove->findModal() == w) {
w->disablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
}
data.setTransformed();
}
effects->prePaintWindow(w, data, presentTime);
}
......@@ -369,6 +367,9 @@ void DesktopGridEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data
void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
if (timeline.currentValue() != 0 || (isUsingPresentWindows() && isMotionManagerMovingWindows())) {
if (!w->isOnDesktop(paintingDesktop)) {
return;
}
if (isUsingPresentWindows() && w == windowMove && wasWindowMove &&
((!wasWindowCopy && sourceDesktop == paintingDesktop) ||
(sourceDesktop != highlightedDesktop && highlightedDesktop == paintingDesktop))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment