qt5base-lts/tests/auto/widgets/kernel
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
..
qaction Remove QGuiAction again and split QAction implementation up instead 2020-03-29 11:18:57 +01:00
qactiongroup Remove QGuiAction again and split QAction implementation up instead 2020-03-29 11:18:57 +01:00
qapplication Remove deprecated ApplicationAttribute enum values 2020-04-24 17:40:17 +02:00
qboxlayout Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qdesktopwidget cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
qformlayout Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qgesturerecognizer Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qgridlayout Remove deprecated QStyle enum values 2020-04-16 16:53:18 +02:00
qlayout Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qshortcut Merge remote-tracking branch 'origin/dev' into merge-dev 2020-01-24 13:17:33 +01:00
qsizepolicy Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qstackedlayout Merge remote-tracking branch 'origin/dev' into wip/cmake 2019-11-19 13:53:21 +01:00
qtooltip Merge remote-tracking branch 'origin/dev' into wip/cmake 2019-11-19 13:53:21 +01:00
qwidget Deprecate QGuiApplication::fontChanged() signal 2020-04-24 10:10:55 +02:00
qwidget_window Don't send QEvent::Hide to an already hidden top level widget 2020-04-24 17:40:36 +02:00
qwidgetaction Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qwidgetmetatype cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
qwidgetsvariant cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
qwindowcontainer Merge remote-tracking branch 'origin/dev' into wip/cmake 2019-11-19 13:53:21 +01:00
CMakeLists.txt cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
kernel.pro Fix inversed qmake logic for widget action tests 2020-02-20 09:05:28 +01:00