Bug 179749

Summary: "Show desktop" widget loses state
Product: [Unmaintained] plasma4 Reporter: Mary Ellen Foster <mefoster>
Component: widget-miscAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: abdurrahmanavci, asraniel, diego.ml, finex, kde, mgraesslin, rpetrick
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Mary Ellen Foster 2009-01-05 21:24:47 UTC
Version:            (using Devel)
Installed from:    Compiled sources

This is 100% reproduceable on two different computers, both running KDE 4.2 beta 2 from kde-redhat:

- Add the "show desktop" plasmoid to the panel
- Open some windows
- Click "show desktop" -- visible windows disappear
- (If you click "show desktop" again here, the visible windows reappear as expected, but that's not the point)
- Open the menu or the "recently plugged devices" widget (probably others too)
- Now clicking "show desktop" doesn't do anything any more -- all windows are minimised whatever their previous state
Comment 1 FiNeX 2009-01-06 17:13:52 UTC
Confirmed using r906622
Comment 2 Diego 2009-01-24 14:47:13 UTC
Same here with KDE 4.2 RC1 for Fedora 10 from kde-testing repo.

This occurs (at least) every time you click on another plasmoid.

Another test is the following:
- add two "show desktop" plasmoids;
- try to use one to minimize and the other to unminimize. I'd bet you won't be able to do that unless you patch.

So please confirm this bug, it's easily reproducible.
Comment 3 Diego 2009-01-24 14:49:56 UTC
Mmm... sorry, it's already confirmed. Excuse me for the unwanted spam. :'(
Comment 4 Beat Wolf 2009-11-30 13:57:10 UTC
is this a kwin or plasma bug?
Comment 5 Abdurrahman AVCI 2009-12-19 11:38:32 UTC
The problem here is extender windows (kickoff menu, calendar etc.) are treated like real windows, so whenever you open one window states are reset.
Comment 6 Nicolas L. 2010-06-07 00:50:15 UTC
i don't reprocuce on kde 4.4

Can someone test again please ?
Comment 7 Diego 2010-06-12 18:11:57 UTC
I still have it on 4.4.4. Try with two "Show desktop" plasmoids...
Comment 8 FiNeX 2010-08-15 20:20:43 UTC
Bug confirmed in KDE 4.4.5 and 4.5.0.
Comment 9 Diego 2011-01-29 12:48:01 UTC
(In reply to comment #8)
> Bug confirmed in KDE 4.4.5 and 4.5.0.

...and 4.6.0
Comment 10 Beat Wolf 2011-11-23 20:08:18 UTC
confirmed in 4.7
Comment 11 Martin Flöser 2011-11-23 22:05:34 UTC
The behavior described in this report is (unfortunately) correct and expected behavior.

By clicking the show desktop entry all windows gets minimized. In fact show desktop is just a poor mans "click on each minimize button". Clicking it again restores the normal state.

Now when a window is opened the situation becomes tricky. What is the expected behavior afterward? There are now a set of minimized windows due to show desktop and one window unminimized due to the map request. Should a click on the show desktop button minimize the new window or restore the previous ones? Minimizing the new one would destroy the information about which windows were minimized due to show desktop. The simple toggle functionality would have to be turned into a history of show desktop events with the windows it affected. Obviously this is not possible as there are too many events which influence the state.

But also restoring is not the correct behavior as there is a new window which might be hidden after restoring.

In summary, we have two possible solutions and neither is optimal, so the best feasible solution has to be taken. This is the behavior observed in this bug.

Looking at the KWin source code it is quite clear that ending the show desktop state is intended when a new window is opened:
https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/entry/kwin/manage.cpp#L573

Additionally I found that there seems to be a config option to influence the behavior of exactly the case of a new window is opened. I have not tried it myself, so I just provide the comment from source code:

/**
 * Following Kicker's behavior:
 * Changing a virtual desktop resets the state and shows the windows again.
 * Unminimizing a window resets the state but keeps the windows hidden (except
 * the one that was unminimized).
 * A new window resets the state and shows the windows again, with the new window
 * being active. Due to popular demand (#67406) by people who apparently
 * don't see a difference between "show desktop" and "minimize all", this is not
 * true if "showDesktopIsMinimizeAll" is set in kwinrc. In such case showing
 * a new window resets the state but doesn't show windows.
 */

The default for named config option is "false".

Overall I'm sorry to say that this is intended behavior, which renders the bug invalid.
Comment 12 Ron Petrick 2011-11-25 15:25:57 UTC
Just one observation with regard to Martin's comment: the original bug description speaks to opening a menu after show desktop has been pressed, not opening additional application windows.

I agree with your assessment that opening additional application windows while other windows are minimised does present problems, but is this the same situation as clicking on the K-menu application launcher?

For instance, my system (KDE 4.7.3 running on Fedora 16) produces the following behaviour:

1) If I open up a set of application windows and repeatedly click on show desktop, it acts as a toggle: clicking once causes all windows to be minimised; clicking again restores the state of all windows.

2) If I open up a set of application windows and then click on the K-menu application launcher, further clicks to show desktop do nothing. The application windows all stay minimised.

According to Martin's message, 2) is correct behaviour, however, this seems strange since the kickoff launcher only displays a temporary popup window that then disappears. Why should this produce the same problem of inconsistent state? If it does, then maybe 1) shouldn't be considered correct behaviour. Maybe show desktop should really just "show the desktop" and not act like a toggle at all in certain situations.

As it stands, the current behaviour does seem somewhat inconsistent in my opinion.
Comment 13 Martin Flöser 2011-11-25 15:42:03 UTC
> I agree with your assessment that opening additional application windows
> while other windows are minimised does present problems, but is this the
> same situation as clicking on the K-menu application launcher?
From the perspective of a window manager the K-menu application launcher is 
just a window like any other window as well. In fact the same should even be 
the case for Plasma styled tooltips or all the etenders.