From e2665600c09358854bb0b29389cc873a2684f77b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Sat, 11 Jun 2016 18:39:23 +0200 Subject: xcb: Send expose event while shrinking windows Send synthesized expose event while shrinking the QWindow. This fixes the regression which can break some applications which need the paint events while shrinking the QWindow. Added auto test. Task-number: QTBUG-54040 Change-Id: Iaa992abba67f428237fa12c6cae56592b8fcadb0 Reviewed-by: Gatis Paeglis Reviewed-by: Louai Al-Khanji --- src/plugins/platforms/xcb/qxcbwindow.cpp | 9 +++++++++ src/plugins/platforms/xcb/qxcbwindow.h | 1 + 2 files changed, 10 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index fc04d6afc4..bf1fd2e177 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2102,6 +2102,15 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * // will make the comparison later. QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); + // Send the synthetic expose event on resize only when the window is shrinked, + // because the "XCB_GRAVITY_NORTH_WEST" flag doesn't send it automatically. + if (!m_oldWindowSize.isEmpty() + && (actualGeometry.width() < m_oldWindowSize.width() + || actualGeometry.height() < m_oldWindowSize.height())) { + QWindowSystemInterface::handleExposeEvent(window(), QRegion(0, 0, actualGeometry.width(), actualGeometry.height())); + } + m_oldWindowSize = actualGeometry.size(); + if (m_usingSyncProtocol && m_syncState == SyncReceived) m_syncState = SyncAndConfigureReceived; diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 9ad0153ca2..e7190b1733 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -256,6 +256,7 @@ protected: mutable QMargins m_frameMargins; QRegion m_exposeRegion; + QSize m_oldWindowSize; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; -- cgit v1.2.3