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)
|
if ((teamGroup->Flags() & B_BACKGROUND_APP) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// skip the Deakbar itself
|
// skip the Deskbar itself
|
||||||
if (strcasecmp(teamGroup->Signature(), kDeskbarSignature) == 0)
|
if (strcasecmp(teamGroup->Signature(), kDeskbarSignature) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -856,6 +856,23 @@ TSwitchManager::CycleWindow(bool forward, bool wrap)
|
|||||||
|
|
||||||
void
|
void
|
||||||
TSwitchManager::CycleApp(bool forward, bool activateNow)
|
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 startIndex = fCurrentIndex;
|
||||||
int32 max = fGroupList.CountItems();
|
int32 max = fGroupList.CountItems();
|
||||||
@ -873,30 +890,25 @@ TSwitchManager::CycleApp(bool forward, bool activateNow)
|
|||||||
if (fCurrentIndex == startIndex) {
|
if (fCurrentIndex == startIndex) {
|
||||||
// we've gone completely through the list without finding
|
// we've gone completely through the list without finding
|
||||||
// a good app. Oh well.
|
// a good app. Oh well.
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OKToUse((TTeamGroup*)fGroupList.ItemAt(fCurrentIndex)))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TSwitchManager::SwitchToApp(int32 previousIndex, int32 newIndex, bool forward)
|
TSwitchManager::SwitchToApp(int32 previousIndex, int32 newIndex, bool forward)
|
||||||
{
|
{
|
||||||
int32 previousSlot = fCurrentSlot;
|
int32 previousSlot = fCurrentSlot;
|
||||||
|
|
||||||
fCurrentIndex = newIndex;
|
fCurrentIndex = newIndex;
|
||||||
|
if (!OKToUse((TTeamGroup *)fGroupList.ItemAt(fCurrentIndex)))
|
||||||
|
_FindNextValidApp(forward);
|
||||||
|
|
||||||
fCurrentSlot = fWindow->SlotOf(fCurrentIndex);
|
fCurrentSlot = fWindow->SlotOf(fCurrentIndex);
|
||||||
fCurrentWindow = 0;
|
fCurrentWindow = 0;
|
||||||
|
|
||||||
|
@ -86,6 +86,8 @@ private:
|
|||||||
void ActivateWindow(int32 windowID = -1);
|
void ActivateWindow(int32 windowID = -1);
|
||||||
void _SortApps();
|
void _SortApps();
|
||||||
|
|
||||||
|
bool _FindNextValidApp(bool forward);
|
||||||
|
|
||||||
TSwitcherWindow* fWindow;
|
TSwitcherWindow* fWindow;
|
||||||
sem_id fMainMonitor;
|
sem_id fMainMonitor;
|
||||||
bool fBlock;
|
bool fBlock;
|
||||||
|
Loading…
Reference in New Issue
Block a user