summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcursor_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qcursor_mac.mm')
-rw-r--r--src/gui/kernel/qcursor_mac.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/kernel/qcursor_mac.mm b/src/gui/kernel/qcursor_mac.mm
index 03e38b0..c3d6c54 100644
--- a/src/gui/kernel/qcursor_mac.mm
+++ b/src/gui/kernel/qcursor_mac.mm
@@ -224,6 +224,15 @@ QPoint QCursor::pos()
void QCursor::setPos(int x, int y)
{
+#ifdef QT_MAC_USE_COCOA
+ CGPoint pos;
+ pos.x = x;
+ pos.y = y;
+
+ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
+ CGEventPost(kCGHIDEventTap, e);
+ CFRelease(e);
+#else
CGWarpMouseCursorPosition(CGPointMake(x, y));
/* I'm not too keen on doing this, but this makes it a lot easier, so I just
@@ -240,6 +249,7 @@ void QCursor::setPos(int x, int y)
QApplication::mouseButtons(), QApplication::keyboardModifiers());
qt_sendSpontaneousEvent(widget, &me);
}
+#endif
}
void QCursorData::initCursorFromBitmap()