mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 12:42:05 +02:00
gui, qt: brintToFront workaround for Wayland
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user