diff --git a/plugins/qpa/window.cpp b/plugins/qpa/window.cpp
index 93e6d7fee8..12431d360b 100644
--- a/plugins/qpa/window.cpp
+++ b/plugins/qpa/window.cpp
@@ -130,6 +130,9 @@ void Window::createEglSurface(EGLDisplay dpy, EGLConfig config)
return;
}
m_eglSurface = eglCreateWindowSurface(dpy, config, m_eglWaylandWindow, nullptr);
+#else
+ Q_UNUSED(dpy)
+ Q_UNUSED(config)
#endif
}
diff --git a/plugins/qpa/window.h b/plugins/qpa/window.h
index dc02902880..76f8cd2cb7 100644
--- a/plugins/qpa/window.h
+++ b/plugins/qpa/window.h
@@ -31,7 +31,9 @@ along with this program. If not, see .
class QOpenGLFramebufferObject;
+#if HAVE_WAYLAND_EGL
struct wl_egl_window;
+#endif
namespace KWayland
{
@@ -87,7 +89,9 @@ private:
QSharedPointer m_contentFBO;
bool m_resized = false;
ShellClient *m_shellClient = nullptr;
+#if HAVE_WAYLAND_EGL
wl_egl_window *m_eglWaylandWindow = nullptr;
+#endif
quint32 m_windowId;
const Integration *m_integration;
};