gui icon indicating copy to clipboard operation
gui copied to clipboard

The logo icon doesn't show properly under Wayland

Open philmb3487 opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current behaviour

There should be a bitcoin logo icon when running the application under a wayland session. Right now it looks like this on my machine. This should be fixed, because it looks like it's running W-coin or some altcoin and that could be confusing, and/or misleading.

image

Expected behaviour

It should look like this (run on the same machine, same everything, but with platform xcb):

image

Steps to reproduce

Compile and run normally.

Relevant log output

No response

How did you obtain Bitcoin Core

Compiled from source

What version of Bitcoin Core are you using?

master

Operating system and version

Debian 12 (bookworm) with KDE Plasma (Wayland)

Machine specifications

image

philmb3487 avatar Dec 10 '23 20:12 philmb3487

I think Wayland is much stricter about loading the icon from the .desktop file (which must have an exactly matching name). I didn't test this any further, but running Wayland on my system with an appropriate .desktop file installed I do get the correct icon:

Screenshot from 2023-12-10 20-36-06

That said, I added my .desktop file manually a while ago, and I notice now that on my machine the code which appears to write the .desktop file is not being included in the compilation, after being exluded by the C preprocessor. Specifically Q_OS_LINUX does not appear to have been set by ./configure, so the code following this is skipped:

https://github.com/bitcoin/bitcoin/blob/36fabb01b16c70902c085187b0a6978c70c691c0/src/qt/guiutil.cpp#L574 This seems problematic to me, oir at least, I don't understand why on Linux this code is being excluded by the CPP.

Did you try installing with sudo make install, or are you just running the binary as built by make? If you didn't install, you could try running sudo make install; bitcoin-qt and see if the installed version references the correct icon? (Note this will overwrite any previously-installed version).

I've not worked on the GUI or QT much, so will defer to others here. For reference, my .desktop file in /usr/local/share/applications is in the form:

will@ubuntu /u/s/applications $ cat Bitcoin-qt.desktop
[Desktop Entry]
Name=Bitcoin-Qt
Exec=/usr/local/bin/bitcoin-qt
Icon=/home/will/src/bitcoin/share/pixmaps/bitcoin64.png
Type=Application
Categories=Utility;

willcl-ark avatar Dec 11 '23 11:12 willcl-ark

...

it sohuld be simpler than that, something like QWindow::setIcon() ought to be enough ?

philmb3487 avatar Dec 11 '23 22:12 philmb3487