Update WM_CLASS window property #10064

issue ghost opened this issue on March 23, 2017
  1. ghost commented at 3:31 PM on March 23, 2017: none

    I'm running Bitcoin Core 0.13.2.0 on a Gentoo Linux machine. GNOME is my desktop environment.

    When the mouse cursor is over the application icon "Bitcoin-Qt" is displayed instead of "Bitcoin Core":

    bitcoin-core

    xprop returns the following informations:

    $ xprop| grep Bitcoin-Qt
    WM_CLASS(STRING) = "bitcoin-qt", "Bitcoin-Qt"

    In my opinion it should be replaced with the new official name, which is "Bitcoin Core".

  2. fanquake added the label Linux/Unix on Mar 24, 2017
  3. fanquake added the label GUI on Mar 24, 2017
  4. laanwj commented at 7:10 AM on March 24, 2017: member

    Any idea how to set that w/ Qt, without changing the application name that is also used to locate settings?

  5. ghost commented at 8:31 AM on March 24, 2017: none

    No, sorry, I don't know anything about Qt programming...

  6. laanwj commented at 11:39 AM on March 24, 2017: member

    This seems to be where the functionality for WM_CLASS was introduced: https://codereview.qt-project.org/#/c/61009/7/src/plugins/platforms/xcb/qxcbintegration.cpp . It uses the application name, and if none, falls back to argv[0] (executable name). bitcoin-qt happens to be both. So there's nothing we can do here to resolve this specific issue without having effect on a ton of other things.

  7. jonasschnelli commented at 12:34 PM on March 24, 2017: contributor

    There is a constant #define QAPP_APP_NAME_DEFAULT "Bitcoin-Qt" in guiconstants.h that could be changed. This should work IMO. I'm setting up a Ubuntu Gnome VM to test this.

  8. laanwj commented at 12:43 PM on March 24, 2017: member

    AFAIK, that will change where the GUI settings (such as the datadir) are stored in the registry/.config, so that would need to be carefully tested.

  9. jonasschnelli commented at 1:14 PM on March 24, 2017: contributor

    setApplicationName() works for correcting the WM_CLASS, but @laanwj is right,.. it will also affects the QSettings path/filename.

    I see three possible solutions:

    1. We don't change it (keep Bitcoin-Qt)
    2. We change it to "Bitcoin Core" and move the old QSettings file (Bitcoin-Qt.conf) if it has never been moved and the file exists
    3. We set "Bitcoin Core" over setApplicationName() and tell QSettings to use Bitcoin-Qt.conf as settings file (would "require" to abstract the QSettings interface first, code-change tend to be large).

    IMO solution 2 is preferable.

  10. laanwj commented at 1:24 PM on March 24, 2017: member

    The problem is that Qt (AFAIK) provides no abstraction for renaming the application, so this has to be done with custom code for Windows, Linux and possibly MacOSX.

    I'd prefer to just keep this minor issue and leave it as is for now. There are tons of more pressing concerns.

  11. jonasschnelli commented at 1:25 PM on March 24, 2017: contributor

    I'd prefer to just keep this minor issue and leave it as is for now. There are tons of more pressing concerns.

    Indeed.

  12. fanquake closed this on Feb 4, 2020

  13. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me