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 Jul 31, 2024
1 parent d367a4e commit bcc6874
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ void bringToFront(QWidget* w)
}
w->activateWindow();
w->raise();

bringToFrontWorkaroundForWayland(w);
}
}

Expand Down Expand Up @@ -1007,4 +1009,15 @@ void ShowModalDialogAsynchronously(QDialog* dialog)
dialog->show();
}

void bringToFrontWorkaroundForWayland(QWidget* w)
{
if (QGuiApplication::platformName() == "wayland") {
auto eFlags = w->windowFlags();
w->setWindowFlags(eFlags|Qt::WindowStaysOnTopHint);
w->show();
w->setWindowFlags(eFlags);
w->show();
}
}

} // namespace GUIUtil
1 change: 1 addition & 0 deletions src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ namespace GUIUtil

// Activate, show and raise the widget
void bringToFront(QWidget* w);
void bringToFrontWorkaroundForWayland(QWidget* w);

// Set shortcut to close window
void handleCloseWindowShortcut(QWidget* w);
Expand Down

0 comments on commit bcc6874

Please sign in to comment.