mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04: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,11 +406,17 @@ bool isObscured(QWidget *w)
|
||||||
|
|
||||||
void bringToFront(QWidget* w)
|
void bringToFront(QWidget* w)
|
||||||
{
|
{
|
||||||
|
if (w) {
|
||||||
|
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
|
#ifdef Q_OS_MACOS
|
||||||
ForceActivation();
|
ForceActivation();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (w) {
|
|
||||||
// activateWindow() (sometimes) helps with keyboard focus on Windows
|
// activateWindow() (sometimes) helps with keyboard focus on Windows
|
||||||
if (w->isMinimized()) {
|
if (w->isMinimized()) {
|
||||||
w->showNormal();
|
w->showNormal();
|
||||||
|
@ -420,6 +426,7 @@ void bringToFront(QWidget* w)
|
||||||
w->activateWindow();
|
w->activateWindow();
|
||||||
w->raise();
|
w->raise();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleCloseWindowShortcut(QWidget* w)
|
void handleCloseWindowShortcut(QWidget* w)
|
||||||
|
|
Loading…
Add table
Reference in a new issue