* Right clicking the resize area now always moves the window behind. This

obviously differentiates from BeOS behaviour, but I think it makes much more
  sense this way.
* Simplified DefaultDecorator::Clicked() by eliminating the "clicked" variable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35258 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-01-23 12:27:17 +00:00
parent 10ddee8d8e
commit ba1d39e48f
2 changed files with 15 additions and 24 deletions
+13 -22
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2008, Haiku.
* Copyright 2001-2010, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -8,6 +8,7 @@
* Philippe Saint-Pierre, [email protected]
*/
/*! Default and fallback decorator for the app_server - the yellow tabs */
@@ -541,19 +542,19 @@ DefaultDecorator::Clicked(BPoint point, int32 buttons, int32 modifiers)
if (!(fFlags & B_NOT_ZOOMABLE) && fZoomRect.Contains(point))
return DEC_ZOOM;
if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0)
return DEC_MOVETOBACK;
if (fLook == B_DOCUMENT_WINDOW_LOOK && fResizeRect.Contains(point))
return DEC_RESIZE;
bool clicked = false;
// Clicking in the tab?
if (fTabRect.Contains(point)) {
// Clicked in the tab
// tab sliding in any case if either shift key is held down
// except sliding up-down by moving mouse left-right would look strange
if ((modifiers & B_SHIFT_KEY) && (fLook != kLeftTitledWindowLook))
return DEC_SLIDETAB;
clicked = true;
} else if (fLeftBorder.Contains(point) || fRightBorder.Contains(point)
|| fTopBorder.Contains(point) || fBottomBorder.Contains(point)) {
// Clicked on border
@@ -569,25 +570,15 @@ DefaultDecorator::Clicked(BPoint point, int32 buttons, int32 modifiers)
if (temp.Contains(point))
return DEC_RESIZE;
}
clicked = true;
} else {
// Guess user didn't click anything
return DEC_NONE;
}
if (clicked) {
// NOTE: On R5, windows are not moved to back if clicked inside the
// resize area with the second mouse button. So we check this after
// the check above
if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0)
return DEC_MOVETOBACK;
if (fWasDoubleClick && !(fFlags & B_NOT_MINIMIZABLE))
return DEC_MINIMIZE;
if (fWasDoubleClick && !(fFlags & B_NOT_MINIMIZABLE))
return DEC_MINIMIZE;
return DEC_DRAG;
}
// Guess user didn't click anything
return DEC_NONE;
return DEC_DRAG;
}
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku, Inc.
* Copyright 2001-2010, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@@ -899,7 +899,7 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
else {
fDesktop->SetFocusWindow(this);
if (desktopSettings.MouseMode() == B_FOCUS_FOLLOWS_MOUSE
&& action == DEC_DRAG) {
&& (action == DEC_DRAG || action == DEC_RESIZE)) {
fActivateOnMouseUp = true;
fMouseMoveDistance = 0.0f;
fLastMoveTime = system_time();