diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 3374d83f44..9987433a36 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -32,6 +32,7 @@ keys->insertItem(i18n("Window resize"),"Window resize", ""); keys->insertItem(i18n("Window raise"),"Window raise", ""); keys->insertItem(i18n("Window lower"),"Window lower", ""); + keys->insertItem(i18n("Window raise-or-lower"), "Toggle raise and lower", ""); keys->insertItem(i18n("Walk through desktops"),"Walk through desktops", "CTRL+Tab"); keys->insertItem(i18n("Walk back through desktops"),"Walk back through desktops", "SHIFT+CTRL+Tab"); @@ -43,3 +44,4 @@ keys->insertItem(i18n("Logout"),"Logout", "CTRL+ALT+Delete"); keys->insertItem(i18n("Kill Window"),"Kill Window", "CTRL+ALT+Escape"); + diff --git a/workspace.cpp b/workspace.cpp index f6df1cfa7d..4667b9a9d2 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1904,6 +1904,20 @@ void Workspace::raiseClient( Client* c ) } +void Workspace::raiseOrLowerClient( Client *c) +{ + if (!c) return; + + if (c == most_recently_raised) + { + lowerClient(c); + } + else + { + raiseClient(c); + } +} + /*! Private auxiliary function used in raiseClient() @@ -2282,6 +2296,7 @@ void Workspace::createKeybindings(){ keys->connectItem( "Window resize", this, SLOT( slotWindowResize() ) ); keys->connectItem( "Window raise", this, SLOT( slotWindowRaise() ) ); keys->connectItem( "Window lower", this, SLOT( slotWindowLower() ) ); + keys->connectItem( "Toggle raise and lower", this, SLOT( slotWindowRaiseOrLower() ) ); keys->connectItem( "Walk through desktops", this, SLOT( slotWalkThroughDesktops())); keys->connectItem( "Walk back through desktops", this, SLOT( slotWalkBackThroughDesktops())); @@ -2453,6 +2468,15 @@ void Workspace::slotWindowLower() lowerClient( popup_client ); } +/*! + Does a toggle-raise-and-lower on the popup client; + */ +void Workspace::slotWindowRaiseOrLower() +{ + if ( popup_client ) + raiseOrLowerClient( popup_client ); +} + /*! Invokes keyboard mouse emulation diff --git a/workspace.h b/workspace.h index a8c1173d71..f9fa8dbe51 100644 --- a/workspace.h +++ b/workspace.h @@ -130,6 +130,7 @@ public: QPoint adjustClientPosition( Client* c, QPoint pos ); void raiseClient( Client* c ); void lowerClient( Client* c ); + void raiseOrLowerClient( Client * ); void clientHidden( Client* ); @@ -227,6 +228,7 @@ public slots: void slotWindowShade(); void slotWindowRaise(); void slotWindowLower(); + void slotWindowRaiseOrLower(); void slotWalkThroughDesktops(); void slotWalkBackThroughDesktops();