diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-18 09:15:50 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-18 09:15:50 (GMT) |
commit | 2e67558f169a8ccc1b50a6a50f5093e0499c75f0 (patch) | |
tree | 9b61d6ecfdcae4927d8e73ac45e64188413517a3 /src/gui/kernel/qt_cocoa_helpers_mac.mm | |
parent | 97668bd920685d25faf82bfde2027305e67b202e (diff) | |
parent | 46ba213883cf46871ef539ef4d2304064b671175 (diff) | |
download | Qt-2e67558f169a8ccc1b50a6a50f5093e0499c75f0.zip Qt-2e67558f169a8ccc1b50a6a50f5093e0499c75f0.tar.gz Qt-2e67558f169a8ccc1b50a6a50f5093e0499c75f0.tar.bz2 |
Merge remote branch 'alien-on-cocoa/master' into alien-merged-mainline
This merges alien feature branch with Qt master/mainline
Conflicts:
src/gui/kernel/qt_cocoa_helpers_mac.mm
Diffstat (limited to 'src/gui/kernel/qt_cocoa_helpers_mac.mm')
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 2b10422..19e0996 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1212,6 +1212,10 @@ bool qt_mac_handleMouseEvent(NSEvent *event, QEvent::Type eventType, Qt::MouseBu if (qt_mac_sendMacEventToWidget(widgetToGetMouse, carbonEvent)) return true; + // Keep previousButton to make sure we don't send double click + // events when the user double clicks using two different buttons: + static Qt::MouseButton previousButton = Qt::NoButton; + Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([event modifierFlags]); NSInteger clickCount = [event clickCount]; Qt::MouseButtons buttons = 0; @@ -1235,7 +1239,7 @@ bool qt_mac_handleMouseEvent(NSEvent *event, QEvent::Type eventType, Qt::MouseBu break; case QEvent::MouseButtonPress: qt_button_down = widgetUnderMouse; - if (clickCount % 2 == 0 && buttons == button) + if (clickCount % 2 == 0 && (previousButton == Qt::NoButton || previousButton == button)) eventType = QEvent::MouseButtonDblClick; if (button == Qt::LeftButton && (keyMods & Qt::MetaModifier)) { button = Qt::RightButton; @@ -1277,6 +1281,7 @@ bool qt_mac_handleMouseEvent(NSEvent *event, QEvent::Type eventType, Qt::MouseBu qt_mac_checkEnterLeaveForNativeWidgets(widgetUnderMouse); } + previousButton = button; return true; } #endif |