Client: Optimize set_window_geometry calls by caching last geometry
When a QtWayland client window is initialized or resized, set_window_geometry may be called multiple times with the same geometry, resulting in redundant protocol messages to the compositor. According to: 904a00fc9e8e0547dce3f70b5b205f6c70cfd414 Fixes: QTBUG-136723 Change-Id: I2e993e2b185f30d57503b5a3ce7ab63ba46afec2 Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
parent
c9ab69d4e3
commit
0de9b81a8c
@ -435,6 +435,7 @@ void QWaylandXdgSurface::applyConfigure()
|
|||||||
if (m_popup)
|
if (m_popup)
|
||||||
m_popup->applyConfigure();
|
m_popup->applyConfigure();
|
||||||
|
|
||||||
|
setContentGeometry(window()->windowContentGeometry());
|
||||||
window()->updateExposure();
|
window()->updateExposure();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,8 +451,11 @@ void QWaylandXdgSurface::propagateSizeHints()
|
|||||||
|
|
||||||
void QWaylandXdgSurface::setContentGeometry(const QRect &rect)
|
void QWaylandXdgSurface::setContentGeometry(const QRect &rect)
|
||||||
{
|
{
|
||||||
if (window()->isExposed())
|
if (!window()->isExposed() || m_lastGeometry == rect)
|
||||||
set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height());
|
return;
|
||||||
|
|
||||||
|
set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height());
|
||||||
|
m_lastGeometry = rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandXdgSurface::setSizeHints()
|
void QWaylandXdgSurface::setSizeHints()
|
||||||
|
@ -161,6 +161,7 @@ private:
|
|||||||
QString m_activationToken;
|
QString m_activationToken;
|
||||||
QString m_appId;
|
QString m_appId;
|
||||||
bool m_alertState = false;
|
bool m_alertState = false;
|
||||||
|
QRect m_lastGeometry;
|
||||||
|
|
||||||
friend class QWaylandXdgShell;
|
friend class QWaylandXdgShell;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user