status_t TBarMenuTitle::Invoke(BMessage* message) { TBarView* barview = dynamic_cast<TBarApp*>(be_app)->BarView(); if (barview) { BLooper* looper = barview->Looper(); if (looper->Lock()) { // tell barview to add the refs to the deskbar menu barview->HandleDeskbarMenu(NULL); looper->Unlock(); } } return BMenuItem::Invoke(message); }
void TTeamMenu::DetachedFromWindow() { TBarView* barView = (dynamic_cast<TBarApp*>(be_app))->BarView(); if (barView != NULL) { BLooper* looper = barView->Looper(); if (looper != NULL && looper->Lock()) { barView->DragStop(); looper->Unlock(); } } BMenu::DetachedFromWindow(); BMessenger self(this); TBarApp::Unsubscribe(self); }
void TWindowMenu::DetachedFromWindow() { // in expando mode the teammenu will not call DragStop, // thus, it needs to be called from here TBarView *barview = (dynamic_cast<TBarApp*>(be_app))->BarView(); if (barview && barview->Expando()) { BLooper *looper = barview->Looper(); if (looper->Lock()) { Window()->Show(); // We changed the show level in AttachedToWindow(). Undo it. barview->DragStop(); looper->Unlock(); } } BMenu::DetachedFromWindow(); }