Skip to content

Commit f27d285

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

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/qt/guiutil.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ void bringToFront(QWidget* w)
419419
}
420420
w->activateWindow();
421421
w->raise();
422+
423+
bringToFrontWorkaroundForWayland(w);
422424
}
423425
}
424426

@@ -1007,4 +1009,15 @@ void ShowModalDialogAsynchronously(QDialog* dialog)
10071009
dialog->show();
10081010
}
10091011

1012+
void bringToFrontWorkaroundForWayland(QWidget* w)
1013+
{
1014+
if (QGuiApplication::platformName() == "wayland") {
1015+
auto eFlags = w->windowFlags();
1016+
w->setWindowFlags(eFlags|Qt::WindowStaysOnTopHint);
1017+
w->show();
1018+
w->setWindowFlags(eFlags);
1019+
w->show();
1020+
}
1021+
}
1022+
10101023
} // namespace GUIUtil

src/qt/guiutil.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ namespace GUIUtil
170170

171171
// Activate, show and raise the widget
172172
void bringToFront(QWidget* w);
173+
void bringToFrontWorkaroundForWayland(QWidget* w);
173174

174175
// Set shortcut to close window
175176
void handleCloseWindowShortcut(QWidget* w);

0 commit comments

Comments
 (0)