Skip to content

Commit 936eba0

Browse files
Bring all floating widgets to foreground on Linux if a dockwidget is
dragged
1 parent 9f8dd99 commit 936eba0

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/DockManager.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,25 @@ CDockManager::CDockManager(QWidget *parent) :
532532
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
533533
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
534534
{
535-
if (focusWindow)
535+
if (!focusWindow)
536536
{
537-
// bring the main application window that hosts the dock manager in front of
538-
// any other application
539-
this->raise();
537+
return;
538+
}
540539

541-
// ensure that the dragged floating window is in front of the main application window
542-
// this will also ensure that modal dialogs come to foreground
543-
focusWindow->raise();
540+
// bring the main application window that hosts the dock manager and all floating
541+
// widgets in front of any other application
542+
this->raise();
543+
for (auto FloatingWidget : d->FloatingWidgets)
544+
{
545+
if (FloatingWidget)
546+
{
547+
FloatingWidget->raise();
548+
}
544549
}
550+
551+
// ensure that the dragged floating window is in front of the main application window
552+
// and any other floating widget - this will also ensure that modal dialogs come to foreground
553+
focusWindow->raise();
545554
});
546555
#endif
547556
}

0 commit comments

Comments
 (0)