diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp index 7f5cc9d94c..a1731bbaa3 100644 --- a/src/servers/app/Window.cpp +++ b/src/servers/app/Window.cpp @@ -772,9 +772,14 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken) // clicking Window visible area click_type action = DEC_DRAG; + int32 buttons = _ExtractButtons(message); if (inBorderRegion && fDecorator != NULL) - action = _ActionFor(message, modifiers); + action = _ActionFor(message, buttons, modifiers); + else { + if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0) + action = DEC_MOVETOBACK; + } // ignore clicks on decorator buttons if the // non-floating window doesn't have focus @@ -2066,6 +2071,16 @@ Window::_UpdateContentRegion() } +int32 +Window::_ExtractButtons(const BMessage* message) const +{ + int32 buttons; + if (message->FindInt32("buttons", &buttons) != B_OK) + buttons = 0; + return buttons; +} + + int32 Window::_ExtractModifiers(const BMessage* message) const { @@ -2082,13 +2097,15 @@ Window::_ActionFor(const BMessage* message) const if (fDecorator == NULL) return DEC_NONE; + int32 buttons = _ExtractButtons(message); int32 modifiers = _ExtractModifiers(message); - return _ActionFor(message, modifiers); + return _ActionFor(message, buttons, modifiers); } click_type -Window::_ActionFor(const BMessage* message, int32 modifiers) const +Window::_ActionFor(const BMessage* message, int32 buttons, + int32 modifiers) const { if (fDecorator == NULL) return DEC_NONE; @@ -2097,10 +2114,6 @@ Window::_ActionFor(const BMessage* message, int32 modifiers) const if (message->FindPoint("where", &where) != B_OK) return DEC_NONE; - int32 buttons; - if (message->FindInt32("buttons", &buttons) != B_OK) - buttons = 0; - return fDecorator->Clicked(where, buttons, modifiers); } diff --git a/src/servers/app/Window.h b/src/servers/app/Window.h index d36e8b11a1..0571cdbf83 100644 --- a/src/servers/app/Window.h +++ b/src/servers/app/Window.h @@ -256,11 +256,13 @@ protected: void _UpdateContentRegion(); + int32 _ExtractButtons( + const BMessage* message) const; int32 _ExtractModifiers( const BMessage* message) const; click_type _ActionFor(const BMessage* message) const; click_type _ActionFor(const BMessage* message, - int32 modifiers) const; + int32 buttons, int32 modifiers) const; void _ObeySizeLimits(); void _PropagatePosition();