diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.mm b/src/plugins/platforms/cocoa/qcocoainputcontext.mm index 0eafae1f2d..c22fe8774b 100644 --- a/src/plugins/platforms/cocoa/qcocoainputcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoainputcontext.mm @@ -99,9 +99,8 @@ void QCocoaInputContext::reset() return; QCocoaAutoReleasePool pool; - NSInputManager *currentIManager = [NSInputManager currentInputManager]; - if (currentIManager) { - [currentIManager markedTextAbandoned:view]; + if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) { + [ctxt discardMarkedText]; [view unmarkText]; } } diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 12854593f8..ad81c396f9 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -804,10 +804,7 @@ QT_WARNING_POP } if ([self hasMarkedText]) { - NSInputManager* inputManager = [NSInputManager currentInputManager]; - if ([inputManager wantsToHandleMouseEvents]) { - [inputManager handleMouseEvent:theEvent]; - } + [[NSTextInputContext currentInputContext] handleEvent:theEvent]; } else { if ([QNSView convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) { m_buttons |= Qt::RightButton;