зеркало из https://github.com/mozilla/gecko-dev.git
for 48250, turn off mouse capture when a drag gesture begins. r=mjudge.
This commit is contained in:
Родитель
fc367b8a1a
Коммит
e2aeb68cee
|
@ -756,15 +756,18 @@ nsEventStateManager :: GenerateDragGesture ( nsIPresContext* aPresContext, nsGUI
|
||||||
mCurrentTarget = mGestureDownFrame;
|
mCurrentTarget = mGestureDownFrame;
|
||||||
nsCOMPtr<nsIContent> lastContent;
|
nsCOMPtr<nsIContent> lastContent;
|
||||||
if ( mGestureDownFrame ) {
|
if ( mGestureDownFrame ) {
|
||||||
|
// the mouseDown captures the mouse, make sure we release it so that dragging
|
||||||
|
// to other views works correctly.
|
||||||
|
mGestureDownFrame->CaptureMouse ( aPresContext, PR_FALSE );
|
||||||
mGestureDownFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
|
mGestureDownFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
|
||||||
if ( lastContent )
|
if ( lastContent )
|
||||||
lastContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
lastContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// dispatch to the frame
|
// dispatch to the frame
|
||||||
if ( mGestureDownFrame )
|
if ( mGestureDownFrame )
|
||||||
mGestureDownFrame->HandleEvent(aPresContext, &event, &status);
|
mGestureDownFrame->HandleEvent(aPresContext, &event, &status);
|
||||||
|
|
||||||
StopTrackingDragGesture();
|
StopTrackingDragGesture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2266,7 +2269,7 @@ nsEventStateManager::GetEventTargetContent(nsEvent* aEvent, nsIContent** aConten
|
||||||
if (mCurrentTargetContent) {
|
if (mCurrentTargetContent) {
|
||||||
*aContent = mCurrentTargetContent;
|
*aContent = mCurrentTargetContent;
|
||||||
NS_IF_ADDREF(*aContent);
|
NS_IF_ADDREF(*aContent);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mCurrentTarget) {
|
if (!mCurrentTarget) {
|
||||||
|
|
|
@ -756,15 +756,18 @@ nsEventStateManager :: GenerateDragGesture ( nsIPresContext* aPresContext, nsGUI
|
||||||
mCurrentTarget = mGestureDownFrame;
|
mCurrentTarget = mGestureDownFrame;
|
||||||
nsCOMPtr<nsIContent> lastContent;
|
nsCOMPtr<nsIContent> lastContent;
|
||||||
if ( mGestureDownFrame ) {
|
if ( mGestureDownFrame ) {
|
||||||
|
// the mouseDown captures the mouse, make sure we release it so that dragging
|
||||||
|
// to other views works correctly.
|
||||||
|
mGestureDownFrame->CaptureMouse ( aPresContext, PR_FALSE );
|
||||||
mGestureDownFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
|
mGestureDownFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
|
||||||
if ( lastContent )
|
if ( lastContent )
|
||||||
lastContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
lastContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// dispatch to the frame
|
// dispatch to the frame
|
||||||
if ( mGestureDownFrame )
|
if ( mGestureDownFrame )
|
||||||
mGestureDownFrame->HandleEvent(aPresContext, &event, &status);
|
mGestureDownFrame->HandleEvent(aPresContext, &event, &status);
|
||||||
|
|
||||||
StopTrackingDragGesture();
|
StopTrackingDragGesture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2266,7 +2269,7 @@ nsEventStateManager::GetEventTargetContent(nsEvent* aEvent, nsIContent** aConten
|
||||||
if (mCurrentTargetContent) {
|
if (mCurrentTargetContent) {
|
||||||
*aContent = mCurrentTargetContent;
|
*aContent = mCurrentTargetContent;
|
||||||
NS_IF_ADDREF(*aContent);
|
NS_IF_ADDREF(*aContent);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mCurrentTarget) {
|
if (!mCurrentTarget) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче