Bug 67406

Summary: Show desktop button and start a new program: the behaviour changed
Product: [Plasma] kwin Reporter: palantir
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: georgiytreyvus, glitch13, jdg, jorge.adriano, k_ilya, mymailclone, ndeb, pandu_rao, richae, seb.kde, simonandric5
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: A (maybe incomplete and erroneous) patch

Description palantir 2003-11-06 13:56:56 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

When you press the show desktop button and then start a new applications all the previously hidden windows are restored, and this is a real mess.
Wishlist item Bug 60480 proposes such a solution, and you answer that the correct behaviour is to keep all the windows hidden (which is what happens in KDE 3.1 and is IMHO the best solution)...
Comment 1 palantir 2004-01-21 21:51:05 UTC
Created attachment 4279 [details]
A (maybe incomplete and erroneous) patch

I attach something that pretends to be a patch, I hope the format is
acceptable. To solve the issue, I have added a new slot to catch the event when
a new window is created. By the way I fixed the following bug: when the desktop
was hidden, you could not switch to another desktop.
I don't know the architecture of NETWinInfo so I didn't add the controls which
are done by slotWindowChanged. They are maybe needed, however the thing seems
to work anyway.
Comment 2 Lubos Lunak 2004-02-17 18:52:05 UTC
*** Bug 75361 has been marked as a duplicate of this bug. ***
Comment 3 Lubos Lunak 2004-02-26 17:45:20 UTC
*** Bug 74361 has been marked as a duplicate of this bug. ***
Comment 4 Lubos Lunak 2004-03-04 14:59:31 UTC
*** Bug 76720 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Fester 2004-03-22 22:40:55 UTC
I tested Maciej's patch on Debian testing/unstable with KDE 3.2.1, and it works very well: the mess is gone :-)
Comment 6 Lubos Lunak 2004-04-05 11:58:22 UTC
*** Bug 79013 has been marked as a duplicate of this bug. ***
Comment 7 Lubos Lunak 2004-05-19 10:15:14 UTC
*** Bug 60480 has been marked as a duplicate of this bug. ***
Comment 8 Lubos Lunak 2004-06-07 14:03:25 UTC
*** Bug 79543 has been marked as a duplicate of this bug. ***
Comment 9 palantir 2004-06-16 17:01:13 UTC
This seem to me one of those cases where a configuration option should be given. People coming from windows are expecting the bevaviour the patch proposes and there are also many users who'd like the button to work this way. OTOH there is also a lot of people who prefer the current way of handling the windows. So I believe that this should be possible to configure, in a menu that would appear right clicking the button or somewhere in the Control Center...
Comment 10 Andreas Fester 2004-06-16 22:54:27 UTC
I suggest a new check box in the control center in the Desktop/Behaviour/General tab, below "Show tooltips". It could be labeled
"Undo shown desktop on application start" (or the inverse, "Retain shown desktop on application start").
If I can be of any help to fix this bug, please let me know; its really annoying to always have to pull the sources and apply this patch for each new KDE version ;-)
Comment 11 Sebastian Stein 2004-06-18 00:21:09 UTC
I can't recreate the bug on KDE 3.2.3. Can anyone confirm this?
Comment 12 Julien Antille 2004-06-18 00:27:06 UTC
3.2.3 seems fixed here. Either my Debian build includes the patch, or it's fixed in the source themselves.
Comment 13 Andreas Fester 2004-06-20 14:06:19 UTC
Same for me. I just upgraded to 3.2.3 from Debian unstable and the bug seems fixed.
Comment 14 Jorge Adriano 2004-06-20 15:09:06 UTC
Fine here, KDE 3.2.3 SuSE 8.2 RPMs.
Comment 15 palantir 2004-06-20 15:20:49 UTC
So the main point has been corrected. 
The only thing left is that you cannot change desktop while the show desktop button is on, but maybe a new report should be opened for that? How is this in the CVS?
Comment 16 Jorge Adriano 2004-06-20 15:31:57 UTC
> The only thing left is that you cannot change desktop while the show
> desktop button is on, but maybe a new report should be opened for that? How
> is this in the CVS?

It's already reported:
Bug 78109: "show desktop" breaks desktop switching 
http://bugs.kde.org/show_bug.cgi?id=78109

J.A.

Comment 17 palantir 2004-06-20 15:38:51 UTC
So marking as resolved.
Comment 18 Ronny Standtke 2006-05-14 10:50:36 UTC
Using KDE-3.5.2 and the bug seems to be here again. All hidden windows are restored :-(
Comment 19 MM 2006-05-14 11:53:23 UTC
Yup. I have given up. It seems like the KDE people like it this way. I still suggest an option in the control center...

This bug should be REOPENED...
Comment 20 Sebastian Stein 2006-05-14 12:15:22 UTC
Ronny Standtke <Ronny.Standtke@gmx.net> [060514 12:09]:
> ------- Additional Comments From Ronny.Standtke gmx net  2006-05-14 10:50 -------
> Using KDE-3.5.2 and the bug seems to be here again. All hidden windows are
> restored :-(


Mmmh, I do not even have this item anymore in my taskbar. How can I get it
back? But fortunately I still know the shortcut (Ctrl+Alt+D) and this seems
to work without problems.

Sebastian
Comment 21 MM 2006-05-14 12:19:24 UTC
I use Win+M as shortcut, but the effect is exactly the same. To get the button back on the taskbar, right click on an empty space of kicker and click on "Add applet to panel..." The new cool applet chooser appears, somewhere towards the bottom you'll find the Show Desktop item.
Comment 22 Sebastian Stein 2006-05-14 13:54:15 UTC
Yes, you are correct, now I also see that the hold behaviour is back.

Sebastian
Comment 23 Lubos Lunak 2006-05-30 13:37:37 UTC
SVN commit 546547 by lunakl:

For people who don't see the difference between "show desktop"
and "minimize all" add config option ShowDesktopIsMinimizeAll
in group [Windows] in kwinrc.
BUG: 67406



 M  +14 -2     kicker/kicker/core/showdesktop.cpp  
 M  +1 -0      kwin/kwin.kcfg  
 M  +1 -1      kwin/manage.cpp  
 M  +1 -0      kwin/options.cpp  
 M  +2 -0      kwin/options.h  
 M  +4 -1      kwin/workspace.cpp  


--- branches/KDE/3.5/kdebase/kicker/kicker/core/showdesktop.cpp #546546:546547
@@ -47,6 +47,7 @@
     // KDE is running with another WM without the feature.
     NETRootInfo i( qt_xdisplay(), NET::Supported );
     m_wmSupport = i.isSupported( NET::WM2ShowingDesktop );
+    m_wmSupport = false;
     if( m_wmSupport )
     {
         connect( Kicker::the()->kwinModule(), SIGNAL( showingDesktopChanged( bool )),
@@ -74,8 +75,19 @@
     if ((windowType == NET::Normal || windowType == NET::Unknown) &&
         inf.mappingState() == NET::Visible)
     {
-        m_activeWindow = w;
-        showDesktop(false);
+        KConfig kwincfg( "kwinrc", true ); // see in kwin
+        kwincfg.setGroup( "Windows" );
+        if( kwincfg.readBoolEntry( "ShowDesktopIsMinimizeAll", false ))
+        {
+            m_iconifiedList.clear();
+            m_showingDesktop = false;
+            emit desktopShown(false);
+        }
+        else
+        {
+            m_activeWindow = w;
+            showDesktop(false);
+        }
     }
 }
 
--- branches/KDE/3.5/kdebase/kwin/kwin.kcfg #546546:546547
@@ -59,6 +59,7 @@
   <entry key="ElectricBorderDelay" type="Int" />
   <entry key="IgnorePositionClasses" type="StringList" />
   <entry key="KillPingTimeout" type="Int" />
+  <entry key="ShowDesktopIsMinimizeAll" type="Bool" />
  </group>
  <group name="WM" >
   <entry key="frame" type="Color" />
--- branches/KDE/3.5/kdebase/kwin/manage.cpp #546546:546547
@@ -465,7 +465,7 @@
                 break;
                 }
         if( !belongs_to_desktop && workspace()->showingDesktop())
-            workspace()->resetShowingDesktop( false );
+            workspace()->resetShowingDesktop( options->showDesktopIsMinimizeAll );
 
         if( isOnCurrentDesktop() && !isMapped && !allow )
             workspace()->restackClientUnderActive( this );
--- branches/KDE/3.5/kdebase/kwin/options.cpp #546546:546547
@@ -152,6 +152,7 @@
 
     killPingTimeout = config->readNumEntry( "KillPingTimeout", 5000 );
     hideUtilityWindowsForInactive = config->readBoolEntry( "HideUtilityWindowsForInactive", true );
+    showDesktopIsMinimizeAll = config->readBoolEntry( "ShowDesktopIsMinimizeAll", false );
 
     // Mouse bindings
     config->setGroup( "MouseBindings");
--- branches/KDE/3.5/kdebase/kwin/options.h #546546:546547
@@ -182,6 +182,8 @@
          * Animation speed (0 .. 10 )
         */
         int animateMinimizeSpeed;
+        
+        bool showDesktopIsMinimizeAll;
 
         /**
          * whether or not we roll over to the other edge when switching desktops past the edge
--- branches/KDE/3.5/kdebase/kwin/workspace.cpp #546546:546547
@@ -2607,7 +2607,10 @@
 // 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.
+// 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.
 void Workspace::resetShowingDesktop( bool keep_hidden )
     {
     if( block_showing_desktop > 0 )
Comment 24 Lubos Lunak 2006-08-25 13:59:38 UTC
*** Bug 76151 has been marked as a duplicate of this bug. ***
Comment 25 Sorin Silaghi 2006-09-04 10:48:17 UTC
there should be a way to set this option without recompiling KDE :(
Comment 26 Lubos Lunak 2006-10-13 16:55:41 UTC
*** Bug 108899 has been marked as a duplicate of this bug. ***
Comment 27 Thomas Lübking 2013-10-30 17:07:31 UTC
*** Bug 326753 has been marked as a duplicate of this bug. ***
Comment 28 Thomas Lübking 2013-11-05 19:03:34 UTC
*** Bug 326753 has been marked as a duplicate of this bug. ***
Comment 29 Thomas Lübking 2013-11-06 22:37:48 UTC
*** Bug 299655 has been marked as a duplicate of this bug. ***
Comment 30 Thomas Lübking 2013-11-06 22:39:14 UTC
FYI, brainstorm on topic on forum.kde.org
http://forum.kde.org/viewtopic.php?f=83&t=118281
Comment 31 Thomas Lübking 2014-06-30 17:40:02 UTC
*** Bug 336909 has been marked as a duplicate of this bug. ***
Comment 32 Thomas Lübking 2015-10-21 14:21:45 UTC
*** Bug 354156 has been marked as a duplicate of this bug. ***