diff --git a/kcmkwin/kwintabbox/main.ui b/kcmkwin/kwintabbox/main.ui
index d3f4e519db..2b12839a07 100644
--- a/kcmkwin/kwintabbox/main.ui
+++ b/kcmkwin/kwintabbox/main.ui
@@ -90,6 +90,16 @@
All Desktops
+ -
+
+ Current Desktop Grouped by Applications
+
+
+ -
+
+ All Desktops Grouped by Applications
+
+
-
diff --git a/tabbox.cpp b/tabbox.cpp
index dbf827560d..bd6b25046c 100644
--- a/tabbox.cpp
+++ b/tabbox.cpp
@@ -124,6 +124,8 @@ TabBoxClient* TabBoxHandlerImpl::clientToAddToList( TabBoxClient* client, int de
Client* ret = NULL;
Client* current = (static_cast< TabBoxClientImpl* >( client ))->client();
bool addClient = false;
+ bool applications = (config().clientListMode() == TabBoxConfig::AllDesktopsApplicationList ||
+ config().clientListMode() == TabBoxConfig::CurrentDesktopApplicationList);
if( allDesktops )
addClient = true;
else
@@ -140,6 +142,21 @@ TabBoxClient* TabBoxHandlerImpl::clientToAddToList( TabBoxClient* client, int de
{
// nothing
}
+ if( ret && applications )
+ {
+ // check if the list already contains an entry of this application
+ foreach( TabBoxClient* tabBoxClient, clientList() )
+ {
+ if( TabBoxClientImpl* c = dynamic_cast< TabBoxClientImpl* >(tabBoxClient) )
+ {
+ if( c->client()->resourceClass() == ret->resourceClass() )
+ {
+ ret = NULL;
+ break;
+ }
+ }
+ }
+ }
}
if( options->separateScreenFocus && options->xineramaEnabled )
{
diff --git a/tabbox/tabboxconfig.h b/tabbox/tabboxconfig.h
index d94896fb3b..91d0c87114 100644
--- a/tabbox/tabboxconfig.h
+++ b/tabbox/tabboxconfig.h
@@ -68,7 +68,9 @@ class TabBoxConfig
enum ClientListMode
{
CurrentDesktopClientList, ///< Only TabBoxClients on current desktop are included
- AllDesktopsClientList ///< TabBoxClients from all desktops are included.
+ AllDesktopsClientList, ///< TabBoxClients from all desktops are included.
+ CurrentDesktopApplicationList, ///< Only one TabBoxClient for each application on current desktop is included
+ AllDesktopsApplicationList ///< Only one TabBoxClient for each application is included
};
/**
* ClientSwitchingMode defines the sorting of the TabBoxClients in the