diff options
7 files changed, 21 insertions, 0 deletions
diff --git a/examples/wayland/multi-output/doc/src/multi-output.qdoc b/examples/wayland/multi-output/doc/src/multi-output.qdoc index 233b29ba..e57ffd02 100644 --- a/examples/wayland/multi-output/doc/src/multi-output.qdoc +++ b/examples/wayland/multi-output/doc/src/multi-output.qdoc @@ -38,4 +38,8 @@ WaylandSurface is displayed in a GridView on one of the outputs, while a ShellSurface associated with the WaylandSurface is displayed with desktop-style composition on the other output. + + \note In order to support multiple Wayland outputs in the same compositor, the + \l Qt::AA_ShareOpenGLContexts attribute must be set before the \l QGuiApplication + object is constructed. */ diff --git a/examples/wayland/multi-output/main.cpp b/examples/wayland/multi-output/main.cpp index 304b13c4..1edb18c3 100644 --- a/examples/wayland/multi-output/main.cpp +++ b/examples/wayland/multi-output/main.cpp @@ -57,6 +57,8 @@ int main(int argc, char *argv[]) { + // AA_ShareOpenGLContexts is required for compositors with multiple outputs + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QGuiApplication app(argc, argv); QQmlApplicationEngine appEngine(QUrl("qrc:///qml/main.qml")); diff --git a/examples/wayland/multi-screen/doc/src/multi-screen.qdoc b/examples/wayland/multi-screen/doc/src/multi-screen.qdoc index cd60213b..5e8e7455 100644 --- a/examples/wayland/multi-screen/doc/src/multi-screen.qdoc +++ b/examples/wayland/multi-screen/doc/src/multi-screen.qdoc @@ -42,4 +42,8 @@ * WaylandQuickItem::setPrimary() is called at appropriate times to set the * primary view for the ShellSurface, which is used when the client asks to be * maximized or fullscreen. + * + * \note In order to support multiple Wayland outputs in the same compositor, the + * \l Qt::AA_ShareOpenGLContexts attribute must be set before the \l QGuiApplication + * object is constructed. */ diff --git a/examples/wayland/multi-screen/main.cpp b/examples/wayland/multi-screen/main.cpp index 304b13c4..1edb18c3 100644 --- a/examples/wayland/multi-screen/main.cpp +++ b/examples/wayland/multi-screen/main.cpp @@ -57,6 +57,8 @@ int main(int argc, char *argv[]) { + // AA_ShareOpenGLContexts is required for compositors with multiple outputs + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QGuiApplication app(argc, argv); QQmlApplicationEngine appEngine(QUrl("qrc:///qml/main.qml")); diff --git a/examples/wayland/spanning-screens/doc/src/spanning-screens.qdoc b/examples/wayland/spanning-screens/doc/src/spanning-screens.qdoc index 3ab0b91f..2594a54c 100644 --- a/examples/wayland/spanning-screens/doc/src/spanning-screens.qdoc +++ b/examples/wayland/spanning-screens/doc/src/spanning-screens.qdoc @@ -33,4 +33,8 @@ * * Spanning screens is a Wayland compositor example that maximizes clients * across a top and a bottom screen. + * + * \note In order to support multiple Wayland outputs in the same compositor, the + * \l Qt::AA_ShareOpenGLContexts attribute must be set before the \l QGuiApplication + * object is constructed. */ diff --git a/examples/wayland/spanning-screens/main.cpp b/examples/wayland/spanning-screens/main.cpp index 435b4e3f..8efb6e04 100644 --- a/examples/wayland/spanning-screens/main.cpp +++ b/examples/wayland/spanning-screens/main.cpp @@ -57,6 +57,8 @@ int main(int argc, char *argv[]) { + // AA_ShareOpenGLContexts is required for compositors with multiple outputs + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QGuiApplication app(argc, argv); QQmlApplicationEngine appEngine(QUrl("qrc:///main.qml")); diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 0f5e79d8..3bdb0082 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -258,6 +258,9 @@ QWaylandOutput::QWaylandOutput() a screen managed by the WaylandCompositor. The type corresponds to the \c wl_output interface in the Wayland protocol. + + \note If the compositor has multiple Wayland outputs, the \l Qt::AA_ShareOpenGLContexts + attribute must be set before the \l QGuiApplication object is constructed. */ /*! |