Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUIUtil::brintToFront workaround for Wayland #831

Conversation

pablomartin4btc
Copy link
Contributor

@pablomartin4btc pablomartin4btc commented Jul 30, 2024

There are known issues around handling windows focus in Wayland (this one specific in KDE but also in gnome).

The idea is that the workaround will be executed if bitcoin-qt is running using Wayland platform (e.g.: QT_QPA_PLATFORM=wayland ./src/qt/bitcoin-qt -regtest), since the workaround behaviour looks like re-opening the window again (which I tried to fix by moving the window to the original position and/ or re-setting the original geometry without success) while in X11 (not sure in Mac) the current GUIUtil::brintToFront actually sets the focus to the desired window, keeping its original position as expected, and I didn't want to change that (X11 behaviour).

The solution was initially discussed with hebasto in #817.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 30, 2024

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
ACK hebasto

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

Conflicts

No conflicts as of last run.

@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Debug: https://github.com/bitcoin-core/gui/runs/28126764186

Hints

Make sure to run all tests locally, according to the documentation.

The failure may happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@hebasto
Copy link
Member

hebasto commented Aug 2, 2024

Concept ACK.

src/qt/guiutil.cpp Outdated Show resolved Hide resolved
src/qt/guiutil.cpp Outdated Show resolved Hide resolved
@pablomartin4btc pablomartin4btc force-pushed the gui-bringToFront-wayland-workaround branch 2 times, most recently from e4dfc7e to 19f8842 Compare August 2, 2024 16:46
@pablomartin4btc pablomartin4btc force-pushed the gui-bringToFront-wayland-workaround branch from 19f8842 to 15aa7d0 Compare August 2, 2024 16:56
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.

ACK 15aa7d0.

Tested on Ubuntu 24.04. The behavior with QT_QPA_PLATFORM=wayland has become more consistent with the behavior with QT_QPA_PLATFORM=xcb.

Tested on macOS 12.7.6 Monterey. No behavior changes observed.

@hebasto hebasto merged commit 1873e41 into bitcoin-core:master Aug 12, 2024
16 checks passed
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.

3 participants