Fix #8768.
- 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:
@@ -772,16 +772,31 @@ thread_popup(void *arg)
|
|||||||
|
|
||||||
addtopbottom(new BSeparatorItem());
|
addtopbottom(new BSeparatorItem());
|
||||||
|
|
||||||
if (be_roster->IsRunning(kDeskbarSig)) {
|
int32 cookie = 0;
|
||||||
item = new BMenuItem(B_TRANSLATE("Live in the Deskbar"),
|
image_info info;
|
||||||
new BMessage('AlDb'));
|
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
|
||||||
BDeskbar deskbar;
|
if (info.type == B_APP_IMAGE) {
|
||||||
item->SetMarked(gInDeskbar || deskbar.HasItem(kDeskbarItemName));
|
// only show the Live in Deskbar item if a) we're running in
|
||||||
item->SetTarget(gPCView);
|
// deskbar itself, or b) we're running in PC's team.
|
||||||
addtopbottom(item);
|
if (strstr(info.name, "Deskbar") == NULL
|
||||||
addtopbottom(new BSeparatorItem ());
|
&& 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->SetTarget(gPCView);
|
||||||
|
addtopbottom(item);
|
||||||
|
addtopbottom(new BSeparatorItem ());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
item = new IconMenuItem(gPCView->fProcessControllerIcon,
|
item = new IconMenuItem(gPCView->fProcessControllerIcon,
|
||||||
B_TRANSLATE("About ProcessController"B_UTF8_ELLIPSIS),
|
B_TRANSLATE("About ProcessController"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(B_ABOUT_REQUESTED));
|
new BMessage(B_ABOUT_REQUESTED));
|
||||||
|
|||||||
Reference in New Issue
Block a user