diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index 427898f46d..398a1f2491 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -537,11 +537,15 @@ void GLTexture::clear() if (GLTexturePrivate::s_fbo) { // Clear the texture - glBindFramebuffer(GL_FRAMEBUFFER, GLTexturePrivate::s_fbo); + GLuint previousFramebuffer = 0; + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, reinterpret_cast(&previousFramebuffer)); + if (GLTexturePrivate::s_fbo != previousFramebuffer) + glBindFramebuffer(GL_FRAMEBUFFER, GLTexturePrivate::s_fbo); glClearColor(0, 0, 0, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, d->m_texture, 0); glClear(GL_COLOR_BUFFER_BIT); - glBindFramebuffer(GL_FRAMEBUFFER, 0); + if (GLTexturePrivate::s_fbo != previousFramebuffer) + glBindFramebuffer(GL_FRAMEBUFFER, previousFramebuffer); } else { if (const int size = width()*height()) { uint32_t *buffer = new uint32_t[size]; diff --git a/libkwineffects/kwingltexture.h b/libkwineffects/kwingltexture.h index f7e1b7b9e5..09474466a4 100644 --- a/libkwineffects/kwingltexture.h +++ b/libkwineffects/kwingltexture.h @@ -115,7 +115,6 @@ public: /** @short * Make the texture fully transparent - * Warning: this clobbers the current framebuffer binding except on fglrx */ void clear(); bool isDirty() const; diff --git a/wayland_server.cpp b/wayland_server.cpp index 77a8cb1159..c2f282e33a 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -210,7 +210,7 @@ public: } bool isTrustedOrigin(KWayland::Server::ClientConnection *client) const { - const auto fullPathSha = sha256(QStringLiteral("/proc/") + QString::number(client->processId()) + QLatin1String("/root") + client->executablePath()); + const auto fullPathSha = sha256(client->executablePath()); const auto localSha = sha256(QLatin1String("/proc/") + QString::number(client->processId()) + QLatin1String("/exe")); const bool trusted = !localSha.isEmpty() && fullPathSha == localSha;