Skip to content

Commit e4dfc7e

Browse files
gui, qt: brintToFront workaround for Wayland
1 parent d367a4e commit e4dfc7e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/qt/guiutil.cpp

+14-6
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,22 @@ void bringToFront(QWidget* w)
411411
#endif
412412

413413
if (w) {
414-
// activateWindow() (sometimes) helps with keyboard focus on Windows
415-
if (w->isMinimized()) {
416-
w->showNormal();
417-
} else {
414+
if (QGuiApplication::platformName() == "wayland") {
415+
auto eFlags = w->windowFlags();
416+
w->setWindowFlags(eFlags|Qt::WindowStaysOnTopHint);
417+
w->show();
418+
w->setWindowFlags(eFlags);
418419
w->show();
420+
} else {
421+
// activateWindow() (sometimes) helps with keyboard focus on Windows
422+
if (w->isMinimized()) {
423+
w->showNormal();
424+
} else {
425+
w->show();
426+
}
427+
w->activateWindow();
428+
w->raise();
419429
}
420-
w->activateWindow();
421-
w->raise();
422430
}
423431
}
424432

0 commit comments

Comments
 (0)