summaryrefslogtreecommitdiffstats
path: root/widget/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'widget/cocoa')
-rw-r--r--widget/cocoa/nsChildView.mm8
-rw-r--r--widget/cocoa/nsCursorManager.h3
-rw-r--r--widget/cocoa/nsCursorManager.mm9
3 files changed, 14 insertions, 6 deletions
diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
index 4f9e69f2b9..0968fc89eb 100644
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -617,8 +617,12 @@ void nsChildView::SetCursor(const Cursor& aCursor) {
nsBaseWidget::SetCursor(aCursor);
- if (NS_SUCCEEDED([[nsCursorManager sharedInstance] setCustomCursor:aCursor
- widgetScaleFactor:BackingScaleFactor()])) {
+ bool forceUpdate = mUpdateCursor;
+ mUpdateCursor = false;
+ if (mCustomCursorAllowed && NS_SUCCEEDED([[nsCursorManager sharedInstance]
+ setCustomCursor:aCursor
+ widgetScaleFactor:BackingScaleFactor()
+ forceUpdate:forceUpdate])) {
return;
}
diff --git a/widget/cocoa/nsCursorManager.h b/widget/cocoa/nsCursorManager.h
index c36d8962fb..f3acbb68e9 100644
--- a/widget/cocoa/nsCursorManager.h
+++ b/widget/cocoa/nsCursorManager.h
@@ -35,7 +35,8 @@
// As above, but returns an error if the cursor isn't custom or we couldn't set
// it for some reason.
- (nsresult)setCustomCursor:(const nsIWidget::Cursor&)aCursor
- widgetScaleFactor:(CGFloat)aWidgetScaleFactor;
+ widgetScaleFactor:(CGFloat)aWidgetScaleFactor
+ forceUpdate:(bool)aForceUpdate;
/*! @method sharedInstance
@abstract Get the Singleton instance of the cursor manager.
diff --git a/widget/cocoa/nsCursorManager.mm b/widget/cocoa/nsCursorManager.mm
index 6596df25a3..e480f48da6 100644
--- a/widget/cocoa/nsCursorManager.mm
+++ b/widget/cocoa/nsCursorManager.mm
@@ -238,11 +238,14 @@ static constexpr nsCursor kCustomCursor = eCursorCount;
}
- (nsresult)setCustomCursor:(const nsIWidget::Cursor&)aCursor
- widgetScaleFactor:(CGFloat)scaleFactor {
+ widgetScaleFactor:(CGFloat)scaleFactor
+ forceUpdate:(bool)aForceUpdate {
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
- // As the user moves the mouse, this gets called repeatedly with the same aCursorImage
- if (sCurrentCursor == aCursor && sCurrentCursorScaleFactor == scaleFactor && mCurrentMacCursor) {
+ // As the user moves the mouse, this gets called repeatedly with the same
+ // aCursorImage
+ if (!aForceUpdate && sCurrentCursor == aCursor &&
+ sCurrentCursorScaleFactor == scaleFactor && mCurrentMacCursor) {
// Native dragging can unset our cursor apparently (see bug 1739352).
if (MOZ_UNLIKELY(![mCurrentMacCursor isSet])) {
[mCurrentMacCursor set];