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

[Linux] Add wayland support #19950

Open
A6GibKm opened this issue Sep 13, 2020 · 19 comments · May be fixed by #29959
Open

[Linux] Add wayland support #19950

A6GibKm opened this issue Sep 13, 2020 · 19 comments · May be fixed by #29959

Comments

@A6GibKm
Copy link

A6GibKm commented Sep 13, 2020

Is your feature request related to a problem? Please describe.

  • Wayland provides extra security as apps can't have access to windows from other apps
  • X apps looks blurry using fractional scaling on GNOME.
  • X is mostly unmaintained, in favour of Wayland

Describe the solution you'd like
Add Wayland support to precompiled binaries.

Additional context
As far as I understand wayland is supported on the KDE 5.15 runtime. Currently running with QT_QPA_PLATFORM="wayland" results in

This application failed to start because it could not find or load the Qt platform plugin "wayland"
in "".

Available platform plugins are: xcb.

Reinstalling the application may fix this problem.
@hebasto
Copy link
Member

hebasto commented Sep 13, 2020

Just for reference:

Also #15677.

@fanquake fanquake added the GUI label Sep 14, 2020
@laanwj
Copy link
Member

laanwj commented Feb 6, 2021

This is strange. I tested bitcoin-qt on wayland in 2018 or so and it worked okay (not 100% great at that point, but it showed the window and was usable).

This was for a self-compiled binary though I don't know about the distribution binaries.

It could have regressed due to a change at our side, though in principle you get wayland support for free by using Qt. Also for the distribution binaries we might have to enable it in the build process.

@maflcko
Copy link
Member

maflcko commented Feb 6, 2021

the compositor API was first released as stable with Qt 5.8, details: https://wiki.qt.io/QtWayland

gitian uses 5.9LTS, so what is left to do here?

@laanwj
Copy link
Member

laanwj commented Feb 9, 2021

gitian uses 5.9LTS, so what is left to do here?

I suppose to actually link the wayland backend. We currently only link against xcb, afaik.

@hebasto
Copy link
Member

hebasto commented Jun 25, 2021

@laanwj @MarcoFalke

gitian uses 5.9LTS, so what is left to do here?

I suppose to actually link the wayland backend. We currently only link against xcb, afaik.

  1. add an ability to integrate additional Qt modules (see depends: Use Qt top-level build facilities #20641) in depends
  2. add QtWayland module

fanquake added a commit to bitcoin-core/gui that referenced this issue Jul 18, 2021
1155978 build, qt: Do not install *.prl files (Hennadii Stepanov)
763793b build, qt: Fix wrong cross-compiling detection on macOS (Hennadii Stepanov)
3098272 build, qt: Force bootstrap while building linguist tools (Hennadii Stepanov)
689320e build, qt: Drop translations.pro hack (Hennadii Stepanov)
6a1f98f build, qt: Drop lrelease dependency patch (Hennadii Stepanov)
39e561e build, qt: Add linguist_tools list (Hennadii Stepanov)
27d3def build: Use Qt top-level build facilities (Hennadii Stepanov)

Pull request description:

  This PR:
  - uses Qt top-level build facilities without the need to download all-in-one archive
  - is based on **BlockMechanic**'s [idea](bitcoin/bitcoin#20600), and is an alternative to #20600
  - makes it easy to integrate [new modules](bitcoin/bitcoin#16883) into static builds
  - has the minimal diff
  - makes the qt package build process streamlined by dropping some patches and hacks (an alternative to  #21420 and #20642)

  Fixes #18536 (a non-intrusive alternative to #21589 and #19785).

  Fixes #14648.

  Fixes #21588 (a non-intrusive alternative to #21591).

  Required for adding [Wayland support](bitcoin/bitcoin#19950) on Linux.

  ---

  **Note for reviewers**: With 9046de8a4cbc3899fed9eae084115f423e7ac5bd from #21995 it is easy to verify that there are no changes in the resulted `qt` package archive on the per commit basis. For example, for `HOST=i686-pc-linux-gnu` no commit in this PR introduces any changes.

ACKs for top commit:
  fanquake:
    ACK 1155978

Tree-SHA512: 667b06b72cb7ff26d68b9b88e8dddb51084783ca9e3d80b3392710794c1dc7fd77bbcc3ccf4ccece9919d33b9bf8fce13c5059502bd228021dc7c93fdb87ca7a
sidhujag pushed a commit to syscoin/syscoin that referenced this issue Jul 23, 2021
1155978 build, qt: Do not install *.prl files (Hennadii Stepanov)
763793b build, qt: Fix wrong cross-compiling detection on macOS (Hennadii Stepanov)
3098272 build, qt: Force bootstrap while building linguist tools (Hennadii Stepanov)
689320e build, qt: Drop translations.pro hack (Hennadii Stepanov)
6a1f98f build, qt: Drop lrelease dependency patch (Hennadii Stepanov)
39e561e build, qt: Add linguist_tools list (Hennadii Stepanov)
27d3def build: Use Qt top-level build facilities (Hennadii Stepanov)

Pull request description:

  This PR:
  - uses Qt top-level build facilities without the need to download all-in-one archive
  - is based on **BlockMechanic**'s [idea](bitcoin#20600), and is an alternative to bitcoin#20600
  - makes it easy to integrate [new modules](bitcoin#16883) into static builds
  - has the minimal diff
  - makes the qt package build process streamlined by dropping some patches and hacks (an alternative to  bitcoin#21420 and bitcoin#20642)

  Fixes bitcoin#18536 (a non-intrusive alternative to bitcoin#21589 and bitcoin#19785).

  Fixes bitcoin#14648.

  Fixes bitcoin#21588 (a non-intrusive alternative to bitcoin#21591).

  Required for adding [Wayland support](bitcoin#19950) on Linux.

  ---

  **Note for reviewers**: With 9046de8 from bitcoin#21995 it is easy to verify that there are no changes in the resulted `qt` package archive on the per commit basis. For example, for `HOST=i686-pc-linux-gnu` no commit in this PR introduces any changes.

ACKs for top commit:
  fanquake:
    ACK 1155978

Tree-SHA512: 667b06b72cb7ff26d68b9b88e8dddb51084783ca9e3d80b3392710794c1dc7fd77bbcc3ccf4ccece9919d33b9bf8fce13c5059502bd228021dc7c93fdb87ca7a
@hebasto
Copy link
Member

hebasto commented Aug 5, 2021

See #22631 for Wayland support when building against system packages.

@hebasto
Copy link
Member

hebasto commented Apr 17, 2022

Wayland support for static builds suggested in #22708.

@hebasto
Copy link
Member

hebasto commented May 29, 2022

Probably, this issue should be closed for the following reasons:

  • lack of overwhelming demand for Wayland support
  • introducing of "a second Linux graphics backend to support, along with more packages in depends, new runtime dependencies, and the scope for adding even more drivers/features in the future"

@adamjonas
Copy link
Member

Closing for reasons stated by hebasto above.

@adamjonas adamjonas closed this as not planned Won't fix, can't repro, duplicate, stale Mar 9, 2023
@berenddeboer
Copy link

I've switched to the Sway window manager which gets a lot of traction, but unfortunately got here as bitcoin doesn't run.

@hebasto
Copy link
Member

hebasto commented May 5, 2023

@berenddeboer

I've switched to the Sway window manager which gets a lot of traction, but unfortunately got here as bitcoin doesn't run.

You can compile bitcoin-qt by yourself using linking against system-wide (modern enough) Qt5 packages. The resulted binary will support Wayland.

To run it, the additional packages could be required. For details, see https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md.

@sipa
Copy link
Member

sipa commented May 5, 2023

Is it the case that our bitcion-qt release binaries don't work on Wayland at all? If so, that should be fixed, I think. Many distributions are increasingly migrating away from X.

@hebasto
Copy link
Member

hebasto commented May 5, 2023

Is it the case that our bitcion-qt release binaries don't work on Wayland at all? If so, that should be fixed, I think. Many distributions are increasingly migrating away from X.

Unfortunately, #22708 did not find enough support. The main concerns were:

this change introduces a second Linux graphics backend to support, along with more packages in depends, new runtime dependencies, and the scope for adding even more drivers/features in the future.

@maflcko
Copy link
Member

maflcko commented May 5, 2023

I don't really buy the concern. Even if this is adding additional depends in a gui/qt-only context, what is the downside? If this allows people to get a feature they want and there are people who maintain it? If someone doesn't use gui/qt, they should be unaffected by this.

@hebasto
Copy link
Member

hebasto commented May 5, 2023

OK. Reopened this issue first :)

@hebasto hebasto reopened this May 5, 2023
@berenddeboer
Copy link

Is it the case that our bitcion-qt release binaries don't work on Wayland at all?

All I can say that on Ubuntu 23.04 + Sway (which uses Wayland), bitcoin-qt does not work, and crashes with:

 > bitcoin-core.qt
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Fontconfig warning: FcPattern object weight does not accept value [0 205)
fish: Job 1, 'bitcoin-core.qt' terminated by signal SIGSEGV (Address boundary error)

Doing what is suggested does not work:

QT_QPA_PLATFORM=wayland bitcoin-core.qt
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Fontconfig warning: FcPattern object weight does not accept value [0 205)
fish: Job 1, 'QT_QPA_PLATFORM=wayland bitcoin…' terminated by signal SIGSEGV (Address boundary error)

My current version:

bitcoin-core.cli --version
Bitcoin Core RPC client version v24.0.1

I have installed this as a snap:

snap list | grep bitcoin
bitcoin-core                    24.0.1                      126    latest/stable    bitcoin-core  -

System details:

uname -a
Linux firefly.berenddeboer.net 6.2.0-20-generic #20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  6 07:48:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@KST-Energy
Copy link

KST-Energy commented Nov 16, 2023

Hi, found this issue while looking for a fix, and want to share my experience.

$ bitcoin-qt
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

I have essentially installed core (v24.2 on Ubuntu) using the instructions here with all of these dependencies:

sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev

Worth noting that Qt launches & works fine otherwise, as far as I can tell.

@laanwj
Copy link
Member

laanwj commented Apr 21, 2024

See #29923, it is a first step to Wayland support in the release binaries without the earlier noted drawbacks of requiring extra build-time or run-time dependencies.

@laanwj
Copy link
Member

laanwj commented Apr 25, 2024

See #29959 for a new wayland PoC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants