- When invoking ProcessController's menu, we now only show the "Live in Deskbar"
  menu item if we're either running within Deskbar itself or from PC's standalone
  window. This allows replicant PC instances to be usable in the case where
  Deskbar is deadlocked for whatever reason (previously it would hang while trying
  to query for the deskbar item's presence/status).
This commit is contained in:
Rene Gollent 2012-07-24 19:09:53 -04:00
parent e2c343a22a
commit 003dedca93
1 changed files with 23 additions and 8 deletions

View File

@ -772,15 +772,30 @@ thread_popup(void *arg)
addtopbottom(new BSeparatorItem());
int32 cookie = 0;
image_info info;
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
if (info.type == B_APP_IMAGE) {
// only show the Live in Deskbar item if a) we're running in
// deskbar itself, or b) we're running in PC's team.
if (strstr(info.name, "Deskbar") == NULL
&& strstr(info.name, "ProcessController") == NULL) {
break;
}
if (be_roster->IsRunning(kDeskbarSig)) {
item = new BMenuItem(B_TRANSLATE("Live in the Deskbar"),
new BMessage('AlDb'));
BDeskbar deskbar;
item->SetMarked(gInDeskbar || deskbar.HasItem(kDeskbarItemName));
item->SetMarked(gInDeskbar
|| deskbar.HasItem(kDeskbarItemName));
item->SetTarget(gPCView);
addtopbottom(item);
addtopbottom(new BSeparatorItem ());
}
}
}
item = new IconMenuItem(gPCView->fProcessControllerIcon,
B_TRANSLATE("About ProcessController"B_UTF8_ELLIPSIS),