Do not invalidate the entire window on window move on WASM

The invalidate on window move is redundant - the previous texture can
be reused for the window. Just request another refresh on the compositor
and don't update the window texture. Makes window moves smoother.

Pick-to: 6.4
Change-Id: Ied2922a000d3c8e6143e64d029154d74bc4f3480
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Mikolaj Boc 2022-08-17 08:42:20 +02:00
parent 2a23652bbb
commit 503018ae07
2 changed files with 9 additions and 2 deletions

View File

@ -962,6 +962,8 @@ bool QWasmCompositor::processPointer(const PointerEvent& event)
}
m_windowManipulation.onPointerMove(event);
if (m_windowManipulation.operation() != WindowManipulation::Operation::None)
requestUpdate();
break;
}
case EventType::PointerEnter:

View File

@ -84,11 +84,16 @@ void QWasmWindow::setGeometry(const QRect &rect)
if (r.y() < yMin)
r.moveTop(yMin);
}
if (!m_windowState.testFlag(Qt::WindowFullScreen) && !m_windowState.testFlag(Qt::WindowMaximized))
bool shouldInvalidate = true;
if (!m_windowState.testFlag(Qt::WindowFullScreen)
&& !m_windowState.testFlag(Qt::WindowMaximized)) {
shouldInvalidate = m_normalGeometry.size() != r.size();
m_normalGeometry = r;
}
QPlatformWindow::setGeometry(r);
QWindowSystemInterface::handleGeometryChange(window(), r);
invalidate();
if (shouldInvalidate)
invalidate();
}
void QWasmWindow::setVisible(bool visible)