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:
Emil Sedgh 2012-11-22 02:51:36 +03:30
parent 5d7b3b6df5
commit f1b497e2b0

View file

@ -922,7 +922,11 @@ void Client::updateUrgency()
void Client::shortcutActivated() 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
} }
//**************************************** //****************************************