diff options
author | Błażej Szczygieł <spaz16@wp.pl> | 2016-06-11 18:39:23 +0200 |
---|---|---|
committer | Błażej Szczygieł <spaz16@wp.pl> | 2016-06-30 06:51:48 +0000 |
commit | e2665600c09358854bb0b29389cc873a2684f77b (patch) | |
tree | 7bf35ce49c9d62959b96755fce17000e94067fdc /tests/auto | |
parent | 25f040820ce3cd97868f7e432e612532bfdca962 (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 'tests/auto')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 892dc0899f..70446e803a 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -58,6 +58,7 @@ private slots: void setVisible(); void eventOrderOnShow(); void resizeEventAfterResize(); + void exposeEventOnShrink_QTBUG54040(); void mapGlobal(); void positioning_data(); void positioning(); @@ -373,6 +374,24 @@ void tst_QWindow::resizeEventAfterResize() QTRY_COMPARE(window.received(QEvent::Resize), 2); } +void tst_QWindow::exposeEventOnShrink_QTBUG54040() +{ + Window window; + window.setGeometry(QRect(m_availableTopLeft + QPoint(80, 80), m_testWindowSize)); + window.setTitle(QTest::currentTestFunction()); + window.showNormal(); + + QVERIFY(QTest::qWaitForWindowExposed(&window)); + + const int initialExposeCount = window.received(QEvent::Expose); + window.resize(window.width(), window.height() - 5); + QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 1); + window.resize(window.width() - 5, window.height()); + QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 2); + window.resize(window.width() - 5, window.height() - 5); + QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 3); +} + void tst_QWindow::positioning_data() { QTest::addColumn<int>("windowflags"); |