From 3632ef0fc7501802c3ae5f73c76cc97b2b1d61ce Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 30 Jun 2023 11:28:11 +0200 Subject: [PATCH] Fixed mouse pressed state for Linux (use memeber variable instead of static) --- src/FloatingDockContainer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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;