38
38
#include < QCursor>
39
39
40
40
#include " DockManager.h"
41
- #include " DockWidgetTab.h"
42
41
#include " DockAreaWidget.h"
43
- #include " DockingStateReader.h"
44
42
#include " ResizeHandle.h"
45
43
#include " DockComponentsFactory.h"
46
44
#include " AutoHideSideBar.h"
@@ -508,7 +506,8 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
508
506
// ignore the event, because the auto hide overlay should not get collapsed if
509
507
// user works in it
510
508
QMouseEvent* me = static_cast <QMouseEvent*>(event);
511
- auto pos = mapFromGlobal (me->globalPos ());
509
+ auto GlobalPos = internal::globalPositionOf (me);
510
+ auto pos = mapFromGlobal (GlobalPos);
512
511
if (rect ().contains (pos))
513
512
{
514
513
return Super::eventFilter (watched, event);
@@ -519,7 +518,7 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
519
518
// do not ignore this here, then we will collapse the container and the side tab
520
519
// click handler will uncollapse it
521
520
auto SideTab = d->SideTab ;
522
- pos = SideTab->mapFromGlobal (me-> globalPos () );
521
+ pos = SideTab->mapFromGlobal (GlobalPos );
523
522
if (SideTab->rect ().contains (pos))
524
523
{
525
524
return Super::eventFilter (watched, event);
@@ -530,6 +529,16 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
530
529
// should get collapsed
531
530
collapseView (true );
532
531
}
532
+ else if (event->type () == QEvent::NonClientAreaMouseButtonPress)
533
+ {
534
+ // If the user starts dragging a floating widget, then we collapse
535
+ // the auto hide widget
536
+ CFloatingDockContainer* FloatingWidget = qobject_cast<CFloatingDockContainer*>(watched);
537
+ if (FloatingWidget)
538
+ {
539
+ collapseView (true );
540
+ }
541
+ }
533
542
534
543
return Super::eventFilter (watched, event);
535
544
}
0 commit comments