From ae87d2ac8f4ee62de5c9ec59ee575cf3678fa367 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 3 Dec 2009 12:53:41 +0100 Subject: Ensure the button state is correct when creating a QWheelEvent on Mac. On Mac when we receive a scrollWheel event on Carbon or Cocoa then we need to use QApplication::mouseButtons() in order to ensure the QWheelEvent has the right button states set. This is because the buttons state information is not passed in the native event at all. Reviewed-by: MortenS --- src/gui/kernel/qapplication_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel/qapplication_mac.mm') diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index 22a0959305..688e51fcfb 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1687,7 +1687,10 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event UInt32 mac_buttons = 0; GetEventParameter(event, kEventParamMouseChord, typeUInt32, 0, sizeof(mac_buttons), 0, &mac_buttons); - buttons = qt_mac_get_buttons(mac_buttons); + if (ekind != kEventMouseWheelMoved) + buttons = qt_mac_get_buttons(mac_buttons); + else + buttons = QApplication::mouseButtons(); } int wheel_deltaX = 0; -- cgit v1.2.1