From c11a496278fa818a28adc8cd156dd3cebae213e1 Mon Sep 17 00:00:00 2001 From: Uwe Date: Fri, 2 Sep 2022 18:18:28 +0200 Subject: [PATCH] Change to ensure that modal widgets are always on top of floating widgets --- src/DockFocusController.cpp | 2 +- src/DockManager.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/DockFocusController.cpp b/src/DockFocusController.cpp index 595c9fa..0859c1a 100644 --- a/src/DockFocusController.cpp +++ b/src/DockFocusController.cpp @@ -264,7 +264,7 @@ void CDockFocusController::onFocusWindowChanged(QWindow *focusWindow) //=========================================================================== void CDockFocusController::onApplicationFocusChanged(QWidget* focusedOld, QWidget* focusedNow) { - Q_UNUSED(focusedOld); + Q_UNUSED(focusedOld); if (d->DockManager->isRestoringState()) { diff --git a/src/DockManager.cpp b/src/DockManager.cpp index ecb558c..bbca9d6 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include "FloatingDockContainer.h" #include "DockOverlay.h" @@ -500,6 +501,16 @@ CDockManager::CDockManager(QWidget *parent) : #ifdef Q_OS_LINUX window()->installEventFilter(this); + + connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow) + { + // bring modal dialogs to foreground to ensure that they are in front of any + // floating dock widget + if (focusWindow && focusWindow->isModal()) + { + focusWindow->raise(); + } + }); #endif }