diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:30:13 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:30:13 +0300 |
commit | 2ce7b8d2c5355d91642256d9260222d211cc368c (patch) | |
tree | 31adf9ce81bcd65294a4d03c51c002b9811095d4 /src/compositor/extensions/qwaylandviewporter.cpp | |
parent | 96f7165dd1200ca63330dd44660d309e761fd522 (diff) | |
parent | a9cadc1dcfb282bec1a3ca01f2f4d93b9999e4f3 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Change-Id: I42a0e780eea6d92f0463566e5ab9b23efc9f49b7
Diffstat (limited to 'src/compositor/extensions/qwaylandviewporter.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandviewporter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/compositor/extensions/qwaylandviewporter.cpp b/src/compositor/extensions/qwaylandviewporter.cpp index b98274b1b..c34e3d0dd 100644 --- a/src/compositor/extensions/qwaylandviewporter.cpp +++ b/src/compositor/extensions/qwaylandviewporter.cpp @@ -149,14 +149,16 @@ void QWaylandViewporterPrivate::Viewport::checkCommittedState() return; } - QRectF max = QRectF(QPointF(), m_surface->bufferSize() / m_surface->bufferScale()); - // We can't use QRectF.contains, because that would return false for values on the border - if (max.united(source) != max) { - wl_resource_post_error(resource()->handle, error_out_of_buffer, - "source %f,%f, %fx%f extends outside attached buffer %fx%f", - source.x(), source.y(), source.width(), source.height(), - max.width(), max.height()); - return; + if (m_surface->bufferSize().isValid()) { + QRectF max = QRectF(QPointF(), m_surface->bufferSize() / m_surface->bufferScale()); + // We can't use QRectF.contains, because that would return false for values on the border + if (max.united(source) != max) { + wl_resource_post_error(resource()->handle, error_out_of_buffer, + "source %f,%f, %fx%f extends outside attached buffer %fx%f", + source.x(), source.y(), source.width(), source.height(), + max.width(), max.height()); + return; + } } } |