From 3134fef6e40692070c2b6582fa41d49063da78c1 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 14 Mar 2024 09:09:46 +0000 Subject: [PATCH] client: Only use viewport when fractional scaling is in use Either viewport or wl_buffer.set_scale can be used to notify the compositor that the client has scaled it's contents, with viewport being more flexible and a requirement for fractional scaling. Unfortunately Gnome before 36 announces viewport support, but it does not work correctly. This patch workarounds that by only using the viewporter when we're using fractional scaling otherwise continue using the legacy path. Fixes: QTBUG-122412 Pick-to: 6.7 6.6 Change-Id: I9a01d9456ce91735051f8f53fb4b72add6961fcb Reviewed-by: Liang Qi Reviewed-by: David Redondo --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 84b73c0a46f..215193a7bf8 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -186,7 +186,9 @@ void QWaylandWindow::initWindow() } } - if (display()->viewporter()) { + // The fractional scale manager check is needed to work around Gnome < 36 where viewports don't work + // Right now viewports are only necessary when a fractional scale manager is used + if (display()->viewporter() && display()->fractionalScaleManager()) { mViewport.reset(new QWaylandViewport(display()->createViewport(this))); }