* Lock the popup menu window when archiving, fixes #1775
* Made the drag detection less sensitive as most simple clicks would initiate an unwanted drag. * Don't show the dragger's popup from its original parent window (not a shelf) for all buttons, as in R5. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29727 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -118,9 +118,12 @@ BDragger::Archive(BMessage *data, bool deep) const
|
|||||||
BMessage popupMsg;
|
BMessage popupMsg;
|
||||||
|
|
||||||
if (fPopUp) {
|
if (fPopUp) {
|
||||||
ret = fPopUp->Archive(&popupMsg, deep);
|
if (fPopUp->Window()->Lock()) {
|
||||||
if (ret == B_OK)
|
ret = fPopUp->Archive(&popupMsg, deep);
|
||||||
ret = data->AddMessage("_popup", &popupMsg);
|
if (ret == B_OK)
|
||||||
|
ret = data->AddMessage("_popup", &popupMsg);
|
||||||
|
fPopUp->Window()->Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == B_OK)
|
if (ret == B_OK)
|
||||||
@@ -194,10 +197,8 @@ BDragger::MouseDown(BPoint where)
|
|||||||
Window()->CurrentMessage()->FindInt32("buttons", (int32 *)&buttons);
|
Window()->CurrentMessage()->FindInt32("buttons", (int32 *)&buttons);
|
||||||
|
|
||||||
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
|
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
|
||||||
if (!fShelf || !fTarget) {
|
if (!fShelf)
|
||||||
beep();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
_ShowPopUp(fTarget, where);
|
_ShowPopUp(fTarget, where);
|
||||||
} else {
|
} else {
|
||||||
@@ -215,7 +216,11 @@ BDragger::MouseDown(BPoint where)
|
|||||||
if (!buttons || system_time() > time + clickSpeed)
|
if (!buttons || system_time() > time + clickSpeed)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (mousePoint != where) {
|
float squaredDistance =
|
||||||
|
(mousePoint.x - where.x) * (mousePoint.x - where.x)
|
||||||
|
+ (mousePoint.y - where.y) * (mousePoint.y - where.y);
|
||||||
|
|
||||||
|
if (squaredDistance >= 16) {
|
||||||
drag = true;
|
drag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -242,7 +247,7 @@ BDragger::MouseDown(BPoint where)
|
|||||||
archive.AddInt32("be:actions", B_TRASH_TARGET);
|
archive.AddInt32("be:actions", B_TRASH_TARGET);
|
||||||
|
|
||||||
BPoint offset;
|
BPoint offset;
|
||||||
drawing_mode mode;
|
drawing_mode mode;
|
||||||
BBitmap *bitmap = DragBitmap(&offset, &mode);
|
BBitmap *bitmap = DragBitmap(&offset, &mode);
|
||||||
if (bitmap != NULL)
|
if (bitmap != NULL)
|
||||||
DragMessage(&archive, bitmap, mode, offset, this);
|
DragMessage(&archive, bitmap, mode, offset, this);
|
||||||
@@ -251,8 +256,12 @@ BDragger::MouseDown(BPoint where)
|
|||||||
ConvertFromScreen(fTarget->ConvertToScreen(fTarget->Bounds())),
|
ConvertFromScreen(fTarget->ConvertToScreen(fTarget->Bounds())),
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
|
if (!fShelf)
|
||||||
|
return;
|
||||||
|
|
||||||
_ShowPopUp(fTarget, where);
|
_ShowPopUp(fTarget, where);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user