Yet another alternative "minimize to tray" implementation #853

Merged
merged 2 commits into from Feb 27, 2012

Conversation

Projects
None yet
4 participants
Owner

laanwj commented Feb 17, 2012

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...

Contributor

sje397 commented Feb 17, 2012

It works on Windows

Contributor

sje397 commented Feb 17, 2012

-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.

Owner

laanwj commented Feb 17, 2012

I'm starting to think that's simply a KDE bug...

Contributor

sje397 commented Feb 17, 2012

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.

Member

luke-jr commented Feb 17, 2012

This causes the window to flash (hide + show) every time I change tab, and it is even repositioned (by the window manager, KWin). :(

Owner

laanwj commented Feb 17, 2012

@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...).

Member

luke-jr commented Feb 17, 2012

git bisect narrowed it down to this commit.

Owner

laanwj commented Feb 17, 2012

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...

Owner

laanwj commented Feb 17, 2012

The new commit should solve this problem (by showing/showNormal only when needed).

Member

luke-jr commented Feb 17, 2012

Just noticed 337258e is the version that made it into next-test (and introduces the problem). Current master (and 337258e^) is fine.

@laanwj laanwj referenced this pull request Feb 18, 2012

Merged

Toggle hide #855

Contributor

sje397 commented Feb 18, 2012

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.

Owner

sipa commented Feb 27, 2012

What's the status on this?

Owner

laanwj commented Feb 27, 2012

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..

laanwj added a commit that referenced this pull request Feb 27, 2012

Merge pull request #853 from laanwj/2012_02_altminimizetray
Yet another alternative "minimize to tray" implementation

Fixes problems with window positioning.

@laanwj laanwj merged commit fbbd42a into bitcoin:master Feb 27, 2012

Owner

laanwj commented Mar 15, 2012

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 :/

@laanwj laanwj referenced this pull request Mar 20, 2012

Closed

Remove "minimize to tray" #961

coblee pushed a commit to litecoin-project/litecoin that referenced this pull request Jul 17, 2012

Merge pull request #853 from laanwj/2012_02_altminimizetray
Yet another alternative "minimize to tray" implementation

Fixes problems with window positioning.

@laanwj laanwj deleted the laanwj:2012_02_altminimizetray branch Apr 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment