Yet another alternative “minimize to tray” implementation #853

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2012_02_altminimizetray changing 2 files +27 −29
  1. laanwj commented at 12:55 pm on February 17, 2012: member

    After suggestion by @sje397.

    The dummy window gives trouble on KDE. Changing the main window to a tool window also hides it from the taskbar, and seems to work at least on KDE and GNOME/Ubuntu.

    Whether it works as expected on Windows and Mac is unknown.

    Testing welcome…

  2. sje397 commented at 1:33 pm on February 17, 2012: contributor
    It works on Windows
  3. sje397 commented at 3:20 pm on February 17, 2012: contributor

    -Unfortunately, this patch doesn’t fix the problem of the window forgetting its position when hidden in KDE.-

    Strike that sorry, it works ok in KDE.

    I think you need to remove the ‘showNormal’ in the else clause of the ‘changeEvent’ method, because it breaks maximizing the window.

  4. laanwj commented at 3:31 pm on February 17, 2012: member
    I’m starting to think that’s simply a KDE bug…
  5. sje397 commented at 3:37 pm on February 17, 2012: contributor
    One more thing: changing tabs calls showNormal. That moves the window position slightly for me, in KDE and in Windows. You could add ‘if(isVisible())’ there, but maybe the dummy widget is better after all (but that does reset the window position to a corner of the screen on hide or minimize for me in KDE). There’s also the option of saving/restoring window geometry using QSettings and QWidget::saveGeometry and QWidget::restoreGeometry.
  6. Hide window from taskbar when "minimize to tray" active by making window into Tool window 83d1d1a906
  7. luke-jr commented at 7:37 pm on February 17, 2012: member
    This causes the window to flash (hide + show) every time I change tab, and it is even repositioned (by the window manager, KWin). :(
  8. laanwj commented at 8:47 pm on February 17, 2012: member

    @luke-jr you don’t have that problem without this pull request? I find it strange, because this patch no longer overrides showNormal (which is called when you click a tab).

    The stuff in changeEvent does not fire when you change tabs (at least, shouldn’t be, as it explicitly checks for state transitions from and to minimized…).

  9. luke-jr commented at 9:04 pm on February 17, 2012: member
    git bisect narrowed it down to this commit.
  10. laanwj commented at 10:12 pm on February 17, 2012: member

    I think it is already wrong with the current -master branch.

    The problem was introduced when I started calling showNormal for all the tab clicks. The same problem that causes the window to go back from maximized to normal…

  11. Do show/showNormal only when needed. 17690ea5a7
  12. laanwj commented at 10:20 pm on February 17, 2012: member
    The new commit should solve this problem (by showing/showNormal only when needed).
  13. luke-jr commented at 10:21 pm on February 17, 2012: member
    Just noticed 337258e is the version that made it into next-test (and introduces the problem). Current master (and 337258e^) is fine.
  14. sje397 commented at 12:52 pm on February 18, 2012: contributor

    This works much better for me in KDE. Maximising is good too.

    There is still one bug, but it’s probably Qt: if I hide the window using the close button the first time I hide it, restoring it the first time puts it back in a corner of the desktop. It doesn’t happen if I minimise. Subsequent hide events via minimise or close don’t have the issue.

  15. sipa commented at 0:50 am on February 27, 2012: member
    What’s the status on this?
  16. laanwj commented at 6:24 am on February 27, 2012: member

    It works better than what’s in now with regard to remembering window location/size.

    This was tried on linux (kde/gnome/unity) and windows, which are the platforms the “minimize to tray” feature even exists (On mac, it is disabled).

    So let’s merge it and pray it won’t break yet another obscure WM :) The worst it could do is break minimize to tray..

  17. laanwj referenced this in commit fbbd42a535 on Feb 27, 2012
  18. laanwj merged this on Feb 27, 2012
  19. laanwj closed this on Feb 27, 2012

  20. laanwj commented at 8:39 pm on March 15, 2012: member
    Ok this has problems on windows: when minimize to tray is enabled, and the window is minimized it indeed disappears. However, if you bring it back it’s still a tool window (with small titlebar with a small ‘x’). For some reason the unminimize event never reaches changeEvent :/
  21. coblee referenced this in commit 79ce6d556a on Jul 17, 2012
  22. laanwj deleted the branch on Apr 9, 2014
  23. 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-11-23 12:12 UTC

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