summaryrefslogtreecommitdiff
path: root/examples/wayland/multi-output/main.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-12-16 09:39:30 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-01-04 08:49:36 +0100
commit3054da0de0429f089b3325ed574a7f097bff68b3 (patch)
treef26803a88d21caad2ac1ce6f7f04cb9e578dc6f5 /examples/wayland/multi-output/main.cpp
parentfaeb189b9372b9aa6e1a8a50b9c0c7383f9c43d1 (diff)
downloadqtwayland-3054da0de0429f089b3325ed574a7f097bff68b3.tar.gz
Fix leak in multi-output compositor examples
When closing windows in e.g. multi-output, you will see warnings that textures are leaking because the current context is not shared with the context owning the texture. The way Qt Wayland Compositor internals are made, they depend on AA_ShareOpenGLContexts to be set, because buffers are consistently referenced across window/context boundaries. Change f1407493d6d25f24a3c71fbcedc00598baa44b56 mentions the requirement on EGLStreams, but this is also required on multi-output compositors to avoid leaks (and possibly sometimes crashes on some drivers). Task-number: QTBUG-87597 Change-Id: Ib0ccc61dee5dbc63704b0af1432fbf69645d39eb Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'examples/wayland/multi-output/main.cpp')
-rw-r--r--examples/wayland/multi-output/main.cpp2
1 files changed, 2 insertions, 0 deletions
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"));