Skip to content

Commit b44a7e7

Browse files
Implemented workarund for NonClientArea mouse event bug in Qt versions > 5.9.2.
1 parent c9645ef commit b44a7e7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/FloatingDockContainer.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,18 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
313313

314314
if (isClosable())
315315
{
316-
QWidget::closeEvent(event);
316+
// In Qt version after 5.9.2 there seems to be a bug that causes the
317+
// QWidget::event() function to not receive any NonClientArea mouse
318+
// events anymore after a close/show cycle. The bug is reported here:
319+
// https://bugreports.qt.io/browse/QTBUG-73295
320+
// The following code is a workaround for Qt versions > 5.9.2 that seems
321+
// to work
322+
#if (QT_VERSION > 0x050902)
323+
event->ignore();
324+
this->hide();
325+
#else
326+
Super::closeEvent(event);
327+
#endif
317328
}
318329
else
319330
{

0 commit comments

Comments
 (0)