diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 45eea327193..8c553c27fb3 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -60,8 +60,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) mFrameCallbackTimeout = frameCallbackTimeout; } - static WId id = 1; - mWindowId = id++; initializeWlSurface(); connect(this, &QWaylandWindow::wlSurfaceCreated, this, @@ -351,7 +349,7 @@ QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface) WId QWaylandWindow::winId() const { - return mWindowId; + return reinterpret_cast(wlSurface()); } void QWaylandWindow::setParent(const QPlatformWindow *parent) diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index 6227cda4eba..bb8c5b18826 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -295,7 +295,6 @@ protected: GestureState mGestureState = GestureNotActive; #endif - WId mWindowId; bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out int mFrameCallbackCheckIntervalTimerId = -1; QAtomicInt mWaitingForUpdateDelivery = false;