diff --git a/src/gui/kernel/qplatformscreen_p.h b/src/gui/kernel/qplatformscreen_p.h index c47cee2746..f7c9d94154 100644 --- a/src/gui/kernel/qplatformscreen_p.h +++ b/src/gui/kernel/qplatformscreen_p.h @@ -24,6 +24,10 @@ #include #endif +#if defined(Q_OS_UNIX) +struct wl_output; +#endif + QT_BEGIN_NAMESPACE class QScreen; @@ -80,6 +84,14 @@ struct Q_GUI_EXPORT QWindowsScreen }; #endif +#if defined(Q_OS_UNIX) || defined(Q_CLANG_QDOC) +struct Q_GUI_EXPORT QWaylandScreen +{ + QT_DECLARE_NATIVE_INTERFACE(QWaylandScreen, 1, QScreen) + virtual wl_output *output() const = 0; +}; +#endif + } // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index ecdf2bb54f..efaba3e426 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -759,6 +759,10 @@ void *QScreen::resolveInterface(const char *name, int revision) const QT_NATIVE_INTERFACE_RETURN_IF(QWindowsScreen, platformScreen); #endif +#if defined(Q_OS_UNIX) + QT_NATIVE_INTERFACE_RETURN_IF(QWaylandScreen, platformScreen); +#endif + return nullptr; } diff --git a/src/gui/platform/unix/qunixnativeinterface.cpp b/src/gui/platform/unix/qunixnativeinterface.cpp index 7d60d325c7..1b9c6eb4f0 100644 --- a/src/gui/platform/unix/qunixnativeinterface.cpp +++ b/src/gui/platform/unix/qunixnativeinterface.cpp @@ -258,6 +258,17 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QEvdevKeyMapper); QT_DEFINE_NATIVE_INTERFACE(QWaylandApplication); +/*! + \class QNativeInterface::Private::QWaylandScreen + \since 6.5 + \internal + \brief Native interface to QPlatformScreen. + \inmodule QtGui + \ingroup native-interfaces +*/ + +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWaylandScreen); + #endif // Q_OS_UNIX QT_END_NAMESPACE