Skip to content

Commit b47b1f6

Browse files
committed
merge bitcoin-core/gui#831: GUIUtil::bringToFront workaround for Wayland
1 parent 493768c commit b47b1f6

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/qt/guiutil.cpp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -618,19 +618,26 @@ bool isObscured(QWidget *w)
618618

619619
void bringToFront(QWidget* w)
620620
{
621-
#ifdef Q_OS_MACOS
622-
ForceActivation();
623-
#endif
624-
625621
if (w) {
626-
// activateWindow() (sometimes) helps with keyboard focus on Windows
627-
if (w->isMinimized()) {
628-
w->showNormal();
629-
} else {
622+
if (QGuiApplication::platformName() == "wayland") {
623+
auto flags = w->windowFlags();
624+
w->setWindowFlags(flags|Qt::WindowStaysOnTopHint);
625+
w->show();
626+
w->setWindowFlags(flags);
630627
w->show();
628+
} else {
629+
#ifdef Q_OS_MACOS
630+
ForceActivation();
631+
#endif
632+
// activateWindow() (sometimes) helps with keyboard focus on Windows
633+
if (w->isMinimized()) {
634+
w->showNormal();
635+
} else {
636+
w->show();
637+
}
638+
w->activateWindow();
639+
w->raise();
631640
}
632-
w->activateWindow();
633-
w->raise();
634641
}
635642
}
636643

0 commit comments

Comments
 (0)