Skip to content

Commit 9f8dd99

Browse files
Improved fix #722 - it now works always even if focus highlighting is
disabled
1 parent 90e5add commit 9f8dd99

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/DockFocusController.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,6 @@ void CDockFocusController::onFocusWindowChanged(QWindow *focusWindow)
248248
return;
249249
}
250250

251-
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
252-
// bring the main application window that hosts the dock manager in front of
253-
// any other application
254-
d->DockManager->raise();
255-
256-
// ensure that the dragged floating window is in front of the main application window
257-
focusWindow->raise();
258-
#endif
259-
260251
auto vDockWidget = focusWindow->property(FocusedDockWidgetProperty);
261252
if (!vDockWidget.isValid())
262253
{

src/DockManager.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,16 @@ CDockManager::CDockManager(QWidget *parent) :
530530
window()->installEventFilter(this);
531531

532532
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
533-
connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow)
533+
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
534534
{
535-
// bring modal dialogs to foreground to ensure that they are in front of any
536-
// floating dock widget
537-
if (focusWindow && focusWindow->isModal())
535+
if (focusWindow)
538536
{
537+
// bring the main application window that hosts the dock manager in front of
538+
// any other application
539+
this->raise();
540+
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
539543
focusWindow->raise();
540544
}
541545
});

0 commit comments

Comments
 (0)