diff --git a/src/FloatingDockContainer.cpp b/src/FloatingDockContainer.cpp index d6d9c02..377da6e 100644 --- a/src/FloatingDockContainer.cpp +++ b/src/FloatingDockContainer.cpp @@ -378,6 +378,7 @@ struct FloatingDockContainerPrivate QWidget* MouseEventHandler = nullptr; CFloatingWidgetTitleBar* TitleBar = nullptr; bool IsResizing = false; + bool MousePressed = false; #endif /** @@ -1328,12 +1329,12 @@ void CFloatingDockContainer::resizeEvent(QResizeEvent *event) Super::resizeEvent(event); } -static bool s_mousePressed = false; + //============================================================================ void CFloatingDockContainer::moveEvent(QMoveEvent *event) { Super::moveEvent(event); - if (!d->IsResizing && event->spontaneous() && s_mousePressed) + if (!d->IsResizing && event->spontaneous() && d->MousePressed) { d->setState(DraggingFloatingWidget); d->updateDropOverlays(QCursor::pos()); @@ -1349,10 +1350,10 @@ bool CFloatingDockContainer::event(QEvent *e) switch (e->type()) { case QEvent::WindowActivate: - s_mousePressed = false; + d->MousePressed = false; break; case QEvent::WindowDeactivate: - s_mousePressed = true; + d->MousePressed = true; break; default: break;