diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 6 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index ccebf43d..681f82f4 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -336,6 +336,8 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis << "It may also cause the event loop to freeze in some situations"; } + m_supportSurfaceLessContext = q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context"); + updateGLFormat(); } @@ -439,6 +441,10 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) eglSurface = window->eglSurface(); } + if (eglSurface == EGL_NO_SURFACE && m_supportSurfaceLessContext) { + return false; + } + if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) { qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this); window->setCanResize(true); diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h index 46c7bb76..93edaec0 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h @@ -93,6 +93,7 @@ private: DecorationsBlitter *m_blitter = nullptr; uint m_api; bool m_supportNonBlockingSwap = true; + bool m_supportSurfaceLessContext = false; }; } |