Add application switching to TabBox (that is only one element per window class).

FEATURE: 206950

svn path=/trunk/KDE/kdebase/workspace/; revision=1042640
remotes/origin/Plasma/5.0
Martin Gräßlin 17 years ago
parent 1c1ad9f8b9
commit 60a152eca9
  1. 10
      kcmkwin/kwintabbox/main.ui
  2. 17
      tabbox.cpp
  3. 4
      tabbox/tabboxconfig.h

@ -90,6 +90,16 @@
<string>All Desktops</string>
</property>
</item>
<item>
<property name="text">
<string>Current Desktop Grouped by Applications</string>
</property>
</item>
<item>
<property name="text">
<string>All Desktops Grouped by Applications</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">

@ -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 )
{

@ -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

Loading…
Cancel
Save