summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qt_cocoa_helpers_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-04-07 07:43:36 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-04-07 10:35:57 (GMT)
commitbb718c6a6e626b5b353884525223de5d7a178c2d (patch)
tree984633c407dfda98f5fb89aeb0cc4325395c834e /src/gui/kernel/qt_cocoa_helpers_mac.mm
parentd3ae1a9386a85475ba685cfc9a3009f119cad895 (diff)
downloadQt-bb718c6a6e626b5b353884525223de5d7a178c2d.zip
Qt-bb718c6a6e626b5b353884525223de5d7a178c2d.tar.gz
Qt-bb718c6a6e626b5b353884525223de5d7a178c2d.tar.bz2
Cocoa: mouse release event reports wrong button state
If you release the mouse over a non-client area, the following mouse up event contains the mouse button that was released in the 'buttons' state. This is wrong, according to the documentation (and the native events auto test!) Reviewed-by: msorvig
Diffstat (limited to 'src/gui/kernel/qt_cocoa_helpers_mac.mm')
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index b1e4c94..a05c7d5 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -882,7 +882,15 @@ void qt_mac_dispatchNCMouseMessage(void * /* NSWindow* */eventWindow, void * /*
}
}
- QMouseEvent qme(eventType, qlocalPoint, qglobalPoint, button, button, keyMods);
+ Qt::MouseButtons buttons = 0;
+ {
+ UInt32 mac_buttons;
+ if (GetEventParameter((EventRef)[event eventRef], kEventParamMouseChord, typeUInt32, 0,
+ sizeof(mac_buttons), 0, &mac_buttons) == noErr)
+ buttons = qt_mac_get_buttons(mac_buttons);
+ }
+
+ QMouseEvent qme(eventType, qlocalPoint, qglobalPoint, button, buttons, keyMods);
qt_sendSpontaneousEvent(widgetToGetEvent, &qme);
// We don't need to set the implicit grab widget here because we won't