From aff3a43bf067656d326bb17f31ee097684213c22 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 11 Jan 2024 20:54:34 +0100 Subject: [PATCH] QWaylandDisplay: Allow software-only deco and don't init GL needlessly Don't initialize the client buffer integration just to check whether it can do a decoration. If we had a GL window, it would have initialized GL already. Also, we can do software-rendered decorations nowadays, only disable them if the integration explicitly says it can't. Change-Id: I396d32796a10ccffd6ef3bb0c5eaa3a1078b8d79 Reviewed-by: Ilya Fedin Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 265f0bb3f19..07fbe0b4105 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -891,7 +891,12 @@ bool QWaylandDisplay::supportsWindowDecoration() const if (disabled) return false; - static bool integrationSupport = clientBufferIntegration() && clientBufferIntegration()->supportsWindowDecoration(); + // Don't initialize client buffer integration just to check whether it can have a decoration. + if (!mWaylandIntegration->mClientBufferIntegrationInitialized) + return true; + + // We can do software-rendered decorations, only disable them if the integration explicitly says it can't. + static bool integrationSupport = !clientBufferIntegration() || clientBufferIntegration()->supportsWindowDecoration(); return integrationSupport; }