diff --git a/activation.cpp b/activation.cpp index d9f39b8881..a3b87a74c0 100644 --- a/activation.cpp +++ b/activation.cpp @@ -339,10 +339,16 @@ void Workspace::requestFocus( Client* c, bool force ) 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()))) return; - if( popup ) popup->close(); if( c == active_client ) diff --git a/client.cpp b/client.cpp index cdbcca45bf..983f2d53cc 100644 --- a/client.cpp +++ b/client.cpp @@ -672,6 +672,7 @@ void Client::setShade( ShadeMode mode ) if( shade_mode == mode ) return; bool was_shade = isShade(); + ShadeMode was_shade_mode = shade_mode; shade_mode = mode; if( was_shade == isShade()) return; // no real change in shaded state @@ -719,7 +720,12 @@ void Client::setShade( ShadeMode mode ) shade_geometry_change = false; plainResize( s ); if( isActive()) - workspace()->focusToNull(); + { + if( was_shade_mode == ShadeHover ) + workspace()->activateNextClient( this ); + else + workspace()->focusToNull(); + } } else { diff --git a/workspace.h b/workspace.h index da96e51bd3..535c214d98 100644 --- a/workspace.h +++ b/workspace.h @@ -118,6 +118,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine void gotFocusIn( const Client* ); bool fakeRequestedActivity( Client* c ); void unfakeActivity( Client* c ); + void activateNextClient( Client* c ); bool focusChangeEnabled() { return block_focus == 0; } void updateColormap();