diff options
Diffstat (limited to 'src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp')
-rw-r--r-- | src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp b/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp index 9bdf8eb5..f4feb2e9 100644 --- a/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp @@ -155,6 +155,7 @@ public: EGLDisplay egl_display = EGL_NO_DISPLAY; bool display_bound = false; + ::wl_display *wlDisplay = nullptr; QOffscreenSurface *offscreenSurface = nullptr; QOpenGLContext *localContext = nullptr; QList<QOpenGLTexture *> orphanedTextures; @@ -282,7 +283,13 @@ WaylandEglStreamClientBufferIntegration::WaylandEglStreamClientBufferIntegration WaylandEglStreamClientBufferIntegration::~WaylandEglStreamClientBufferIntegration() { + Q_D(WaylandEglStreamClientBufferIntegration); WaylandEglStreamClientBufferIntegrationPrivate::shuttingDown = true; + if (d->egl_unbind_wayland_display != nullptr && d->display_bound) { + Q_ASSERT(d->wlDisplay != nullptr); + if (!d->egl_unbind_wayland_display(d->egl_display, d->wlDisplay)) + qCWarning(qLcWaylandCompositorHardwareIntegration) << "eglUnbindWaylandDisplayWL failed"; + } } void WaylandEglStreamClientBufferIntegration::attachEglStreamConsumer(struct ::wl_resource *wl_surface, struct ::wl_resource *wl_buffer) @@ -336,14 +343,10 @@ void WaylandEglStreamClientBufferIntegration::initializeHardware(struct wl_displ if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) { d->display_bound = d->egl_bind_wayland_display(d->egl_display, display); - if (!d->display_bound) { - if (!ignoreBindDisplay) { - qWarning("QtCompositor: Failed to initialize EGL display. Could not bind Wayland display."); - return; - } else { - qWarning("QtCompositor: Could not bind Wayland display. Ignoring."); - } - } + if (!d->display_bound) + qCDebug(qLcWaylandCompositorHardwareIntegration) << "Wayland display already bound by other client buffer integration."; + + d->wlDisplay = display; } d->eglStreamController = new WaylandEglStreamController(display, this); |