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 15aa7d0
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,19 +406,26 @@ bool isObscured(QWidget *w)

void bringToFront(QWidget* w)
{
#ifdef Q_OS_MACOS
ForceActivation();
#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 {
#ifdef Q_OS_MACOS
ForceActivation();
#endif
// 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 15aa7d0

Please sign in to comment.