diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview_mouse.mm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm index 8ea509e54a..f9038e08da 100644 --- a/src/plugins/platforms/cocoa/qnsview_mouse.mm +++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm @@ -429,9 +429,20 @@ static const QPointingDevice *pointingDeviceFor(qint64 deviceID) return; } + bool handleMouseEvent = true; + // FIXME: AppKit doesn't limit itself to passing the event on to the input method + // based on there being marked text or not. It also transfers first responder to + // the view before calling mouseDown, whereas we only transfer focus once the mouse + // press is delivered. if ([self hasMarkedText]) { - [[NSTextInputContext currentInputContext] handleEvent:theEvent]; - } else { + if (QPlatformInputContext::inputItemClipRectangle().contains(qtWindowPoint)) { + qCDebug(lcQpaInputMethods) << "Asking input context to handle mouse press"; + [NSTextInputContext.currentInputContext handleEvent:theEvent]; + handleMouseEvent = false; + } + } + + if (handleMouseEvent) { if (!m_dontOverrideCtrlLMB && (theEvent.modifierFlags & NSEventModifierFlagControl)) { m_buttons |= Qt::RightButton; m_sendUpAsRightButton = true; |