mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Force any mouse grabs pointing into the old page to be dropped when we cache the page in session history. Bug 304288, r+sr=roc.
This commit is contained in:
parent
684679410c
commit
1844b50360
@ -491,13 +491,22 @@ NS_IMETHODIMP nsView::SetFloating(PRBool aFloatingView)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsView::InvalidateHierarchy()
|
||||
void nsView::InvalidateHierarchy(nsViewManager *aViewManagerParent)
|
||||
{
|
||||
if (aViewManagerParent) {
|
||||
// We're removed from the view hierarchy of aRemovalPoint, so make sure
|
||||
// we're not still grabbing mouse events.
|
||||
if (aViewManagerParent->GetMouseEventGrabber() == this) {
|
||||
PRBool res;
|
||||
aViewManagerParent->GrabMouseEvents(nsnull, res);
|
||||
}
|
||||
}
|
||||
|
||||
if (mViewManager->GetRootView() == this)
|
||||
mViewManager->InvalidateHierarchy();
|
||||
|
||||
for (nsView *child = mFirstChild; child; child = child->GetNextSibling())
|
||||
child->InvalidateHierarchy();
|
||||
child->InvalidateHierarchy(aViewManagerParent);
|
||||
}
|
||||
|
||||
void nsView::InsertChild(nsView *aChild, nsView *aSibling)
|
||||
@ -528,7 +537,7 @@ void nsView::InsertChild(nsView *aChild, nsView *aSibling)
|
||||
nsViewManager *vm = aChild->GetViewManager();
|
||||
if (vm->GetRootView() == aChild)
|
||||
{
|
||||
aChild->InvalidateHierarchy();
|
||||
aChild->InvalidateHierarchy(nsnull); // don't care about releasing grabs
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -565,7 +574,7 @@ void nsView::RemoveChild(nsView *child)
|
||||
nsViewManager *vm = child->GetViewManager();
|
||||
if (vm->GetRootView() == child)
|
||||
{
|
||||
child->InvalidateHierarchy();
|
||||
child->InvalidateHierarchy(GetViewManager());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -293,8 +293,11 @@ public:
|
||||
void SetPositionIgnoringChildWidgets(nscoord aX, nscoord aY);
|
||||
nsresult LoadWidget(const nsCID &aClassIID);
|
||||
|
||||
// Update the cached RootViewManager for all view manager descendents.
|
||||
void InvalidateHierarchy();
|
||||
// Update the cached RootViewManager for all view manager descendents,
|
||||
// If the hierarchy is being removed, aViewManagerParent points to the view
|
||||
// manager for the hierarchy's old parent, and will have its mouse grab
|
||||
// released if it points to any view in this view hierarchy.
|
||||
void InvalidateHierarchy(nsViewManager *aViewManagerParent);
|
||||
|
||||
virtual ~nsView();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user