Fix a logic hole that would result in hidden teams being visible in switcher (sans icon) on ctrl+~. Fixes #4290.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38311 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c7dfa2ce78
commit
f1684e3466
@ -308,7 +308,7 @@ OKToUse(const TTeamGroup* teamGroup)
|
||||
if ((teamGroup->Flags() & B_BACKGROUND_APP) != 0)
|
||||
return false;
|
||||
|
||||
// skip the Deakbar itself
|
||||
// skip the Deskbar itself
|
||||
if (strcasecmp(teamGroup->Signature(), kDeskbarSignature) == 0)
|
||||
return false;
|
||||
|
||||
@ -856,6 +856,23 @@ TSwitchManager::CycleWindow(bool forward, bool wrap)
|
||||
|
||||
void
|
||||
TSwitchManager::CycleApp(bool forward, bool activateNow)
|
||||
{
|
||||
int32 startIndex = fCurrentIndex;
|
||||
|
||||
if (_FindNextValidApp(forward)) {
|
||||
// if we're here then we found a good one
|
||||
SwitchToApp(startIndex, fCurrentIndex, forward);
|
||||
|
||||
if (!activateNow)
|
||||
return;
|
||||
|
||||
ActivateApp(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TSwitchManager::_FindNextValidApp(bool forward)
|
||||
{
|
||||
int32 startIndex = fCurrentIndex;
|
||||
int32 max = fGroupList.CountItems();
|
||||
@ -873,23 +890,15 @@ TSwitchManager::CycleApp(bool forward, bool activateNow)
|
||||
if (fCurrentIndex == startIndex) {
|
||||
// we've gone completely through the list without finding
|
||||
// a good app. Oh well.
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!OKToUse((TTeamGroup*)fGroupList.ItemAt(fCurrentIndex)))
|
||||
continue;
|
||||
|
||||
// if we're here then we found a good one
|
||||
SwitchToApp(startIndex, fCurrentIndex, forward);
|
||||
|
||||
if (!activateNow)
|
||||
break;
|
||||
|
||||
if (ActivateApp(false, false))
|
||||
break;
|
||||
if (OKToUse((TTeamGroup*)fGroupList.ItemAt(fCurrentIndex)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
TSwitchManager::SwitchToApp(int32 previousIndex, int32 newIndex, bool forward)
|
||||
@ -897,6 +906,9 @@ TSwitchManager::SwitchToApp(int32 previousIndex, int32 newIndex, bool forward)
|
||||
int32 previousSlot = fCurrentSlot;
|
||||
|
||||
fCurrentIndex = newIndex;
|
||||
if (!OKToUse((TTeamGroup *)fGroupList.ItemAt(fCurrentIndex)))
|
||||
_FindNextValidApp(forward);
|
||||
|
||||
fCurrentSlot = fWindow->SlotOf(fCurrentIndex);
|
||||
fCurrentWindow = 0;
|
||||
|
||||
|
@ -86,6 +86,8 @@ private:
|
||||
void ActivateWindow(int32 windowID = -1);
|
||||
void _SortApps();
|
||||
|
||||
bool _FindNextValidApp(bool forward);
|
||||
|
||||
TSwitcherWindow* fWindow;
|
||||
sem_id fMainMonitor;
|
||||
bool fBlock;
|
||||
|
Loading…
Reference in New Issue
Block a user