mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 03:47:29 -03:00
gui, qt: brintToFront workaround for Wayland
This commit is contained in:
parent
d367a4e36f
commit
15aa7d0236
1 changed files with 17 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue