From 31ce504f99cad08409947fd6edb448a2ba595785 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 8 Apr 2021 09:16:54 +0300 Subject: [PATCH] Fix layer-shell version selection logic If an app blindly binds a global, it may crash if the compositor supports slightly newer version of the protocol. --- src/qwaylandlayershellintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qwaylandlayershellintegration.cpp b/src/qwaylandlayershellintegration.cpp index f8a8b95..cdf3e91 100644 --- a/src/qwaylandlayershellintegration.cpp +++ b/src/qwaylandlayershellintegration.cpp @@ -35,7 +35,7 @@ void QWaylandLayerShellIntegration::registryLayer(void *data, struct wl_registry QWaylandLayerShellIntegration *shell = static_cast(data); if (interface == zwlr_layer_shell_v1_interface.name) - shell->m_layerShell = new QWaylandLayerShell(new QtWayland::zwlr_layer_shell_v1(registry, id, version)); + shell->m_layerShell = new QWaylandLayerShell(new QtWayland::zwlr_layer_shell_v1(registry, id, std::min(version, 3u))); } }