From 9054950b7c51cc0d07040eb112ff7ce75e635abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 7 May 2019 15:46:28 +0200 Subject: macOS: Always respond to cursorUpdate by applying custom cursor if set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview_mouse.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/cocoa/qnsview_mouse.mm') 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 -- cgit v1.2.3