Merge branch 'Plasma/5.4'

This commit is contained in:
Thomas Lübking 2015-08-27 22:54:11 +02:00
commit f477480237
4 changed files with 22 additions and 3 deletions

View file

@ -298,7 +298,8 @@ void TestXcbWrapper::testTransientFor()
// Create a Window with a transient for hint
Window transientWindow(createWindow());
transientWindow.changeProperty(XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32, 1, &m_testWindow);
xcb_window_t testWindowId = m_testWindow;
transientWindow.changeProperty(XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32, 1, &testWindowId);
// let's get another transient object
TransientFor realTransient(transientWindow);

View file

@ -385,7 +385,7 @@ bool BlurEffect::shouldBlur(const EffectWindow *w, int mask, const WindowPaintDa
bool blurBehindDecos = effects->decorationsHaveAlpha() &&
effects->decorationSupportsBlurBehind();
if (!w->hasAlpha() && !(blurBehindDecos && w->hasDecoration()))
if (!w->hasAlpha() && w->opacity() >= 1.0 && !(blurBehindDecos && w->hasDecoration()))
return false;
return true;
@ -479,7 +479,14 @@ void BlurEffect::doBlur(const QRegion& shape, const QRect& screen, const float o
// Modulate the blurred texture with the window opacity if the window isn't opaque
if (opacity < 1.0) {
glEnable(GL_BLEND);
glBlendColor(0, 0, 0, opacity);
#if 1 // bow shape, always above y = x
float o = 1.0f-opacity;
o = 1.0f - o*o;
#else // sigmoid shape, above y = x for x > 0.5, below y = x for x < 0.5
float o = 2.0f*opacity - 1.0f;
o = 0.5f + o / (1.0f + qAbs(o));
#endif
glBlendColor(0, 0, 0, o);
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
}

View file

@ -153,7 +153,14 @@ void MagnifierEffect::paintScreen(int mask, QRegion region, ScreenPaintData& dat
m_fbo->blitFromFramebuffer(srcArea);
// paint magnifier
m_texture->bind();
auto s = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture);
QMatrix4x4 mvp;
const QSize size = effects->virtualScreenSize();
mvp.ortho(0, size.width(), size.height(), 0, 0, 65535);
mvp.translate(area.x(), area.y());
s->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
m_texture->render(infiniteRegion(), area);
ShaderManager::instance()->popShader();
m_texture->unbind();
QVector<float> verts;
GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer();

View file

@ -137,6 +137,10 @@ bool Edge::check(const QPoint &cursorPos, const QDateTime &triggerTime, bool for
if (!triggersFor(cursorPos)) {
return false;
}
if (m_lastTrigger.isValid() && // still in cooldown
m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold()) {
return false;
}
// no pushback so we have to activate at once
bool directActivate = forceNoPushBack || edges()->cursorPushBackDistance().isNull() || m_client;
if (directActivate || canActivate(cursorPos, triggerTime)) {