From b44a7e75ca49bc0dbdb69c98ea8a4eafce63149b Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Sat, 26 Jan 2019 14:44:14 +0100 Subject: [PATCH] Implemented workarund for NonClientArea mouse event bug in Qt versions > 5.9.2. --- src/FloatingDockContainer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/FloatingDockContainer.cpp b/src/FloatingDockContainer.cpp index df586ad..c3de7ee 100644 --- a/src/FloatingDockContainer.cpp +++ b/src/FloatingDockContainer.cpp @@ -313,7 +313,18 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event) if (isClosable()) { - QWidget::closeEvent(event); + // In Qt version after 5.9.2 there seems to be a bug that causes the + // QWidget::event() function to not receive any NonClientArea mouse + // events anymore after a close/show cycle. The bug is reported here: + // https://bugreports.qt.io/browse/QTBUG-73295 + // The following code is a workaround for Qt versions > 5.9.2 that seems + // to work +#if (QT_VERSION > 0x050902) + event->ignore(); + this->hide(); +#else + Super::closeEvent(event); +#endif } else {