diff --git a/autotests/test_gbm_surface.cpp b/autotests/test_gbm_surface.cpp index 95ee363865..17268c9c1e 100644 --- a/autotests/test_gbm_surface.cpp +++ b/autotests/test_gbm_surface.cpp @@ -78,7 +78,7 @@ private Q_SLOTS: void GbmSurfaceTest::testCreate() { GbmSurface surface(nullptr, 2, 3, 4, 5); - gbm_surface *native = surface; + gbm_surface *native = surface.surface(); QVERIFY(surface); QCOMPARE(native->width, 2u); QCOMPARE(native->height, 3u); @@ -91,7 +91,7 @@ void GbmSurfaceTest::testCreateFailure() gbm_device dev{true}; GbmSurface surface(&dev, 2, 3, 4, 5); QVERIFY(!surface); - gbm_surface *native = surface; + gbm_surface *native = surface.surface(); QVERIFY(!native); } diff --git a/plugins/platforms/drm/egl_gbm_backend.cpp b/plugins/platforms/drm/egl_gbm_backend.cpp index 51792b5416..7083ecfab2 100644 --- a/plugins/platforms/drm/egl_gbm_backend.cpp +++ b/plugins/platforms/drm/egl_gbm_backend.cpp @@ -162,7 +162,7 @@ void EglGbmBackend::createOutput(DrmOutput *drmOutput) qCCritical(KWIN_DRM) << "Create gbm surface failed"; return; } - o.eglSurface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *)((gbm_surface*)o.gbmSurface.get()), nullptr); + o.eglSurface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *)(o.gbmSurface->surface()), nullptr); if (o.eglSurface == EGL_NO_SURFACE) { qCCritical(KWIN_DRM) << "Create Window Surface failed"; o.gbmSurface.reset(); diff --git a/plugins/platforms/drm/gbm_surface.h b/plugins/platforms/drm/gbm_surface.h index 6877a926c0..5eaa4c908b 100644 --- a/plugins/platforms/drm/gbm_surface.h +++ b/plugins/platforms/drm/gbm_surface.h @@ -42,7 +42,7 @@ public: return m_surface != nullptr; } - operator gbm_surface*() const { + gbm_surface* surface() const { return m_surface; }