hrev44555 adds 1 changeset to branch 'master' old head: efb103934877a4004ceea2c86baba4c29d16668d new head: ed63a5d20c7c4be88812d683bb3d563905297003 ---------------------------------------------------------------------------- ed63a5d: Tracker: Double-Click simplification Double-click check was redoing what is essentially already done in input_server. The way we were doing it, right clicking (or pressing a different button for the second click, for that matter) wasn't clearing the fields remembered and thus not breaking the sequence. So a third click returning to the correct sequence (in a short time) would get recognized as a valid second click. So a quick left-right-left would be seen by that method as left-left. Also, clean up a previous fix I committed. Removed the introduced Origin() method as it is the LeftTop() method I was interested in and it is already existing. Fix #8714 [ Philippe Saint-Pierre <stpere@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev44555 Commit: ed63a5d20c7c4be88812d683bb3d563905297003 URL: http://cgit.haiku-os.org/haiku/commit/?id=ed63a5d Author: Philippe Saint-Pierre <stpere@xxxxxxxxx> Date: Sun Aug 19 02:13:09 2012 UTC Ticket: https://dev.haiku-os.org/ticket/8714 ---------------------------------------------------------------------------- 3 files changed, 4 insertions(+), 26 deletions(-) src/kits/tracker/PoseView.cpp | 26 +++----------------------- src/kits/tracker/PoseView.h | 2 -- src/kits/tracker/TextWidget.cpp | 2 +- ---------------------------------------------------------------------------- diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 54e8047..ec2f087 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -230,7 +230,6 @@ BPoseView::BPoseView(Model* model, BRect bounds, uint32 viewMode, fAlreadySelectedDropTarget(NULL), fSelectionHandler(be_app), fLastClickPt(LONG_MAX, LONG_MAX), - fLastClickTime(0), fLastClickedPose(NULL), fLastExtent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN), fTitleView(NULL), @@ -7149,16 +7148,6 @@ BPoseView::SetTextWidgetToCheck(BTextWidget* widget, BTextWidget* old) } -BPoint -BPoseView::Origin() -{ - if (ViewMode() == kListMode) - return fViewState->ListOrigin(); - - return fViewState->IconOrigin(); -} - - void BPoseView::MouseUp(BPoint where) { @@ -7230,24 +7219,16 @@ BPoseView::WasClickInPath(const BPose* pose, int32 index, BPoint mouseLoc) const bool BPoseView::WasDoubleClick(const BPose* pose, BPoint point) { - // check time and proximity + // check proximity BPoint delta = point - fLastClickPt; + int32 clicks = Window()->CurrentMessage()->FindInt32("clicks"); - bigtime_t sysTime; - Window()->CurrentMessage()->FindInt64("when", &sysTime); - - bigtime_t timeDelta = sysTime - fLastClickTime; - - bigtime_t doubleClickSpeed; - get_click_speed(&doubleClickSpeed); - - if (timeDelta < doubleClickSpeed + if (clicks == 2 && fabs(delta.x) < kDoubleClickTresh && fabs(delta.y) < kDoubleClickTresh && pose == fLastClickedPose) { fLastClickPt.Set(LONG_MAX, LONG_MAX); fLastClickedPose = NULL; - fLastClickTime = 0; if (fTextWidgetToCheck != NULL) fTextWidgetToCheck->CancelWait(); return true; @@ -7255,7 +7236,6 @@ BPoseView::WasDoubleClick(const BPose* pose, BPoint point) fLastClickPt = point; fLastClickedPose = pose; - fLastClickTime = sysTime; return false; } diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h index c17cce2..efdda4d 100644 --- a/src/kits/tracker/PoseView.h +++ b/src/kits/tracker/PoseView.h @@ -426,7 +426,6 @@ class BPoseView : public BView { virtual void AdaptToDesktopIntegrationChange(BMessage*); void SetTextWidgetToCheck(BTextWidget*, BTextWidget* = NULL); - BPoint Origin(); protected: // view setup @@ -714,7 +713,6 @@ class BPoseView : public BView { BPose* fAlreadySelectedDropTarget; BLooper* fSelectionHandler; BPoint fLastClickPt; - bigtime_t fLastClickTime; const BPose* fLastClickedPose; BPoint fLastLeftTop; BRect fLastExtent; diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 62d252b..48abc92 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -381,7 +381,7 @@ BTextWidget::StartEdit(BRect bounds, BPoseView* view, BPose* pose) textRect.bottom--; textView->SetTextRect(textRect); - BPoint origin = view->Origin(); + BPoint origin = view->LeftTop(); textRect = view->Bounds(); bool hitBorder = false;