Window shortcuts now toggle (raise/minimize) windows.
This allows me to use all applications in a Yakuake-like method. I can define a shortcut for an application, press it, window shows up, do my work, press it again and it hides. This is specifically good for a Text Editor<-->Browser switching workflow. Also my first kwin patch.
This commit is contained in:
parent
5d7b3b6df5
commit
f1b497e2b0
1 changed files with 5 additions and 1 deletions
|
@ -922,7 +922,11 @@ void Client::updateUrgency()
|
|||
|
||||
void Client::shortcutActivated()
|
||||
{
|
||||
workspace()->activateClient(this, true); // force
|
||||
Client* raised_client = workspace()->topClientOnDesktop(desktop(), -1);
|
||||
if (isActive() && this == raised_client) // if client is already raised, pressing its shorcut hides it, giving the shortcut a 'toggle' effect
|
||||
setMinimized(true);
|
||||
else
|
||||
workspace()->activateClient(this, true); // force
|
||||
}
|
||||
|
||||
//****************************************
|
||||
|
|
Loading…
Reference in a new issue