Change to ensure that modal widgets are always on top of floating widgets

This commit is contained in:
Uwe 2022-09-02 18:18:28 +02:00
parent d27783e2f1
commit c11a496278
2 changed files with 12 additions and 1 deletions

View File

@ -45,6 +45,7 @@
#include <QSettings>
#include <QMenu>
#include <QApplication>
#include <QWindow>
#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
}