diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-07-02 12:28:46 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-07-02 12:32:53 (GMT) |
commit | 3473453dda9f40bf94733bc971b0cc1658e7c3c8 (patch) | |
tree | 05b9654a0e75fce168e5fcb6d8ec79b7e36641d4 /src/gui/kernel/qcocoaview_mac.mm | |
parent | 349997b5c4167b07d0bdc55beff175b39f3abe75 (diff) | |
download | Qt-3473453dda9f40bf94733bc971b0cc1658e7c3c8.zip Qt-3473453dda9f40bf94733bc971b0cc1658e7c3c8.tar.gz Qt-3473453dda9f40bf94733bc971b0cc1658e7c3c8.tar.bz2 |
Fix a regression where dynamic tooltips wouldn't show up in Cocoa.
Tracking of mouse events was only enabled when enableMouseTracking or
Hover or a tooltip had been set explictly on the item, but this meant
that the dynamic QEvent::Tooltips would never get dispatched. So, in
order to help out people that might use this feature, all QCocoaViews
must pay the mouse move event tax *sigh*.
I added comments in the proper places so that we DO the right thing for
a release where we can force the change in behavior.
Task-number: 257320
Reviewed-by: Denis
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index ae3265b..17e3313 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -564,11 +564,15 @@ extern "C" { [self removeTrackingArea:t]; } } + + // Ideally, we shouldn't have NSTrackingMouseMoved events included below, it should + // only be turned on if mouseTracking, hover is on or a tool tip is set. + // Unfortunately, Qt will send "tooltip" events on mouse moves, so we need to + // turn it on in ALL case. That means EVERY QCocoaView gets to pay the cost of + // mouse moves delivered to it (Apple recommends keeping it OFF because there + // is a performance hit). So it goes. NSUInteger trackingOptions = NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp - | NSTrackingInVisibleRect; - if (qwidget->hasMouseTracking() || !qwidgetprivate->toolTip.isEmpty() - || qwidget->testAttribute(Qt::WA_Hover)) - trackingOptions |= NSTrackingMouseMoved; + | NSTrackingInVisibleRect | NSTrackingMouseMoved; NSTrackingArea *ta = [[NSTrackingArea alloc] initWithRect:NSMakeRect(0, 0, qwidget->width(), qwidget->height()) |