Temporarily disable “minimize to tray” in the startup phase if the “-min” option is specified #691

pull runeksvendsen wants to merge 3 commits into bitcoin:master from runeksvendsen:master changing 2 files +9 −0
  1. runeksvendsen commented at 7:30 pm on December 9, 2011: contributor
    If the “minimize to tray”-option is in effect, and the Qt GUI is started with the “-min” option, the main window will not be recoverable from the tray icon by double clicking it. This is only the case if the main window is minimized to the tray in the start-up phase (by running window.showMinimized() in qt/bitcoin.cpp:main()). After the main window has been shown for the first time (in a minimized state), minimizing to the tray works again. This relates to pull request #679.
  2. If the "-min" option is specified (start minimized), temporarily disable the "minimize to tray"-functionality to avoid a main window that is unrecoverable from its tray icon 2d0d696c95
  3. When using Qt GUI, move parameter-parsing to start of qt/bitcoin.cpp:main()
    (second try)
    8cbb6ee1eb
  4. Don't forget the previous, user-selected value for fMinimizeToTray 8807000b25
  5. runeksvendsen commented at 8:16 pm on December 9, 2011: contributor
    You’ll have to excuse the additional commit 8cbb6ee that got in here. I tried to confine that commit to pull request #690 only, but that didn’t work apparently.
  6. laanwj commented at 9:46 pm on December 9, 2011: member
    Please test with the latest master, I’ve committed a small fix (no longer indirectly call show() in the constructor of BitcoinGUI) that might make a difference in this.
  7. runeksvendsen commented at 3:01 am on December 10, 2011: contributor

    Using latest master the -min option doesn’t work for me. Regardless of whether the “minimize to tray” option is on or not. I agree that the temporary shifting around is a bit hacky. Fixing it in BitcoinGUI::changeEvent might be more elegant, but as far as I can see we’d need to introduce some variable to indicate whether the program is starting up or not, since it’s only in the startup phase that I experience the problem. That seems sort of hacky as well. I wonder if it all seems too hacky because we’re trying to solve the wrong problem. You mentioned overriding BitcoinGUI::showMinimized, maybe this is the clean way to work around this issue?

    By the way, you’re using Unity while I’m using GNOME (2.32). That might be why you can’t reproduce this issue.

  8. runeksvendsen commented at 3:46 am on December 10, 2011: contributor
    Which tools are you using to debug stuff like this? I’d like to know if BitcoinGUI::trayIconActivated is called when I click the tray icon when it’s in its non-responding state. I’ve tried printf’s and message boxes but they seem to not work so well… Are you just using gdb?
  9. laanwj commented at 9:06 am on December 10, 2011: member

    Regarding -min not working in latest master: doubly weird, the only thing that’s changed is that the constructor of BitcoinGUI no longer calls show(). This is the normal behavior for Qt widgets; the client decides whether, and when to show it.

    Overriding BitcoinGUI::showMinimized was my initial idea. But AFAIK you can’t avoid the changeEvent there either, so end up with a similar hack. It’d indeed be better to try to understand the underlying problem instead of just hacking around it :)

    The tool I’m using is the built-in debugger of Qt Creator, which I believe internally uses gdb, but is easier to use as you can visually see what happens.

  10. luke-jr commented at 7:33 pm on December 24, 2011: member
    FWIW, on my system with current master (5ad2ca0), -min ignores the “minimize to system tray” setting, and starts minimized normally. I consider this a bug.
  11. laanwj commented at 8:37 am on April 16, 2012: member
    I think this is fixed now? Just tested on Ubuntu, and it works fine.
  12. runeksvendsen commented at 11:13 am on April 16, 2012: contributor
    Yep. Worksforme.
  13. runeksvendsen closed this on Apr 16, 2012

  14. jpentland referenced this in commit c0ec48a51a on Feb 7, 2016
  15. kallewoof referenced this in commit 1cd81acdd7 on Oct 4, 2019
  16. rajarshimaitra referenced this in commit ab2f47b7ba on Aug 5, 2021
  17. 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: 2024-10-05 07:12 UTC

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