summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandcompositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/compositor_api/qwaylandcompositor.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index 5b77a3be1..256aa42db 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -236,9 +236,12 @@ void QWaylandCompositorPrivate::init()
QWaylandCompositorPrivate::~QWaylandCompositorPrivate()
{
- qDeleteAll(clients);
+ // Take copies, since the lists will get modified as elements are deleted
+ const auto clientsToDelete = clients;
+ qDeleteAll(clientsToDelete);
- qDeleteAll(outputs);
+ const auto outputsToDelete = outputs;
+ qDeleteAll(outputsToDelete);
#if QT_CONFIG(wayland_datadevice)
delete data_device_manager;
@@ -365,6 +368,9 @@ void QWaylandCompositorPrivate::initializeHardwareIntegration()
loadClientBufferIntegration();
loadServerBufferIntegration();
+
+ if (client_buffer_integration)
+ client_buffer_integration->initializeHardware(display);
#endif
}
@@ -394,32 +400,12 @@ void QWaylandCompositorPrivate::loadClientBufferIntegration()
if (!targetKey.isEmpty()) {
client_buffer_integration.reset(QtWayland::ClientBufferIntegrationFactory::create(targetKey, QStringList()));
if (client_buffer_integration) {
- qCDebug(qLcWaylandCompositorHardwareIntegration) << "Loaded client buffer integration:" << targetKey;
client_buffer_integration->setCompositor(q);
- if (!client_buffer_integration->initializeHardware(display)) {
- qCWarning(qLcWaylandCompositorHardwareIntegration)
- << "Failed to initialize hardware for client buffer integration:" << targetKey;
- client_buffer_integration.reset();
- }
- } else {
- qCWarning(qLcWaylandCompositorHardwareIntegration)
- << "Failed to load client buffer integration:" << targetKey;
+ if (hw_integration)
+ hw_integration->setClientBufferIntegration(targetKey);
}
}
-
- if (!client_buffer_integration) {
- qCWarning(qLcWaylandCompositorHardwareIntegration)
- << "No client buffer integration was loaded, this means that clients will fall back"
- << "to use CPU buffers (wl_shm) for transmitting buffers instead of using zero-copy"
- << "GPU buffer handles. Expect serious performance impact with OpenGL clients due"
- << "to potentially multiple copies between CPU and GPU memory per buffer.\n"
- << "See the QtWayland readme for more info about how to build and configure Qt for"
- << "your device.";
- return;
- }
-
- if (client_buffer_integration && hw_integration)
- hw_integration->setClientBufferIntegration(targetKey);
+ //BUG: if there is no client buffer integration, bad things will happen when opengl is used
#endif
}