Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/DockAreaTabBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <QApplication>
#include <QtGlobal>
#include <QTimer>
#include <QPointer>

#include "FloatingDockContainer.h"
#include "DockAreaWidget.h"
Expand Down Expand Up @@ -111,9 +112,15 @@ void DockAreaTabBarPrivate::updateTabs()
// Sometimes the synchronous calculation of the rectangular area fails
// Therefore we use QTimer::singleShot here to execute the call
// within the event loop - see #520
QTimer::singleShot(0, _this, [&, TabWidget]
QPointer<CDockAreaTabBar> __this = _this;
QPointer<CDockWidgetTab> __tabWidget = TabWidget;

QTimer::singleShot(0, TabWidget, [__this, __tabWidget]
{
_this->ensureWidgetVisible(TabWidget);
if (__this && __tabWidget)
{
__this->ensureWidgetVisible(__tabWidget);
}
});
}
else
Expand Down
10 changes: 6 additions & 4 deletions src/DockContainerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class DockContainerWidgetPrivate
int VisibleDockAreaCount = -1;
CDockAreaWidget* TopLevelDockArea = nullptr;
QTimer DelayedAutoHideTimer;
CAutoHideTab* DelayedAutoHideTab;
QPointer<CAutoHideTab> DelayedAutoHideTab;
bool DelayedAutoHideShow = false;

/**
Expand Down Expand Up @@ -396,10 +396,12 @@ DockContainerWidgetPrivate::DockContainerWidgetPrivate(CDockContainerWidget* _pu
std::fill(std::begin(LastAddedAreaCache),std::end(LastAddedAreaCache), nullptr);
DelayedAutoHideTimer.setSingleShot(true);
DelayedAutoHideTimer.setInterval(500);
QObject::connect(&DelayedAutoHideTimer, &QTimer::timeout, [this](){
auto GlobalPos = DelayedAutoHideTab->mapToGlobal(QPoint(0, 0));
qApp->sendEvent(DelayedAutoHideTab, new QMouseEvent(QEvent::MouseButtonPress,
QObject::connect(&DelayedAutoHideTimer, &QTimer::timeout, [this](){
if (DelayedAutoHideTab) {
auto GlobalPos = DelayedAutoHideTab->mapToGlobal(QPoint(0, 0));
qApp->sendEvent(DelayedAutoHideTab, new QMouseEvent(QEvent::MouseButtonPress,
QPoint(0, 0), GlobalPos, Qt::LeftButton, {Qt::LeftButton}, Qt::NoModifier));
}
});
}

Expand Down