summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandscreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/qwaylandscreen.cpp')
-rw-r--r--src/client/qwaylandscreen.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp
index 38d61f88c..1fe0125e6 100644
--- a/src/client/qwaylandscreen.cpp
+++ b/src/client/qwaylandscreen.cpp
@@ -199,8 +199,9 @@ QWaylandScreen * QWaylandScreen::waylandScreenFromWindow(QWindow *window)
QWaylandScreen *QWaylandScreen::fromWlOutput(::wl_output *output)
{
- auto wlOutput = static_cast<QtWayland::wl_output *>(wl_output_get_user_data(output));
- return static_cast<QWaylandScreen *>(wlOutput);
+ if (auto *o = QtWayland::wl_output::fromObject(output))
+ return static_cast<QWaylandScreen *>(o);
+ return nullptr;
}
void QWaylandScreen::output_mode(uint32_t flags, int width, int height, int refresh)