mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-03-31 18:32:38 +08:00
Bring all floating widgets to foreground on Linux if a dockwidget is
dragged
This commit is contained in:
parent
9f8dd99cac
commit
936eba01cd
@ -532,16 +532,25 @@ CDockManager::CDockManager(QWidget *parent) :
|
|||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
|
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
|
||||||
{
|
{
|
||||||
if (focusWindow)
|
if (!focusWindow)
|
||||||
{
|
{
|
||||||
// bring the main application window that hosts the dock manager in front of
|
return;
|
||||||
// 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user