From 1fe23497625617cac6e1481f8f2d8d085a876550 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 21 Apr 2015 11:27:07 +0200 Subject: [PATCH] Cocoa: stop using the deprecated NSInputManager. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced by NSTextInputContext. Change-Id: I694b28b766f8bf1d37e0ee87ff503e33d205f8ab Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoainputcontext.mm | 5 ++--- src/plugins/platforms/cocoa/qnsview.mm | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) 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;