diff --git a/src/plugins/platforms/x11/standalone/eglbackend.cpp b/src/plugins/platforms/x11/standalone/eglbackend.cpp index bab676cb5e..49cf664d27 100644 --- a/src/plugins/platforms/x11/standalone/eglbackend.cpp +++ b/src/plugins/platforms/x11/standalone/eglbackend.cpp @@ -127,10 +127,10 @@ EglSurfaceTextureX11::EglSurfaceTextureX11(EglBackend *backend, SurfacePixmapX11 bool EglSurfaceTextureX11::create() { auto texture = new EglPixmapTexture(static_cast(m_backend)); - texture->create(m_pixmap); - - m_texture.reset(texture); - return !m_texture->isNull(); + if (texture->create(m_pixmap)) { + m_texture.reset(texture); + } + return !m_texture.isNull(); } void EglSurfaceTextureX11::update(const QRegion ®ion) @@ -186,7 +186,6 @@ bool EglPixmapTexturePrivate::create(SurfacePixmapX11 *pixmap) if (EGL_NO_IMAGE_KHR == m_image) { qCDebug(KWIN_CORE) << "failed to create egl image"; q->unbind(); - q->discard(); return false; } glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast(m_image)); diff --git a/src/plugins/platforms/x11/standalone/glxbackend.cpp b/src/plugins/platforms/x11/standalone/glxbackend.cpp index 42cd9492c9..a52c1e9b6a 100644 --- a/src/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/src/plugins/platforms/x11/standalone/glxbackend.cpp @@ -797,10 +797,10 @@ GlxSurfaceTextureX11::GlxSurfaceTextureX11(GlxBackend *backend, SurfacePixmapX11 bool GlxSurfaceTextureX11::create() { auto texture = new GlxPixmapTexture(static_cast(m_backend)); - texture->create(m_pixmap); - - m_texture.reset(texture); - return !m_texture->isNull(); + if (texture->create(m_pixmap)) { + m_texture.reset(texture); + } + return !m_texture.isNull(); } void GlxSurfaceTextureX11::update(const QRegion ®ion)