Author: anevilyak Date: 2010-10-19 22:01:13 +0200 (Tue, 19 Oct 2010) New Revision: 39012 Changeset: http://dev.haiku-os.org/changeset/39012 Ticket: http://dev.haiku-os.org/ticket/5218 Modified: haiku/trunk/src/kits/tracker/PoseView.cpp Log: When trying to auto-place a pose, we need to short circuit if we're the Desktop and the next available slot lies outside of the view bounds. Otherwise we loop forever. Resolves ticket #5218. Modified: haiku/trunk/src/kits/tracker/PoseView.cpp =================================================================== --- haiku/trunk/src/kits/tracker/PoseView.cpp 2010-10-19 15:10:01 UTC (rev 39011) +++ haiku/trunk/src/kits/tracker/PoseView.cpp 2010-10-19 20:01:13 UTC (rev 39012) @@ -3358,6 +3358,14 @@ // check good location on the desktop || (checkValidLocation && !IsValidLocation(rect))) { NextSlot(pose, rect, viewBounds); + // we've scanned the entire desktop without finding an available position, + // give up and simply place it towards the top left. + if (checkValidLocation && !rect.Intersects(viewBounds)) { + fHintLocation = PinToGrid(BPoint(0.0, 0.0), fGrid, fOffset); + pose->SetLocation(fHintLocation, this); + rect = pose->CalcRect(this); + break; + } } rect.InsetBy(3, 0);