Author: axeld Date: 2010-01-23 13:27:17 +0100 (Sat, 23 Jan 2010) New Revision: 35258 Changeset: http://dev.haiku-os.org/changeset/35258/haiku Modified: haiku/trunk/src/servers/app/DefaultDecorator.cpp haiku/trunk/src/servers/app/Window.cpp Log: * 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. Modified: haiku/trunk/src/servers/app/DefaultDecorator.cpp =================================================================== --- haiku/trunk/src/servers/app/DefaultDecorator.cpp 2010-01-23 12:27:11 UTC (rev 35257) +++ haiku/trunk/src/servers/app/DefaultDecorator.cpp 2010-01-23 12:27:17 UTC (rev 35258) @@ -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, stpere@xxxxxxxxx */ + /*! Default and fallback decorator for the app_server - the yellow tabs */ @@ -541,19 +542,19 @@ 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 @@ 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; } Modified: haiku/trunk/src/servers/app/Window.cpp =================================================================== --- haiku/trunk/src/servers/app/Window.cpp 2010-01-23 12:27:11 UTC (rev 35257) +++ haiku/trunk/src/servers/app/Window.cpp 2010-01-23 12:27:17 UTC (rev 35258) @@ -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 @@ 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();