From 923d64efa187b1cd8e520e376b2962a919985fdc Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Sun, 25 Nov 2012 20:25:21 -0500 Subject: [PATCH] Tracker: Prevent TextWidget to start editing twice It was possible to confuse TextWidget to start editing twice (clicking on the widget and during the wait, pressing F2) and confusing the states of the TextWidget. --- src/kits/tracker/TextWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 48abc92520..1713031a3a 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -234,7 +234,6 @@ BTextWidget::CheckExpiration() // at least 'doubleClickSpeed' microseconds ellapsed and no click // was registered since. fLastClickedTime = 0; - fParams.poseView->SetTextWidgetToCheck(NULL); StartEdit(fParams.bounds, fParams.poseView, fParams.pose); } } else { @@ -335,7 +334,8 @@ TextViewFilter(BMessage* message, BHandler**, BMessageFilter* filter) void BTextWidget::StartEdit(BRect bounds, BPoseView* view, BPose* pose) { - if (!IsEditable()) + view->SetTextWidgetToCheck(NULL, this); + if (!IsEditable() || IsActive()) return; BEntry entry(pose->TargetModel()->EntryRef());