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 <liang.qi@qt.io>
Reviewed-by: David Redondo <qt@david-redondo.de>
This commit is contained in:
David Edmundson 2024-03-14 09:09:46 +00:00
parent e30dbe924b
commit 3134fef6e4

View File

@ -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)));
}