add a couple null checks to head off potential crashes, clean up an early return. Cocoa widgets only. no bug.
git-svn-id: svn://10.0.0.236/trunk@194430 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2557,7 +2557,6 @@ nsChildView::GetThebesSurface()
|
||||
|
||||
- (void)mouseDown:(NSEvent *)theEvent
|
||||
{
|
||||
BOOL popupRolledUp = NO;
|
||||
// make sure this view is not in the rollup widget
|
||||
// the fastest way to do this is by comparing native window pointers
|
||||
if (gRollupWidget != nsnull) {
|
||||
@@ -2567,16 +2566,13 @@ nsChildView::GetThebesSurface()
|
||||
// roll up any popups
|
||||
if (gRollupListener != nsnull) {
|
||||
gRollupListener->Rollup();
|
||||
popupRolledUp = YES;
|
||||
// If we rolled up a popup, we don't want to pass the click down to gecko.
|
||||
// This happens e.g. when you click a popupmenubutton (the menu opens), then click
|
||||
// on the popupmenubutton a second time, which should hide the menu.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we rolled up a popup, we don't want to pass the click down to gecko.
|
||||
// This happens e.g. when you click a popupmenubutton (the menu opens), then click
|
||||
// on the popupmenubutton a second time, which should hide the menu.
|
||||
if (popupRolledUp)
|
||||
return;
|
||||
|
||||
// if the command and alt keys are held down, initiate hand scrolling
|
||||
if ([ChildView areHandScrollModifiers:[theEvent modifierFlags]]) {
|
||||
@@ -2584,7 +2580,7 @@ nsChildView::GetThebesSurface()
|
||||
// needed to change the focus, among other things, since we don't
|
||||
// get to do that below.
|
||||
[super mouseDown:theEvent];
|
||||
return; // do not pass this mousedown event to gecko
|
||||
return; // do not pass this mousedown event to gecko
|
||||
}
|
||||
|
||||
#if USE_CLICK_HOLD_CONTEXTMENU
|
||||
@@ -2609,7 +2605,8 @@ nsChildView::GetThebesSurface()
|
||||
|
||||
// send event into Gecko by going directly to the
|
||||
// the widget.
|
||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||
if (mGeckoChild)
|
||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||
|
||||
// XXX maybe call markedTextSelectionChanged:client: here?
|
||||
}
|
||||
@@ -2637,8 +2634,8 @@ nsChildView::GetThebesSurface()
|
||||
|
||||
// send event into Gecko by going directly to the
|
||||
// the widget.
|
||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||
|
||||
if (mGeckoChild)
|
||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||
}
|
||||
|
||||
- (void)mouseMoved:(NSEvent*)theEvent
|
||||
|
||||
Reference in New Issue
Block a user