Fix for bug 56240, reset selection and mouse capture states when mousedown/mouseup sequence processes abnormally. r:saari, sr:js

This commit is contained in:
joki%netscape.com 2002-02-20 07:23:35 +00:00
Родитель f973d3920c
Коммит 8bc4a2199b
2 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -980,6 +980,18 @@ nsFrame::HandlePress(nsIPresContext* aPresContext,
return NS_OK; return NS_OK;
} }
//We often get out of sync state issues with mousedown events that
//get interrupted by alerts/dialogs.
//Check with the ESM to see if we should process this one
nsCOMPtr<nsIEventStateManager> esm;
aPresContext->GetEventStateManager(getter_AddRefs(esm));
if (!esm)
return NS_ERROR_FAILURE;
PRBool eventOK;
esm->EventStatusOK(aEvent, &eventOK);
if (!eventOK)
return NS_OK;
nsresult rv; nsresult rv;
nsCOMPtr<nsIPresShell> shell; nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell)); aPresContext->GetShell(getter_AddRefs(shell));

Просмотреть файл

@ -980,6 +980,18 @@ nsFrame::HandlePress(nsIPresContext* aPresContext,
return NS_OK; return NS_OK;
} }
//We often get out of sync state issues with mousedown events that
//get interrupted by alerts/dialogs.
//Check with the ESM to see if we should process this one
nsCOMPtr<nsIEventStateManager> esm;
aPresContext->GetEventStateManager(getter_AddRefs(esm));
if (!esm)
return NS_ERROR_FAILURE;
PRBool eventOK;
esm->EventStatusOK(aEvent, &eventOK);
if (!eventOK)
return NS_OK;
nsresult rv; nsresult rv;
nsCOMPtr<nsIPresShell> shell; nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell)); aPresContext->GetShell(getter_AddRefs(shell));