summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview_mouse.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <torarnv@gmail.com>2019-05-07 15:46:28 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-05-08 12:23:47 +0000
commit9054950b7c51cc0d07040eb112ff7ce75e635abd (patch)
tree4d1ff8997a9704c0aa990248b7b70f2dd7256b54 /src/plugins/platforms/cocoa/qnsview_mouse.mm
parent99b1719c1eb96e71894068f60eacf4ef261ca0e5 (diff)
macOS: Always respond to cursorUpdate by applying custom cursor if set
Calling super will push the default arrow cursor, so we should only do that if our own cursor has been unset. Change-Id: I71d8934e7eab2b15e150730e2282e7063ada305a Fixes: QTBUG-75552 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview_mouse.mm')
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm
index d5df2018e1..d4419b42a4 100644
--- a/src/plugins/platforms/cocoa/qnsview_mouse.mm
+++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm
@@ -497,12 +497,15 @@
// uses the legacy cursorRect API, so the cursor is reset to the arrow
// cursor. See rdar://34183708
- if (self.cursor && self.cursor != NSCursor.currentCursor) {
- qCInfo(lcQpaMouse) << "Updating cursor for" << self << "to" << self.cursor;
+ auto previousCursor = NSCursor.currentCursor;
+
+ if (self.cursor)
[self.cursor set];
- } else {
+ else
[super cursorUpdate:theEvent];
- }
+
+ if (NSCursor.currentCursor != previousCursor)
+ qCInfo(lcQpaMouse) << "Cursor update for" << self << "resulted in new cursor" << NSCursor.currentCursor;
}
- (void)mouseMovedImpl:(NSEvent *)theEvent