1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-03-15 02:29:52 +08:00

Improved fix #722 - it now works always even if focus highlighting is

disabled
This commit is contained in:
Uwe Kindler 2025-03-13 14:19:47 +01:00
parent 90e5adde29
commit 9f8dd99cac
2 changed files with 8 additions and 13 deletions

View File

@ -248,15 +248,6 @@ void CDockFocusController::onFocusWindowChanged(QWindow *focusWindow)
return;
}
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
// bring the main application window that hosts the dock manager in front of
// any other application
d->DockManager->raise();
// ensure that the dragged floating window is in front of the main application window
focusWindow->raise();
#endif
auto vDockWidget = focusWindow->property(FocusedDockWidgetProperty);
if (!vDockWidget.isValid())
{

View File

@ -530,12 +530,16 @@ CDockManager::CDockManager(QWidget *parent) :
window()->installEventFilter(this);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow)
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
{
// bring modal dialogs to foreground to ensure that they are in front of any
// floating dock widget
if (focusWindow && focusWindow->isModal())
if (focusWindow)
{
// bring the main application window that hosts the dock manager in front of
// any other application
this->raise();
// ensure that the dragged floating window is in front of the main application window
// this will also ensure that modal dialogs come to foreground
focusWindow->raise();
}
});