diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 2a09ca7b6a84..942c01c0a08b 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -124,7 +124,7 @@ extern "C" { // defined in nsMenuBarX.mm extern NSMenu* sApplicationMenu; // Application menu shared by all menubars -bool gChildViewMethodsSwizzled = false; +static bool gChildViewMethodsSwizzled = false; extern nsISupportsArray *gDraggedTransferables; @@ -4752,7 +4752,6 @@ NSEvent* gLastDragMouseDownEvent = nil; mUsingOMTCompositor = aUseOMTC; } - // Returning NO from this method only disallows ordering on mousedown - in order // to prevent it for mouseup too, we need to call [NSApp preventWindowOrdering] // when handling the mousedown event. @@ -5544,14 +5543,18 @@ static int32_t RoundUp(double aDouble) case NSOtherMouseDragged: if ([aMouseEvent subtype] == NSTabletPointEventSubtype) { mouseEvent->pressure = [aMouseEvent pressure]; + MOZ_ASSERT(mouseEvent->pressure >= 0.0 && mouseEvent->pressure <= 1.0); } break; + + default: + // Don't check other NSEvents for pressure. + break; } NS_OBJC_END_TRY_ABORT_BLOCK; } - #pragma mark - // NSTextInput implementation