Merge branch 'KDE/4.11'

icc-effect-5.14.5
Thomas Lübking 2013-08-06 09:15:26 +02:00
commit f1aa2417bd
4 changed files with 40 additions and 11 deletions

View File

@ -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"

View File

@ -50,7 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screens.h"
#include "workspace.h"
#include <math.h>
#include <cmath>
#include <unistd.h>
#include <stddef.h>
@ -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<OpenGLWindowPixmap>();
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<OpenGLWindowPixmap>();
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);
}

View File

@ -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;
}

View File

@ -33,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/Xlib.h>
// KDE
#include <KDebug>
#include <KProcess>
#include <KWindowSystem>
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()) {