Merge branch 'linux_modal_dialog_fix'

This commit is contained in:
Uwe 2022-09-05 09:02:02 +02:00
commit 82c98a3f91
3 changed files with 19 additions and 1 deletions

View File

@ -45,6 +45,7 @@
#include <QSettings> #include <QSettings>
#include <QMenu> #include <QMenu>
#include <QApplication> #include <QApplication>
#include <QWindow>
#include "FloatingDockContainer.h" #include "FloatingDockContainer.h"
#include "DockOverlay.h" #include "DockOverlay.h"
@ -500,6 +501,16 @@ CDockManager::CDockManager(QWidget *parent) :
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
window()->installEventFilter(this); 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 #endif
} }

View File

@ -515,6 +515,13 @@ void FloatingDockContainerPrivate::updateDropOverlays(const QPoint &GlobalPos)
return; return;
} }
#ifdef Q_OS_LINUX
if (qApp->activeModalWidget())
{
return;
}
#endif
auto Containers = DockManager->dockContainers(); auto Containers = DockManager->dockContainers();
CDockContainerWidget *TopContainer = nullptr; CDockContainerWidget *TopContainer = nullptr;
for (auto ContainerWidget : Containers) for (auto ContainerWidget : Containers)