Start building up of ClientModel with the first Client to include
So far the first Client to be shown in the list (that is the currently active window) was inserted as the last client into the list by prepending it to the list. This meant that if another Client actually blocks the inclusion of the currently selected Client (e.g. only one window per app) the currently active Client never got included in this list. This change ensures that the recently used model switching has the starting Client as the first Client in the list and also simplifies the code. Stacking order switching mode is not adjusted as it seems rather broken, like the comment already says. BUG: 304950 FIXED-IN: 4.9.1 REVIEW: 106139
This commit is contained in:
parent
a4fed7188c
commit
2f18fe002f
2 changed files with 7 additions and 11 deletions
|
@ -187,7 +187,7 @@ void ClientModel::createClientList(int desktop, bool partialReset)
|
||||||
|
|
||||||
switch(tabBox->config().clientSwitchingMode()) {
|
switch(tabBox->config().clientSwitchingMode()) {
|
||||||
case TabBoxConfig::FocusChainSwitching: {
|
case TabBoxConfig::FocusChainSwitching: {
|
||||||
TabBoxClient* c = tabBox->nextClientFocusChain(start).data();
|
TabBoxClient* c = start;
|
||||||
if (!c) {
|
if (!c) {
|
||||||
QSharedPointer<TabBoxClient> firstClient = tabBox->firstClientFocusChain().toStrongRef();
|
QSharedPointer<TabBoxClient> firstClient = tabBox->firstClientFocusChain().toStrongRef();
|
||||||
if (firstClient) {
|
if (firstClient) {
|
||||||
|
@ -195,23 +195,16 @@ void ClientModel::createClientList(int desktop, bool partialReset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TabBoxClient* stop = c;
|
TabBoxClient* stop = c;
|
||||||
while (c) {
|
do {
|
||||||
QWeakPointer<TabBoxClient> add = tabBox->clientToAddToList(c, desktop);
|
QWeakPointer<TabBoxClient> add = tabBox->clientToAddToList(c, desktop);
|
||||||
if (!add.isNull()) {
|
if (!add.isNull()) {
|
||||||
if (start == add.data()) {
|
m_clientList += add;
|
||||||
m_clientList.removeAll(add);
|
|
||||||
m_clientList.prepend(add);
|
|
||||||
} else
|
|
||||||
m_clientList += add;
|
|
||||||
if (add.data()->isFirstInTabBox()) {
|
if (add.data()->isFirstInTabBox()) {
|
||||||
stickyClients << add;
|
stickyClients << add;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c = tabBox->nextClientFocusChain(c).data();
|
c = tabBox->nextClientFocusChain(c).data();
|
||||||
|
} while (c && c != stop);
|
||||||
if (c == stop)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TabBoxConfig::StackingOrderSwitching: {
|
case TabBoxConfig::StackingOrderSwitching: {
|
||||||
|
|
|
@ -225,6 +225,9 @@ bool TabBoxHandlerImpl::checkMultiScreen(TabBoxClient* client) const
|
||||||
|
|
||||||
QWeakPointer<TabBoxClient> TabBoxHandlerImpl::clientToAddToList(TabBoxClient* client, int desktop) const
|
QWeakPointer<TabBoxClient> TabBoxHandlerImpl::clientToAddToList(TabBoxClient* client, int desktop) const
|
||||||
{
|
{
|
||||||
|
if (!client) {
|
||||||
|
return QWeakPointer<TabBoxClient>();
|
||||||
|
}
|
||||||
Client* ret = NULL;
|
Client* ret = NULL;
|
||||||
Client* current = (static_cast< TabBoxClientImpl* >(client))->client();
|
Client* current = (static_cast< TabBoxClientImpl* >(client))->client();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue