Bug 75302 - very minor: Reactivate previous window on auto-unshade
Summary: very minor: Reactivate previous window on auto-unshade
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-15 20:10 UTC by Martin Pärtel
Modified: 2004-02-16 16:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Pärtel 2004-02-15 20:10:45 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages
OS:          Linux

A minor suggestion for the useful feature of automatically unshading a shaded window when the mouse hovers over it and then shading it again when the mouse leaves:
The previously active window could become active again after auto-unshading another window.
Comment 1 Lubos Lunak 2004-02-16 16:19:52 UTC
CVS commit by lunakl: 

On auto unshading, don't keep focus on the unshaded window, revert
focus to the previously active window.
CCMAIL: 75302-done@bugs.kde.org


  M +7 -1      activation.cpp   2.19
  M +7 -1      client.cpp   1.409
  M +1 -0      workspace.h   1.164


--- kdebase/kwin/activation.cpp  #2.18:2.19
@@ -340,4 +340,11 @@ void Workspace::clientHidden( Client* c 
     {
     assert( !c->isShown( true ) || !c->isOnCurrentDesktop());
+    activateNextClient( c );
+    }
+
+// deactivates 'c' and activates next client    
+void Workspace::activateNextClient( Client* c )
+    {
+    // if 'c' is not the active or the to-become active one, do nothing
     if( !( c == active_client
             || ( should_get_focus.count() > 0 && c == should_get_focus.last())))

--- kdebase/kwin/client.cpp  #1.408:1.409
@@ -673,4 +673,5 @@ void Client::setShade( ShadeMode mode )
         return;
     bool was_shade = isShade();
+    ShadeMode was_shade_mode = shade_mode;
     shade_mode = mode;
     if( was_shade == isShade())
@@ -720,6 +721,11 @@ void Client::setShade( ShadeMode mode )
         plainResize( s );
         if( isActive())
+            {
+            if( was_shade_mode == ShadeHover )
+                workspace()->activateNextClient( this );
+            else
             workspace()->focusToNull();
         }
+        }
     else 
         {

--- kdebase/kwin/workspace.h  #1.163:1.164
@@ -119,4 +119,5 @@ class Workspace : public QObject, public
         bool fakeRequestedActivity( Client* c );
         void unfakeActivity( Client* c );
+        void activateNextClient( Client* c );
         bool focusChangeEnabled() { return block_focus == 0; }