From 1bbf044eebe02b8cd8560d3a2bcfc3e3fb6b8028 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 26 Oct 2008 04:50:50 +0000 Subject: [PATCH] In various apps such as ActivityMonitor, BDraggers are instantiated with invalid rects (in ActivityView's case in particular, (-7, -7, 0, 0)). BDragger would happily accept these, and preserve them when being archived/unarchived, which led to its position being completely messed up in the target shelf. We now compensate for this when determining our relationship with the target view. This fixes the problems with missing replicant handles in BSnow, ActivityMonitor and probably others replicants. The solution used here might not be ideal though, so comments welcome. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28330 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Dragger.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kits/interface/Dragger.cpp b/src/kits/interface/Dragger.cpp index 197ee02ae6..d1908b6dc4 100644 --- a/src/kits/interface/Dragger.cpp +++ b/src/kits/interface/Dragger.cpp @@ -593,6 +593,13 @@ BDragger::_DetermineRelationship() return B_ERROR; } + if (fRelation == TARGET_IS_PARENT) { + BRect bounds (Frame()); + if (bounds.left < 0 || bounds.top < 0) + MoveTo(Parent()->Bounds().right - bounds.Width(), + Parent()->Bounds().bottom - bounds.Height()); + } + return B_OK; }