wayland: Fix SurfaceInterface::bufferSourceBox() when the viewport source rect is unset

Vscode starts with a valid source rect but it resets it eventually by
calling wp_viewport.set_source(-1, -1, -1, -1).

On the other hand, `current.viewport.sourceGeometryIsSet` would be true
if that happens.

SurfaceInterface::bufferSourceBox() should use the buffer size when the
source rect has been unset otherwise the damage handling code will be
confused and it's likely that the scene won't issue repaint requests.
This commit is contained in:
Vlad Zahorodnii 2023-07-26 10:52:11 +00:00
parent 762254c354
commit febdee08b9

View file

@ -787,7 +787,7 @@ QRegion SurfaceInterface::input() const
QRectF SurfaceInterface::bufferSourceBox() const
{
if (!d->current.viewport.sourceGeometryIsSet) {
if (!d->current.viewport.sourceGeometry.isValid()) {
return QRectF(0, 0, d->bufferSize.width(), d->bufferSize.height());
}