aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRene Gollent <anevilyak@gmail.com>2012-07-24 19:09:53 -0400
committerRene Gollent <anevilyak@gmail.com>2012-07-24 19:09:53 -0400
commit003dedca933ed3bd3afc8f9bc7f27dba679a61f3 (patch)
treec3d0a17683a3259cb689a723269aeb82ce8fc5ca
parente2c343a22a731d4ec7f6ede64adb36dbf275021e (diff)
- 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).
-rw-r--r--src/apps/processcontroller/ProcessController.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp
index 1a5d5d20cc..48f77976a2 100644
--- a/src/apps/processcontroller/ProcessController.cpp
+++ b/src/apps/processcontroller/ProcessController.cpp
@@ -772,16 +772,31 @@ thread_popup(void *arg)
addtopbottom(new BSeparatorItem());
- 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 ());
+ 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->SetTarget(gPCView);
+ addtopbottom(item);
+ addtopbottom(new BSeparatorItem ());
+ }
+ }
}
+
item = new IconMenuItem(gPCView->fProcessControllerIcon,
B_TRANSLATE("About ProcessController"B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED));