mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
Fixed mouse pressed state for Linux (use memeber variable instead of static)
This commit is contained in:
parent
5a00eece87
commit
8d4507e9d8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user