Fixed mouse pressed state for Linux (use memeber variable instead of static)

This commit is contained in:
Uwe Kindler 2023-06-30 11:28:11 +02:00
parent 5a00eece87
commit 8d4507e9d8

View File

@ -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;