Skip to content

Commit

Permalink
gui, qt: brintToFront workaround for Wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomartin4btc committed Aug 2, 2024
1 parent d367a4e commit 19f8842
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,22 @@ void bringToFront(QWidget* w)
#endif

if (w) {
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (w->isMinimized()) {
w->showNormal();
} else {
if (QGuiApplication::platformName() == "wayland") {
auto flags = w->windowFlags();
w->setWindowFlags(flags|Qt::WindowStaysOnTopHint);
w->show();
w->setWindowFlags(flags);
w->show();
} else {
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (w->isMinimized()) {
w->showNormal();
} else {
w->show();
}
w->activateWindow();
w->raise();
}
w->activateWindow();
w->raise();
}
}

Expand Down

0 comments on commit 19f8842

Please sign in to comment.