@@ -513,23 +513,10 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
513
513
}
514
514
else if (event->type () == QEvent::MouseButtonPress)
515
515
{
516
- // If the user clicked into another window, then we collapse the
517
- // auto hide widget
518
- /* qDebug() << 1;
519
- qDebug() << "is_ancestor_of " << is_ancestor_of(watched, this);
520
- auto widget = qobject_cast<QWidget*>(watched);
521
- qDebug() << "isAnchestorOf" << isAncestorOf(widget);
522
- if (widget && widget->window() != this->window())
523
- {
524
- collapseView(true);
525
- return Super::eventFilter(watched, event);
526
- }*/
527
-
528
516
// We check, if the mouse button press is inside the container
529
517
// widget. If it is not, i.e. if someone resizes the main window or
530
518
// clicks into the application menu or toolbar, then we ignore the
531
519
// event
532
- qDebug () << 2 ;
533
520
auto Container = dockContainer ();
534
521
QMouseEvent* me = static_cast <QMouseEvent*>(event);
535
522
auto GlobalPos = internal::globalPositionOf (me);
@@ -543,7 +530,6 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
543
530
// If the click is inside of this auto hide container, then we can also
544
531
// ignore the event, because the auto hide overlay should not get collapsed if
545
532
// user works in it
546
- qDebug () << 3 ;
547
533
pos = mapFromGlobal (GlobalPos);
548
534
if (rect ().contains (pos))
549
535
{
@@ -554,7 +540,6 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
554
540
// because the side tab click handler will call collapseView(). If we
555
541
// do not ignore this here, then we will collapse the container and the side tab
556
542
// click handler will uncollapse it
557
- qDebug () << 4 ;
558
543
auto SideTab = d->SideTab ;
559
544
pos = SideTab->mapFromGlobal (GlobalPos);
560
545
if (SideTab->rect ().contains (pos))
@@ -565,13 +550,21 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
565
550
// If the mouse button down event is in the dock manager but outside
566
551
// of the open auto hide container, then the auto hide dock widget
567
552
// should get collapsed
568
- qDebug () << 5 ;
569
553
collapseView (true );
570
554
}
571
- else if (event->type () == internal::FloatingWidgetDragStartEvent
572
- || event->type () == internal::DockedWidgetDragStartEvent)
555
+ else if (event->type () == internal::FloatingWidgetDragStartEvent)
556
+ {
557
+ // If we are dragging our own floating widget, the we do not need to
558
+ // collapse the view
559
+ auto FloatingWidget = dockContainer ()->floatingWidget ();
560
+ if (FloatingWidget != watched)
561
+ {
562
+ collapseView (true );
563
+ }
564
+ }
565
+ else if (event->type () == internal::DockedWidgetDragStartEvent)
573
566
{
574
- collapseView (true );
567
+ collapseView (true );
575
568
}
576
569
577
570
return Super::eventFilter (watched, event);
0 commit comments