From 6009abf2bd94f12ff244e81cf0da48a02b0cf384 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Sun, 5 Jun 2011 13:42:27 +0000 Subject: [PATCH] * 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41934 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/PoseView.cpp | 11 ++++++++++- src/kits/tracker/PoseView.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 44f9d0697f..272203ed83 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -221,6 +221,7 @@ BPoseView::BPoseView(Model *model, BRect bounds, uint32 viewMode, uint32 resizeM fSelectionPivotPose(NULL), fRealPivotPose(NULL), fKeyRunner(NULL), + fTrackRightMouseUp(false), fSelectionVisible(true), fMultipleSelection(true), fDragEnabled(true), @@ -6744,6 +6745,8 @@ BPoseView::MouseMoved(BPoint mouseLoc, uint32 moveCode, const BMessage *message) 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 @@ BPoseView::MouseDragged(const BMessage *message) void BPoseView::MouseLongDown(const BMessage *message) { + fTrackRightMouseUp = false; + BPoint where; if (message->FindPoint("where", &where) != B_OK) return; @@ -6813,6 +6818,9 @@ BPoseView::MouseDown(BPoint where) 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 @@ BPoseView::MouseUp(BPoint where) // 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 @@ BPoseView::MouseUp(BPoint where) } ShowContextMenu(where); } + fTrackRightMouseUp = false; } diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h index 543bf0267f..e41454a659 100644 --- a/src/kits/tracker/PoseView.h +++ b/src/kits/tracker/PoseView.h @@ -690,6 +690,7 @@ class BPoseView : public BView { const BPose *fSelectionPivotPose; const BPose *fRealPivotPose; BMessageRunner *fKeyRunner; + bool fTrackRightMouseUp; struct SelectionRectInfo { SelectionRectInfo()