Bug 632953 - Clear mouse capture after window resize completes. r=jimm

This commit is contained in:
Neil Deakin 2011-03-25 18:17:35 -05:00
parent 042412a300
commit 4127d3b0af
4 changed files with 28 additions and 0 deletions

View File

@ -59,4 +59,8 @@ CPPSRCS = \
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
-I$(srcdir)/../../content/events/src/ \
$(NULL)
CXXFLAGS += $(MOZ_CAIRO_CFLAGS)

View File

@ -62,6 +62,7 @@
#include "nsXULPopupManager.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsEventStateManager.h"
static NS_DEFINE_IID(kRegionCID, NS_REGION_CID);
@ -813,6 +814,20 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
break;
}
case NS_DONESIZEMOVE:
{
nsCOMPtr<nsIPresShell> shell = do_QueryInterface(mObserver);
if (shell) {
nsPresContext* presContext = shell->GetPresContext();
if (presContext) {
nsEventStateManager::ClearGlobalActiveContent(nsnull);
}
mObserver->ClearMouseCapture(aView);
}
}
break;
case NS_XUL_CLOSE:
{
// if this is a popup, make a request to hide it. Note that a popuphidden

View File

@ -227,6 +227,9 @@ class nsHashKey;
// keyboard accelerator indicators has changed.
#define NS_UISTATECHANGED (NS_WINDOW_START + 43)
// Done sizing or moving a window, so ensure that the mousedown state was cleared.
#define NS_DONESIZEMOVE (NS_WINDOW_START + 44)
#define NS_RESIZE_EVENT (NS_WINDOW_START + 60)
#define NS_SCROLL_EVENT (NS_WINDOW_START + 61)

View File

@ -5310,6 +5310,12 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
DispatchPendingEvents();
break;
case WM_EXITSIZEMOVE:
if (!sIsInMouseCapture) {
DispatchStandardEvent(NS_DONESIZEMOVE);
}
break;
case WM_APPCOMMAND:
{
PRUint32 appCommand = GET_APPCOMMAND_LPARAM(lParam);