Author: phoudoin Date: 2010-12-02 19:12:18 +0100 (Thu, 02 Dec 2010) New Revision: 39705 Changeset: http://dev.haiku-os.org/changeset/39705 Modified: haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp Log: Added some resizable checks that were missing. Now, borders that can be resize are not highlight anymore, and it's no more possible to resize a non-resizable (vertical/horizontal/all directions) window with the third button + CMD + ALT. Modified: haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp =================================================================== --- haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp 2010-12-02 16:09:12 UTC (rev 39704) +++ haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp 2010-12-02 18:12:18 UTC (rev 39705) @@ -432,6 +432,15 @@ virtual void EnterState(State* previousState) { + if ((fWindow->Flags() & B_NOT_RESIZABLE) != 0) + fHorizontal = fVertical = NONE; + else { + if ((fWindow->Flags() & B_NOT_H_RESIZABLE) != 0) + fHorizontal = NONE; + + if ((fWindow->Flags() & B_NOT_V_RESIZABLE) != 0) + fVertical = NONE; + } fBehavior._SetResizeCursor(fHorizontal, fVertical); } @@ -442,14 +451,9 @@ virtual void MouseMovedAction(BPoint& delta, bigtime_t now) { - if ((fWindow->Flags() & B_NOT_RESIZABLE) != 0) { - delta = BPoint(0, 0); - return; - } - - if ((fWindow->Flags() & B_NOT_H_RESIZABLE) != 0 || fHorizontal == NONE) + if (fHorizontal == NONE) delta.x = 0; - if ((fWindow->Flags() & B_NOT_V_RESIZABLE) != 0 || fVertical == NONE) + if (fVertical == NONE) delta.y = 0; if (delta.x == 0 && delta.y == 0) @@ -656,6 +660,9 @@ private: void _UpdateBorders(BPoint where) { + if ((fWindow->Flags() & B_NOT_RESIZABLE) != 0) + return; + // Compute the window center relative location of where. We divide by // the width respective the height, so we compensate for the window's // aspect ratio. @@ -673,6 +680,11 @@ int8 vertical; _ComputeResizeDirection(x, y, horizontal, vertical); + if ((fWindow->Flags() & B_NOT_H_RESIZABLE) != 0) + horizontal = NONE; + if ((fWindow->Flags() & B_NOT_V_RESIZABLE) != 0) + vertical = NONE; + // update the highlight, if necessary if (horizontal != fHorizontal || vertical != fVertical) { fBehavior._SetBorderHighlights(fHorizontal, fVertical, false); @@ -892,8 +904,10 @@ } else if ((buttons & B_TERTIARY_MOUSE_BUTTON) != 0) { // Middle-click anywhere on the window shall initiate // humdinger-resize mode. - if (windowModifier && hitRegion != Decorator::REGION_NONE) - action = ACTION_HUMDINGER_RESIZE; + if (windowModifier && hitRegion != Decorator::REGION_NONE) { + action = (flags & B_NOT_RESIZABLE) == 0 + ? ACTION_HUMDINGER_RESIZE : ACTION_DRAG; + } } }