From 1959f8502b64d2fe7533d907fc6a0efdd3bd147f Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 19 Oct 2010 20:01:13 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39012 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/PoseView.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 6dfaa85fcd..059175409b 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -3358,6 +3358,14 @@ BPoseView::PlacePose(BPose *pose, BRect &viewBounds) // 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);