summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/macgui/guitest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other/macgui/guitest.cpp')
-rw-r--r--tests/auto/other/macgui/guitest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp
index 1ddd0ca870..dee7ace1b9 100644
--- a/tests/auto/other/macgui/guitest.cpp
+++ b/tests/auto/other/macgui/guitest.cpp
@@ -145,7 +145,9 @@ namespace NativeEvents {
CGEventType mouseDownType = (buttons & Qt::LeftButton) ? kCGEventLeftMouseDown :
(buttons & Qt::RightButton) ? kCGEventRightMouseDown :
kCGEventOtherMouseDown;
- CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGEventLeftMouseDown;
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherMouseDown, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGMouseButtonLeft;
CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL, mouseDownType, position, mouseButton);
CGEventPost(kCGHIDEventTap, mouseEvent);