From c27ffb3a231c2bf8a7645664e67723d32bd626e1 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 30 Apr 2009 19:56:54 +0000 Subject: [PATCH] Fixed a bug reported by kirilla: * the textview now only initiates a drag after the mouse has been moved to another offset, making it possible to click into the selection in order to position the caret at the offset corresponding to the point of the click (just as R5 does it) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30518 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/TextView.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 5816215438..ba1b02ff40 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -4459,15 +4459,19 @@ BTextView::_PerformMouseMoved(BPoint where, uint32 code) if (fTrackingMouse == NULL) return false; + int32 currentOffset = OffsetAt(where); if (fTrackingMouse->selectionRect.IsValid() && fTrackingMouse->selectionRect.Contains(where)) { - _StopMouseTracking(); - _InitiateDrag(); - return true; + // we are tracking the mouse for drag action, if the mouse has moved + // from where it was clicked, we initiate a drag now: + if (currentOffset != fTrackingMouse->clickOffset) { + _StopMouseTracking(); + _InitiateDrag(); + return true; + } + return false; } - int32 currentOffset = OffsetAt(where); - switch (fClickCount) { case 3: // triple click, extend selection linewise