Skip to content

Conversation

@diegoviola
Copy link
Contributor

@diegoviola diegoviola commented Oct 16, 2025

The main window (BitcoinGUI) does not need to be passed to bringToFront(), doing so sets Qt::WindowStaysOnTopHint on the main window and causes it to flicker.

Fixes #903.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 16, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK pablomartin4btc

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@hebasto hebasto changed the title qt: fix Wayland visual glitches Fix Wayland visual glitches Oct 16, 2025
w->setWindowFlags(flags|Qt::WindowStaysOnTopHint);
w->show();
w->setWindowFlags(flags);
w->show();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary now to call w->show(); here?

Would it be more clear to simply revert 15aa7d0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hebasto Yeah, I think a revert would also do the trick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hebasto compiling 30.0 with 15aa7d0 reverted, will confirm soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hebasto Yeah, I can confirm that reverting 15aa7d0 solves the problem for me (on sway).

@diegoviola diegoviola force-pushed the fix-qt-wayland-rendering-issue branch 2 times, most recently from 0fcab7d to 5535da8 Compare October 16, 2025 14:28
@diegoviola diegoviola requested a review from hebasto October 16, 2025 14:34
@diegoviola diegoviola force-pushed the fix-qt-wayland-rendering-issue branch from 5535da8 to 76e4b71 Compare October 16, 2025 14:38
Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

If you can, please check how this behaves on #817.

@diegoviola diegoviola force-pushed the fix-qt-wayland-rendering-issue branch 2 times, most recently from 6542d5f to 949e953 Compare October 18, 2025 17:26
@diegoviola
Copy link
Contributor Author

@pablomartin4btc can you please re-review?

@diegoviola diegoviola force-pushed the fix-qt-wayland-rendering-issue branch 2 times, most recently from 6f71ab2 to 50f4b19 Compare October 18, 2025 19:26
The main window (BitcoinGUI) does not need to be passed to
bringToFront(), doing so sets Qt::WindowStaysOnTopHint on the main
window and causes it to flicker.

Fixes #903.
@diegoviola diegoviola force-pushed the fix-qt-wayland-rendering-issue branch from 50f4b19 to 095f920 Compare October 18, 2025 20:18
@diegoviola diegoviola changed the title Fix Wayland visual glitches Fix bitcoin-qt visual glitches on Wayland Oct 19, 2025
Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested 095f920 and it fixes the problem.

I still need to check if this is the right approach, need to check against xcb and macOS. Also there are other places where bringToFront is being used, the rpcconsole has the same issue as the main window in wayland, so perhaps the fix has to be within bringToFront, need more time to test. Thanks for finding the issue and taking a look at this!

@diegoviola
Copy link
Contributor Author

tested 095f920 and it fixes the problem.

Great! Thanks for confirming that.

I still need to check if this is the right approach, need to check against xcb and macOS.

Sure.

Also there are other places where bringToFront is being used, the rpcconsole has the same issue as the main window in wayland, so perhaps the fix has to be within bringToFront, need more time to test.

I am not able to reproduce the flickering with the rpcconsole specifically, but in a previous testing that I did removing these two lines helped with getting rid of some flickering, not all: https://github.com/bitcoin/bitcoin/blob/v30.0/src/qt/guiutil.cpp#L413-L414.

Can you please test if removing those help with the rpcconsole?

Thanks for finding the issue and taking a look at this!

You're welcome, thank you for your work as well.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 095f920, it breaks UX.

For example, on Fedora 43 with Gnome 49 and Wayland, follow these steps:

  1. Run bitcoin-qt.
  2. Hide the main window using the "Hide" command in context menu.
  3. Click on "Receive" in the system tray icon menu.

On the master branch, the main window reappears.

With this PR, however, the main window remains hidden.

@hebasto
Copy link
Member

hebasto commented Nov 21, 2025

From #904 (comment):

Would it be more clear to simply revert 15aa7d0?

Done in #914.

@diegoviola
Copy link
Contributor Author

diegoviola commented Nov 21, 2025

Closing in favor of #904.

@diegoviola diegoviola closed this Nov 21, 2025
@diegoviola
Copy link
Contributor Author

For example, on Fedora 43 with Gnome 49 and Wayland

Ah, I haven't tested this on GNOME. I suspect the use of showNormal() likely helps with the desired window behavior, which is why the revert works better.

hebasto added a commit to bitcoin/bitcoin that referenced this pull request Nov 24, 2025
…for Wayland"

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

Pull request description:

  This PR reverts a Wayland-specific workaround introduced in bitcoin-core/gui#831, which appears to break the UI, as reported in:
  - #33432
  - bitcoin-core/gui#903

  An alternative to bitcoin-core/gui#904, as suggested in bitcoin-core/gui#904 (comment).

  Fixes bitcoin-core/gui#903

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

Tree-SHA512: 3c2fba4a601de82b8c73553d54e93d133f9f474ee1f55a77320c0fc198735b68559859f7efeb125aa5282b8334bfa09f3927d6d7c984d2f87f54fa1ca45ee60e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qt6 version of Bitcoin Core (bitcoin-qt) flickers on Wayland

4 participants