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 --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/auto') 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("windowflags"); -- cgit v1.2.3