Qt: Minimize to tray functionality only on Windows #12054

pull vajdaz wants to merge 2 commits into bitcoin:master from vajdaz:win-only-tray changing 2 files +15 −0
  1. vajdaz commented at 10:51 AM on December 30, 2017: none

    Minimizing to tray should only be possible on Windows. Therefore, on non-Winodws systems the tray icon and related settings are hidden, the related option variables are set to predefined values. Furthermore, not used entries are removed from the configuration files at initialization. See also discussions in PR #11859

  2. Minimize to tray functionality only on Windows
    Minimizing to tray should only be possible on Windows.
    Therefore, on non-Winodws systems the tray icon and related
    settings are hidden, the related option variables are set to
    predefined values. Furthermore, not used entries are removed
    from the configuration files at initialization.
     Please enter the commit message for your changes. Lines starting
    2972b1ef46
  3. laanwj added the label GUI on Dec 30, 2017
  4. fanquake added the label Windows on Dec 30, 2017
  5. vajdaz renamed this:
    Minimize to tray functionality only on Windows
    Qt: Minimize to tray functionality only on Windows
    on Dec 30, 2017
  6. Do not remove unused settings from the settings file d54e033294
  7. in src/qt/optionsmodel.cpp:74 in 2972b1ef46 outdated
      65 | @@ -64,6 +66,15 @@ void OptionsModel::Init(bool resetSettings)
      66 |      if (!settings.contains("fMinimizeToTray"))
      67 |          settings.setValue("fMinimizeToTray", false);
      68 |      fMinimizeToTray = settings.value("fMinimizeToTray").toBool() && !fHideTrayIcon;
      69 | +#else
      70 | +    // On systems without tray icon functionality we set some default values
      71 | +    // and remove settings from previous versions of the software to not
      72 | +    // confuse people looking into the .config or .plist file.
      73 | +    fHideTrayIcon = true;
      74 | +    settings.remove("fHideTrayIcon");
    


    promag commented at 2:35 AM on January 2, 2018:

    IIRC we don't remove old/unused settings. ping @laanwj.


    vajdaz commented at 9:06 PM on January 2, 2018:

    Ok, I have removed the removal of unused settings. To be honest, I realized the "ping @laanwj" only after my commit. Let's hope, Wladimir agrees.


    laanwj commented at 8:00 AM on January 3, 2018:

    Yes I agree, this makes it possible to upgrade/downgrade without losing settings.

  8. laanwj commented at 8:47 AM on January 3, 2018: member

    utACK, needs testing on Windows/Linux I suppose.

  9. kristapsk commented at 1:35 PM on January 4, 2018: contributor

    Why? Minimize to tray works for me on Xfce4.

  10. vajdaz commented at 11:16 PM on January 4, 2018: none

    On some desktop environments (Xfce4 or KDE for example) minimizing to tray works. Howerver, on other ones (GNOME or Unity for example) there is no system tray. On those desktop environments the user loses visual reference to the application when minimizing to tray (the application "disappears", still running in the background). Linux desktop environments seem not to be universal in the implementation of this feature. Discussions in PR #11859 lead to the idea of removing the "minimize to tray" functionality (at least on non-Windows systems).

  11. ryanofsky commented at 11:52 PM on January 4, 2018: member

    Howerver, on other ones (GNOME or Unity for example) there is no system tray.

    System tray icon shows up for me with gnome 3.24.2, qt-5.9.3, current master. (It shows up on the bottom left in a little slide out-tray next to hexchat and deluge icons.)

  12. vajdaz commented at 12:48 AM on January 5, 2018: none

    "Legacy system tray" has been removed in GNOME 3.26. https://bugzilla.gnome.org/show_bug.cgi?id=785956

  13. laanwj commented at 9:54 AM on January 5, 2018: member

    I've heard of issues with Xfce4 too. The icon appears initially, but seems to randomly disappear. Normally that's not that bad, but it is if it is the only way to get the window back (which is what this option enables). The systray situation on Linux is very unreliable.

  14. kristapsk commented at 11:32 AM on January 5, 2018: contributor

    I'm using it all the time under Xfce4 this way, can't remember having any issues. Bitcoin wallet is not the piece of software I want to pollute my anyway full taskbars with (as it's something that runs in background and I don't need to switch to it so often).

    Anyway, I'm Gentoo user, where everything is source based anyway, so, if this patch gets applied, I will anyway add my own extra patch on top of the release sources to get this functionality back.

  15. laanwj commented at 1:42 PM on January 5, 2018: member

    Looking at the replies, one guess would be that this is mostly a problem with the pre-built binaries (which link Qt statically), and less when building from source against a Qt5 tuned for the specific environment.

  16. ryanofsky commented at 2:04 PM on January 5, 2018: member

    It's unclear why this is implemented using a compile time macro rather than calling QSystemTrayIcon::isSystemTrayAvailable or something at runtime.

    I think if this feature is going to be disabled, there should at least be a proper bug report about where the problem is occurring so it can be revisited in the future. vajdaz seems to be a windows user, not a gnome or unity user. I use gnome and use tray icons and haven't had a problem with them.

  17. laanwj commented at 2:06 PM on January 5, 2018: member

    Closing this for now, seems to be no agreement to do this.

  18. laanwj closed this on Jan 5, 2018

  19. DrahtBot locked this on Sep 8, 2021

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-14 00:15 UTC

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