* 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
This commit is contained in:
Alexandre Deckner 2011-06-05 13:42:27 +00:00
parent 2530274ddc
commit 6009abf2bd
2 changed files with 11 additions and 1 deletions

View File

@ -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;
}

View File

@ -690,6 +690,7 @@ class BPoseView : public BView {
const BPose *fSelectionPivotPose;
const BPose *fRealPivotPose;
BMessageRunner *fKeyRunner;
bool fTrackRightMouseUp;
struct SelectionRectInfo {
SelectionRectInfo()