Fixed handling on spontaneous hide events in CFloatingDockContainer for Linux

This commit is contained in:
Uwe Kindler 2019-11-28 14:08:42 +01:00
parent 2e88d8651e
commit 2ee7deb6d5

View File

@ -249,7 +249,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockManager *DockManager) :
QDockWidget::setFeatures(QDockWidget::AllDockWidgetFeatures); QDockWidget::setFeatures(QDockWidget::AllDockWidgetFeatures);
setTitleBarWidget(d->TitleBar); setTitleBarWidget(d->TitleBar);
connect(d->TitleBar, SIGNAL(closeRequested()), SLOT(close())); connect(d->TitleBar, SIGNAL(closeRequested()), SLOT(close()));
setAttribute(Qt::WA_X11NetWmWindowTypeDock, true);
#else #else
setWindowFlags( setWindowFlags(
Qt::Window | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint); Qt::Window | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
@ -384,6 +383,11 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
void CFloatingDockContainer::hideEvent(QHideEvent *event) void CFloatingDockContainer::hideEvent(QHideEvent *event)
{ {
Super::hideEvent(event); Super::hideEvent(event);
if (event->spontaneous())
{
return;
}
// Prevent toogleView() events during restore state // Prevent toogleView() events during restore state
if (d->DockManager->isRestoringState()) if (d->DockManager->isRestoringState())
{ {
@ -510,7 +514,7 @@ void CFloatingDockContainer::startFloating(const QPoint &DragStartMousePos,
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
if (DraggingFloatingWidget == DragState) if (DraggingFloatingWidget == DragState)
{ {
//setAttribute(Qt::WA_X11NetWmWindowTypeDock, true); setAttribute(Qt::WA_X11NetWmWindowTypeDock, true);
d->MouseEventHandler = MouseEventHandler; d->MouseEventHandler = MouseEventHandler;
if (d->MouseEventHandler) if (d->MouseEventHandler)
{ {
@ -620,7 +624,7 @@ void CFloatingDockContainer::finishDragging()
{ {
ADS_PRINT("CFloatingDockContainer::finishDragging"); ADS_PRINT("CFloatingDockContainer::finishDragging");
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
//setAttribute(Qt::WA_X11NetWmWindowTypeDock, false); setAttribute(Qt::WA_X11NetWmWindowTypeDock, false);
setWindowOpacity(1); setWindowOpacity(1);
activateWindow(); activateWindow();
if (d->MouseEventHandler) if (d->MouseEventHandler)