1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-03-31 10:22:39 +08:00

Fixed: the focusable CDockWidget would lose focus when another QWindow containing a CDockManager that contains a focusable CDockWidget gains focus

This commit is contained in:
wingsummer 2024-09-16 17:21:03 +08:00
parent 90e5adde29
commit 7cdf84f7c2

13
src/DockFocusController.cpp Normal file → Executable file
View File

@ -269,7 +269,8 @@ void CDockFocusController::onFocusWindowChanged(QWindow *focusWindow)
return;
}
d->updateDockWidgetFocus(DockWidget);
if(DockWidget->dockManager() == d->DockManager)
d->updateDockWidgetFocus(DockWidget);
}
@ -307,10 +308,11 @@ void CDockFocusController::onApplicationFocusChanged(QWidget* focusedOld, QWidge
if (!DockWidget || DockWidget->tabWidget()->isHidden())
{
return;
}
}
#endif
d->updateDockWidgetFocus(DockWidget);
if(DockWidget->dockManager() == d->DockManager)
d->updateDockWidgetFocus(DockWidget);
}
@ -318,7 +320,7 @@ void CDockFocusController::onApplicationFocusChanged(QWidget* focusedOld, QWidge
void CDockFocusController::setDockWidgetTabFocused(CDockWidgetTab* Tab)
{
auto DockWidget = Tab->dockWidget();
if (DockWidget)
if (DockWidget && DockWidget->dockManager() == d->DockManager)
{
d->updateDockWidgetFocus(DockWidget);
}
@ -336,7 +338,8 @@ void CDockFocusController::clearDockWidgetFocus(CDockWidget* dockWidget)
//===========================================================================
void CDockFocusController::setDockWidgetFocused(CDockWidget* focusedNow)
{
d->updateDockWidgetFocus(focusedNow);
if(focusedNow->dockManager() == d->DockManager)
d->updateDockWidgetFocus(focusedNow);
}