diff --git a/src/DockFocusController.cpp b/src/DockFocusController.cpp index b3efcee..c4a9332 100644 --- a/src/DockFocusController.cpp +++ b/src/DockFocusController.cpp @@ -325,22 +325,22 @@ void CDockFocusController::notifyWidgetOrAreaRelocation(QWidget* DroppedWidget) } CDockWidget* DockWidget = qobject_cast(DroppedWidget); - if (DockWidget) - { - d->ForceFocusChangedSignal = true; - CDockManager::setWidgetFocus(DockWidget->tabWidget()); - return; - } + if (!DockWidget) + { + CDockAreaWidget* DockArea = qobject_cast(DroppedWidget); + if (DockArea) + { + DockWidget = DockArea->currentDockWidget(); + } + } - CDockAreaWidget* DockArea = qobject_cast(DroppedWidget); - if (!DockArea) - { - return; - } + if (!DockWidget) + { + return; + } - DockWidget = DockArea->currentDockWidget(); d->ForceFocusChangedSignal = true; - CDockManager::setWidgetFocus(DockWidget->tabWidget()); + CDockManager::setWidgetFocus(DockWidget->tabWidget()); }