diff options
author | Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> | 2013-11-25 19:45:06 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-03 11:40:50 +0100 |
commit | 5361513ec812c545ca2cedea6c8a30c362cb8e5d (patch) | |
tree | c7dc64e4d8cb955971104fe3a26726a68b7eaa83 /src/plugins/platforms/cocoa/qnswindowdelegate.mm | |
parent | 923d498029be406a684f8953afc68f10c07e2789 (diff) |
Cocoa: Mouse enter events on window activation.
This patch tells the window system that it should create a mouse enter
event if a window was activated when the mouse was inside. This wasn't
working and was a regression.
Task-number: QTBUG-35109
[ChangeLog][Cocoa] Fix enterEvent not being called on activate.
Change-Id: I4e4662b4a4c58dafa8d0a2c09458ab88f678d243
Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnswindowdelegate.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnswindowdelegate.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 10536bd5f4..c9b3d69381 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -56,6 +56,17 @@ return self; } +- (void)windowDidBecomeKey:(NSNotification *)notification +{ + Q_UNUSED(notification); + if (m_cocoaWindow->m_windowUnderMouse) { + QPointF windowPoint; + QPointF screenPoint; + [m_cocoaWindow->m_qtView convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + QWindowSystemInterface::handleEnterEvent(m_cocoaWindow->m_enterLeaveTargetWindow, windowPoint, screenPoint); + } +} + - (void)windowDidResize:(NSNotification *)notification { Q_UNUSED(notification); |