Author: aldeck Date: 2011-06-05 15:42:27 +0200 (Sun, 05 Jun 2011) New Revision: 41934 Changeset: https://dev.haiku-os.org/changeset/41934 Modified: haiku/trunk/src/kits/tracker/PoseView.cpp haiku/trunk/src/kits/tracker/PoseView.h Log: * One more fix needed for right click dragging. Ignore right mouse up if a drag or long click happened between the initial mouse down and the present mouse up. Tried to avoid this solution by other means but wasn't working in a corner case, at least it's clear what's the code is doing. Modified: haiku/trunk/src/kits/tracker/PoseView.cpp =================================================================== --- haiku/trunk/src/kits/tracker/PoseView.cpp 2011-06-05 06:09:55 UTC (rev 41933) +++ haiku/trunk/src/kits/tracker/PoseView.cpp 2011-06-05 13:42:27 UTC (rev 41934) @@ -221,6 +221,7 @@ fSelectionPivotPose(NULL), fRealPivotPose(NULL), fKeyRunner(NULL), + fTrackRightMouseUp(false), fSelectionVisible(true), fMultipleSelection(true), fDragEnabled(true), @@ -6744,6 +6745,8 @@ void BPoseView::MouseDragged(const BMessage *message) { + fTrackRightMouseUp = false; + BPoint where; uint32 buttons = 0; if (message->FindPoint("be:view_where", &where) != B_OK @@ -6764,6 +6767,8 @@ void BPoseView::MouseLongDown(const BMessage *message) { + fTrackRightMouseUp = false; + BPoint where; if (message->FindPoint("where", &where) != B_OK) return; @@ -6813,6 +6818,9 @@ uint32 buttons = (uint32)window->CurrentMessage()->FindInt32("buttons"); uint32 modifs = modifiers(); + if (buttons == B_SECONDARY_MOUSE_BUTTON) + fTrackRightMouseUp = true; + bool extendSelection = (modifs & B_COMMAND_KEY) && fMultipleSelection; CommitActivePose(); @@ -6869,7 +6877,7 @@ // Showing the pose context menu is done on mouse up (or long click) // to make right button dragging possible - if (pose != NULL && pose == fLastClickedPose + if (pose != NULL && fTrackRightMouseUp && (lastButtons == B_SECONDARY_MOUSE_BUTTON || (modifiers() & B_CONTROL_KEY) != 0)) { if (!pose->IsSelected()) { @@ -6880,6 +6888,7 @@ } ShowContextMenu(where); } + fTrackRightMouseUp = false; } Modified: haiku/trunk/src/kits/tracker/PoseView.h =================================================================== --- haiku/trunk/src/kits/tracker/PoseView.h 2011-06-05 06:09:55 UTC (rev 41933) +++ haiku/trunk/src/kits/tracker/PoseView.h 2011-06-05 13:42:27 UTC (rev 41934) @@ -690,6 +690,7 @@ const BPose *fSelectionPivotPose; const BPose *fRealPivotPose; BMessageRunner *fKeyRunner; + bool fTrackRightMouseUp; struct SelectionRectInfo { SelectionRectInfo()