qt5base-lts/tests/auto/widgets/kernel/qwidget_window
Volker Hilsheimer ed86a4f253 Don't send QEvent::Hide to an already hidden top level widget
When hiding a popup by clicking outside of its area, a window is closed.
Depending on the platform specific implementation details, this can
result in multiple calls to QWidgetPrivate::setVisible(false). The first
one from the handling of the close event in QWidgetWindow::event; the
second from the destruction of the window in QWindow::event.

Since the first call already sets the Qt::WA_WState_Hidden flag before
calling QWidgetPrivate::hide_helper, we can test if the flag is set
and skip the second call if it is.

The included test does not reproduce the issue, as that issue only
reproduces if the close event is generated by the mouse event handling
in the Cocoa platform plugin (which doesn't call QWidget::close, but
rather sends a native close event to the platform window). However, it
verifies that the fix doesn't introduce any regressions.

Change-Id: Id0eda9326a8adf0cc1f6a3840f9ac0b635ab39a1
Fixes: QTBUG-79134
Pick-to: 5.15
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-24 17:40:36 +02:00
..
.gitignore
BLACKLIST xcb: Fix logic for minimized state 2020-03-03 22:08:18 +01:00
CMakeLists.txt Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qwidget_window.pro testlib: start sharing common helper functions 2017-11-04 20:11:22 +00:00
tst_qwidget_window.cpp Don't send QEvent::Hide to an already hidden top level widget 2020-04-24 17:40:36 +02:00