Skip to content

Commit cd98488

Browse files
Improved raising of dock widget application on linux.
1 parent eb22a9a commit cd98488

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/DockManager.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <QVariant>
4242
#include <QDebug>
4343
#include <QFile>
44+
#include <QDialog>
4445
#include <QAction>
4546
#include <QXmlStreamWriter>
4647
#include <QSettings>
@@ -537,8 +538,23 @@ CDockManager::CDockManager(QWidget *parent) :
537538
return;
538539
}
539540

540-
// bring the main application window that hosts the dock manager and all floating
541-
// widgets in front of any other application
541+
auto widget = QWidget::find(focusWindow->winId());
542+
if (!widget)
543+
{
544+
return;
545+
}
546+
547+
// If the user clicks the main window or drags a floating widget or works with a
548+
// dialog, then raise the main window, all floating widgets and the focus window
549+
// itself to bring it into foregreound of any other application
550+
bool raise = qobject_cast<QMainWindow*>(widget)
551+
|| qobject_cast<QDialog*>(widget)
552+
|| qobject_cast<ads::CFloatingDockContainer*>(widget);
553+
if (!raise)
554+
{
555+
return;
556+
}
557+
542558
this->raise();
543559
for (auto FloatingWidget : d->FloatingWidgets)
544560
{

0 commit comments

Comments
 (0)