diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-08-20 11:16:42 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-08-20 11:33:30 (GMT) |
commit | 206c238d5ea9601d7dae77a3a45943a1cfea2747 (patch) | |
tree | fac0b0e4c069ae3d41caee909499aff4016f66a1 /src/gui/kernel/qcocoaview_mac.mm | |
parent | 87d7479fcc5f089ac164c5336b405d0299244c43 (diff) | |
download | Qt-206c238d5ea9601d7dae77a3a45943a1cfea2747.zip Qt-206c238d5ea9601d7dae77a3a45943a1cfea2747.tar.gz Qt-206c238d5ea9601d7dae77a3a45943a1cfea2747.tar.bz2 |
Flickering "Whatsthis" pointer in Cocoa
Since mouse tracking is always enabled on all QCocoaView-s, we are
getting mouseMoved events for both parent and child (if mouse is over
the child). In such cases the mouseMoved events are ignored for the
parent view.
We are using the native NSCursor stack for setting the override cursor.
The current implementation for changeOverrideCursor is modified to keep
this stack in sync with Qt's internal list.
Task-number: 258173
Reviewed-by: Morten Sorvig
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 7ac0d89..5a0209d 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -667,7 +667,15 @@ extern "C" { - (void)mouseMoved:(NSEvent *)theEvent { - qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); + // We always enable mouse tracking for all QCocoaView-s. In cases where we have + // child views, we will receive mouseMoved for both parent & the child (if + // mouse is over the child). We need to ignore the parent mouseMoved in such + // cases. + NSPoint windowPoint = [theEvent locationInWindow]; + NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; + if (candidateView && candidateView == self) { + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); + } } - (void)mouseDown:(NSEvent *)theEvent |