From 16a98829a664403f2fb8962884701f5d4d31cacd Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 12 Oct 2018 10:36:23 +0200 Subject: Client: Don't spam expose events Only send expose event when the geometry actually changed. Change-Id: Ic06986ce5d11e0ff7a842303f57093b8ff25b9f6 Reviewed-by: Paul Olav Tvete Reviewed-by: David Edmundson --- src/client/qwaylandwindow.cpp | 5 ++++- src/client/qwaylandwindow_p.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 1801c2a4b..4ac2ca51e 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -338,7 +338,9 @@ void QWaylandWindow::setGeometry(const QRect &rect) mSentInitialResize = true; } - sendExposeEvent(QRect(QPoint(), geometry().size())); + QRect exposeGeometry(QPoint(), geometry().size()); + if (exposeGeometry != mLastExposeGeometry) + sendExposeEvent(exposeGeometry); } void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) @@ -356,6 +358,7 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect) { if (!(mShellSurface && mShellSurface->handleExpose(rect))) QWindowSystemInterface::handleExposeEvent(window(), rect); + mLastExposeGeometry = rect; } diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index ad24b7358..56ebd3cc6 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -254,6 +254,7 @@ private: void handleScreenChanged(); bool mUpdateRequested = false; + QRect mLastExposeGeometry; static const wl_callback_listener callbackListener; static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time); -- cgit v1.2.3