Merge bitcoin-core/gui#914: Revert "gui, qt: brintToFront workaround for Wayland"

0672e727bf1db5995562e9656d18b699aeba5fe0 Revert "gui, qt: brintToFront workaround for Wayland" (Hennadii Stepanov)

Pull request description:

  This PR reverts a Wayland-specific workaround introduced in https://github.com/bitcoin-core/gui/pull/831, which appears to break the UI, as reported in:
  - https://github.com/bitcoin/bitcoin/issues/33432
  - https://github.com/bitcoin-core/gui/pull/903

  An alternative to https://github.com/bitcoin-core/gui/pull/904, as suggested in https://github.com/bitcoin-core/gui/pull/904#discussion_r2435752838.

  Fixes https://github.com/bitcoin-core/gui/pull/903.-

ACKs for top commit:
  maflcko:
    review ACK 0672e727bf1db5995562e9656d18b699aeba5fe0 🎩

Tree-SHA512: 3c2fba4a601de82b8c73553d54e93d133f9f474ee1f55a77320c0fc198735b68559859f7efeb125aa5282b8334bfa09f3927d6d7c984d2f87f54fa1ca45ee60e
This commit is contained in:
Hennadii Stepanov 2025-11-24 15:22:44 +00:00
commit 238c1c8933
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -405,26 +405,19 @@ bool isObscured(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
ForceActivation();
ForceActivation();
#endif
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (w->isMinimized()) {
w->showNormal();
} else {
w->show();
}
w->activateWindow();
w->raise();
if (w) {
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (w->isMinimized()) {
w->showNormal();
} else {
w->show();
}
w->activateWindow();
w->raise();
}
}