diff --git a/libkwineffects/kwinanimationeffect.cpp b/libkwineffects/kwinanimationeffect.cpp index 7b0e780403..5c114af7d2 100644 --- a/libkwineffects/kwinanimationeffect.cpp +++ b/libkwineffects/kwinanimationeffect.cpp @@ -284,6 +284,7 @@ void AnimationEffect::prePaintScreen( ScreenPrePaintData& data, int time ) AniData *aData = &(*anim); if (aData->attribute == KWin::AnimationEffect::CrossFadePrevious) { oldW->unreferencePreviousWindowPixmap(); + effects->addRepaint(oldW->expandedGeometry()); } animationEnded(oldW, anim->attribute, anim->meta); // NOTICE animationEnded is an external call and might have called "::animate" diff --git a/scene_opengl.cpp b/scene_opengl.cpp index e62829f33f..e82c50767d 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -50,7 +50,7 @@ along with this program. If not, see . #include "screens.h" #include "workspace.h" -#include +#include #include #include @@ -1357,26 +1357,33 @@ void SceneOpenGL2Window::setupLeafNodes(LeafNode *nodes, const WindowQuadList *q getDecorationTextures(textures); nodes[LeftRightLeaf].texture = textures[0]; - nodes[LeftRightLeaf].opacity = data.opacity() * data.decorationOpacity(); + nodes[LeftRightLeaf].opacity = data.opacity(); nodes[LeftRightLeaf].hasAlpha = true; nodes[LeftRightLeaf].coordinateType = UnnormalizedCoordinates; nodes[TopBottomLeaf].texture = textures[1]; - nodes[TopBottomLeaf].opacity = data.opacity() * data.decorationOpacity(); + nodes[TopBottomLeaf].opacity = data.opacity(); nodes[TopBottomLeaf].hasAlpha = true; nodes[TopBottomLeaf].coordinateType = UnnormalizedCoordinates; } nodes[ContentLeaf].texture = s_frameTexture; nodes[ContentLeaf].hasAlpha = !isOpaque(); - nodes[ContentLeaf].opacity = data.opacity(); + // TODO: ARGB crsoofading is atm. a hack, playing on opacities for two dumb SrcOver operations + // Should be a shader + if (data.crossFadeProgress() != 1.0 && (data.opacity() < 0.95 || toplevel->hasAlpha())) { + const float opacity = 1.0 - data.crossFadeProgress(); + nodes[ContentLeaf].opacity = data.opacity() * (1 - pow(opacity, 1.0f + 2.0f * data.opacity())); + } else { + nodes[ContentLeaf].opacity = data.opacity(); + } nodes[ContentLeaf].coordinateType = UnnormalizedCoordinates; if (data.crossFadeProgress() != 1.0) { OpenGLWindowPixmap *previous = previousWindowPixmap(); nodes[PreviousContentLeaf].texture = previous ? previous->texture() : NULL; nodes[PreviousContentLeaf].hasAlpha = !isOpaque(); - nodes[PreviousContentLeaf].opacity = 1.0 - data.crossFadeProgress(); + nodes[PreviousContentLeaf].opacity = data.opacity() * (1.0 - data.crossFadeProgress()); nodes[PreviousContentLeaf].coordinateType = NormalizedCoordinates; } } @@ -1607,7 +1614,14 @@ void SceneOpenGL1Window::performPaint(int mask, QRegion region, WindowPaintData OpenGLWindowPixmap *previous = previousWindowPixmap(); const WindowQuadList contentQuads = data.quads.select(WindowQuadContents); if (previous && data.crossFadeProgress() != 1.0) { - paintContent(s_frameTexture, region, mask, data.opacity(), data, contentQuads, false); + // TODO: ARGB crsoofading is atm. a hack, playing on opacities for two dumb SrcOver operations + // Will require a caching texture or sth. else 1.2 compliant + float opacity = data.opacity(); + if (opacity < 0.95f || toplevel->hasAlpha()) { + opacity = 1 - data.crossFadeProgress(); + opacity = data.opacity() * (1 - pow(opacity, 1.0f + 2.0f * data.opacity())); + } + paintContent(s_frameTexture, region, mask, opacity, data, contentQuads, false); previous->texture()->setFilter(filter == Scene::ImageFilterGood ? GL_LINEAR : GL_NEAREST); WindowQuadList oldContents; const QRect &oldGeometry = previous->contentsRect(); @@ -1628,7 +1642,8 @@ void SceneOpenGL1Window::performPaint(int mask, QRegion region, WindowPaintData } oldContents.append(newQuad); } - paintContent(previous->texture(), region, mask, 1.0 - data.crossFadeProgress(), data, oldContents, true); + opacity = data.opacity() * (1.0 - data.crossFadeProgress()); + paintContent(previous->texture(), region, mask, opacity, data, oldContents, true); } else { paintContent(s_frameTexture, region, mask, data.opacity(), data, contentQuads, false); } diff --git a/tabbox/declarative.cpp b/tabbox/declarative.cpp index 18e0a21d5a..97a89c38fe 100644 --- a/tabbox/declarative.cpp +++ b/tabbox/declarative.cpp @@ -328,6 +328,8 @@ void DeclarativeView::currentIndexChanged(int row) void DeclarativeView::updateQmlSource(bool force) { + if (status() != Ready) + return; if (tabBox->config().tabBoxMode() != m_mode) { return; } diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 169c7bac37..f0e0ffe8cb 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -33,6 +33,7 @@ along with this program. If not, see . #include // KDE #include +#include #include namespace KWin @@ -216,19 +217,29 @@ void TabBoxHandler::show() d->lastRaisedClient = 0; d->lastRaisedClientSucc = 0; if (d->config.isShowTabBox()) { + DeclarativeView *dv(NULL); if (d->config.tabBoxMode() == TabBoxConfig::ClientTabBox) { // use declarative view if (!d->m_declarativeView) { d->m_declarativeView = new DeclarativeView(d->clientModel(), TabBoxConfig::ClientTabBox); } - d->m_declarativeView->show(); - d->m_declarativeView->setCurrentIndex(d->index, true); + dv = d->m_declarativeView; } else { if (!d->m_declarativeDesktopView) { d->m_declarativeDesktopView = new DeclarativeView(d->desktopModel(), TabBoxConfig::DesktopTabBox); } - d->m_declarativeDesktopView->show(); - d->m_declarativeDesktopView->setCurrentIndex(d->index); + dv = d->m_declarativeDesktopView; + } + if (dv->status() == QDeclarativeView::Ready && dv->rootObject()) { + dv->show(); + dv->setCurrentIndex(d->index, d->config.tabBoxMode() == TabBoxConfig::ClientTabBox); + } else { + QStringList args; + args << "--passivepopup" << /*i18n*/("The Window Switcher installation is broken, resources are missing.\n" + "Contact your distribution about this.") << "20"; + KProcess::startDetached("kdialog", args); + hide(); + return; } } if (d->config.isHighlightWindows()) {