From 936eba01cdfdb8826ba2443454f8c35d5e2672ca Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 14 Mar 2025 11:45:50 +0100 Subject: [PATCH] Bring all floating widgets to foreground on Linux if a dockwidget is dragged --- src/DockManager.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 2a117f5..f31e675 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -532,16 +532,25 @@ CDockManager::CDockManager(QWidget *parent) : #if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow) { - if (focusWindow) + 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(); + return; } + + // bring the main application window that hosts the dock manager and all floating + // widgets in front of any other application + this->raise(); + for (auto FloatingWidget : d->FloatingWidgets) + { + if (FloatingWidget) + { + FloatingWidget->raise(); + } + } + + // ensure that the dragged floating window is in front of the main application window + // and any other floating widget - this will also ensure that modal dialogs come to foreground + focusWindow->raise(); }); #endif }