diff --git a/src/apps/deskbar/BarView.h b/src/apps/deskbar/BarView.h index fe2d61f287..a4814454d2 100644 --- a/src/apps/deskbar/BarView.h +++ b/src/apps/deskbar/BarView.h @@ -118,7 +118,7 @@ class TBarView : public BView { int32 CountItems(DeskbarShelf shelf); - status_t AddItem(BMessage* , DeskbarShelf shelf, int32* id); + status_t AddItem(BMessage* archive, DeskbarShelf shelf, int32* id); void RemoveItem(int32 id); void RemoveItem(const char* name, DeskbarShelf shelf); @@ -134,10 +134,12 @@ class TBarView : public BView { TExpandoMenuBar* ExpandoMenuBar() const; TBarMenuBar* BarMenuBar() const; + TDragRegion* DragRegion() const { return fDragRegion; } + + private: friend class TBeMenu; friend class PreferencesWindow; - private: status_t SendDragMessage(const char* signature, entry_ref* ref = NULL); void PlaceBeMenu(); diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp index f5d88d9bd8..246df37dd8 100644 --- a/src/apps/deskbar/BarWindow.cpp +++ b/src/apps/deskbar/BarWindow.cpp @@ -101,9 +101,18 @@ TBarWindow::DispatchMessage(BMessage* message, BHandler* handler) { // Activate the window when you click on it (ie. on the tray area, // the menu part will do this automatically) - if (message->what == B_MOUSE_DOWN - && !((TBarApp*)be_app)->Settings()->autoRaise) - Activate(true); + if (message->what == B_MOUSE_DOWN) { + if (!((TBarApp*)be_app)->Settings()->autoRaise) + Activate(true); + + if ((modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY)) + == B_CONTROL_KEY | B_COMMAND_KEY) { + // The window key was pressed - enter dragging code + fBarView->DragRegion()->MouseDown( + fBarView->DragRegion()->DragRegion().LeftTop()); + return; + } + } BWindow::DispatchMessage(message, handler); } diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp index 60353c1929..d97cd7d384 100644 --- a/src/apps/deskbar/StatusView.cpp +++ b/src/apps/deskbar/StatusView.cpp @@ -1419,16 +1419,16 @@ TReplicantTray::SetMultiRow(bool state) // #pragma mark - -/** draggable region that is asynchronous so that - * dragging does not block other activities - */ - +/*! Draggable region that is asynchronous so that dragging does not block + other activities. +*/ TDragRegion::TDragRegion(TBarView* parent, BView* child) - : BControl(BRect(0, 0, 0, 0), "", "", NULL, B_FOLLOW_NONE, - B_WILL_DRAW | B_FRAME_EVENTS), - fBarView(parent), - fChild(child), - fDragLocation(kAutoPlaceDragRegion) + : + BControl(BRect(0, 0, 0, 0), "", "", NULL, B_FOLLOW_NONE, + B_WILL_DRAW | B_FRAME_EVENTS), + fBarView(parent), + fChild(child), + fDragLocation(kAutoPlaceDragRegion) { } @@ -1464,8 +1464,8 @@ TDragRegion::GetPreferredSize(float* width, float* height) void TDragRegion::FrameMoved(BPoint) { - if (fBarView->Left() && fBarView->Vertical() && fDragLocation - != kNoDragRegion) + if (fBarView->Left() && fBarView->Vertical() + && fDragLocation != kNoDragRegion) fChild->MoveTo(5, 2); else fChild->MoveTo(2, 2);