summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-05-19 14:32:31 +0200
committerEike Ziller <eike.ziller@digia.com>2014-06-24 09:35:56 +0200
commit432aaf05dabec82214ae018338aac827a8b326f8 (patch)
tree58c13856442c3a87b7021410c5d9be5d5d906a1a /src/plugins/platforms/cocoa/qnsview.h
parentdfc1e23972136e8d86c45d43f3bf9048aa02c59a (diff)
Cocoa: Do mouse move and cursor update handling separate from view
We are using tracking areas for mouse move, enter/leave and cursor update events, so we should keep handling of that out of the "normal" event chain. If we handle mouse moved events in the views' mouseMoved method, we need to pass the event up the responder chain if we didn't handle it, or we would break for example hover behavior in native WebViews, because these do not handle mouse moved events directly in their mouseMoved:, but only if the event wasn't handled otherwise (arguably a bug in Web(HTML)View). But passing the event up the responder chain is not good either, because the QNSViews in the parent hierarchy get the event from their tracking areas already. Change-Id: I636a84ab1b7ef73070f81a8e33b5fa734ff4a42c Task-number: QTBUG-26593 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.h')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 7e146c5f58..37a0c1feb1 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -54,6 +54,8 @@ class QCocoaBackingStore;
class QCocoaGLContext;
QT_END_NAMESPACE
+Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper);
+
@interface QNSView : NSView <NSTextInputClient> {
QCocoaBackingStore* m_backingStore;
QPoint m_backingStoreOffset;
@@ -72,6 +74,7 @@ QT_END_NAMESPACE
QCocoaGLContext *m_glContext;
bool m_shouldSetGLContextinDrawRect;
NSString *m_inputSource;
+ QNSViewMouseMoveHelper *m_mouseMoveHelper;
}
- (id)init;
@@ -102,9 +105,10 @@ QT_END_NAMESPACE
- (void)mouseDown:(NSEvent *)theEvent;
- (void)mouseDragged:(NSEvent *)theEvent;
- (void)mouseUp:(NSEvent *)theEvent;
-- (void)mouseMoved:(NSEvent *)theEvent;
-- (void)mouseEntered:(NSEvent *)theEvent;
-- (void)mouseExited:(NSEvent *)theEvent;
+- (void)mouseMovedImpl:(NSEvent *)theEvent;
+- (void)mouseEnteredImpl:(NSEvent *)theEvent;
+- (void)mouseExitedImpl:(NSEvent *)theEvent;
+- (void)cursorUpdateImpl:(NSEvent *)theEvent;
- (void)rightMouseDown:(NSEvent *)theEvent;
- (void)rightMouseDragged:(NSEvent *)theEvent;
- (void)rightMouseUp:(NSEvent *)theEvent;