Skip to content

Instantly share code, notes, and snippets.

@swallat
Created September 18, 2015 20:31
Show Gist options
  • Save swallat/c8b597f5f7590854b6e9 to your computer and use it in GitHub Desktop.
Save swallat/c8b597f5f7590854b6e9 to your computer and use it in GitHub Desktop.
diff --git a/qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm b/qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm
index 06e957c..9e7c543 100644
--- a/qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -73,9 +73,11 @@ void QCocoaCursor::setPos(const QPoint &position)
pos.x = position.x();
pos.y = position.y();
- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
- CGEventPost(kCGHIDEventTap, e);
- CFRelease(e);
+ CGEventRef e = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, pos, kCGMouseButtonLeft);
+ if (e != NULL) {
+ CGEventPost(kCGHIDEventTap, e);
+ CFRelease(e);
+ }
}
NSCursor *QCocoaCursor::convertCursor(QCursor * cursor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment