mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
updating new state controler for mouse status. aka dragging has stopped
This commit is contained in:
parent
f70863f3eb
commit
57516cf432
@ -38,6 +38,8 @@
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIFocusableContent.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsIDOMSelection.h"
|
||||
#include "nsIFrameSelection.h"
|
||||
|
||||
static NS_DEFINE_IID(kIEventStateManagerIID, NS_IEVENTSTATEMANAGER_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@ -159,8 +161,22 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
||||
case NS_MOUSE_RIGHT_BUTTON_UP:
|
||||
ret = CheckForAndDispatchClick(aPresContext, (nsMouseEvent*)aEvent, aStatus);
|
||||
SetContentState(nsnull, NS_EVENT_STATE_ACTIVE);
|
||||
{
|
||||
ret = CheckForAndDispatchClick(aPresContext, (nsMouseEvent*)aEvent, aStatus);
|
||||
SetContentState(nsnull, NS_EVENT_STATE_ACTIVE);
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
nsresult rv = aPresContext.GetShell(getter_AddRefs(shell));
|
||||
if (NS_SUCCEEDED(rv) && shell){
|
||||
nsCOMPtr<nsIDOMSelection> selection;
|
||||
rv = shell->GetSelection(getter_AddRefs(selection));
|
||||
if (NS_SUCCEEDED(rv) && selection){
|
||||
nsCOMPtr<nsIFrameSelection> frameSel;
|
||||
frameSel = do_QueryInterface(selection);
|
||||
if (frameSel)
|
||||
frameSel->SetMouseDownState(PR_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_KEY_DOWN:
|
||||
ret = DispatchKeyPressEvent(aPresContext, (nsKeyEvent*)aEvent, aStatus);
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIFocusableContent.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsIDOMSelection.h"
|
||||
#include "nsIFrameSelection.h"
|
||||
|
||||
static NS_DEFINE_IID(kIEventStateManagerIID, NS_IEVENTSTATEMANAGER_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@ -159,8 +161,22 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
||||
case NS_MOUSE_RIGHT_BUTTON_UP:
|
||||
ret = CheckForAndDispatchClick(aPresContext, (nsMouseEvent*)aEvent, aStatus);
|
||||
SetContentState(nsnull, NS_EVENT_STATE_ACTIVE);
|
||||
{
|
||||
ret = CheckForAndDispatchClick(aPresContext, (nsMouseEvent*)aEvent, aStatus);
|
||||
SetContentState(nsnull, NS_EVENT_STATE_ACTIVE);
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
nsresult rv = aPresContext.GetShell(getter_AddRefs(shell));
|
||||
if (NS_SUCCEEDED(rv) && shell){
|
||||
nsCOMPtr<nsIDOMSelection> selection;
|
||||
rv = shell->GetSelection(getter_AddRefs(selection));
|
||||
if (NS_SUCCEEDED(rv) && selection){
|
||||
nsCOMPtr<nsIFrameSelection> frameSel;
|
||||
frameSel = do_QueryInterface(selection);
|
||||
if (frameSel)
|
||||
frameSel->SetMouseDownState(PR_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_KEY_DOWN:
|
||||
ret = DispatchKeyPressEvent(aPresContext, (nsKeyEvent*)aEvent, aStatus);
|
||||
|
Loading…
x
Reference in New Issue
Block a user