summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorBłażej Szczygieł <spaz16@wp.pl>2016-06-11 18:39:23 +0200
committerBłażej Szczygieł <spaz16@wp.pl>2016-06-30 06:51:48 +0000
commite2665600c09358854bb0b29389cc873a2684f77b (patch)
tree7bf35ce49c9d62959b96755fce17000e94067fdc /src/plugins
parent25f040820ce3cd97868f7e432e612532bfdca962 (diff)
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 <gatis.paeglis@qt.io> Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp9
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
2 files changed, 10 insertions, 0 deletions
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;