From 85f52dceaa8ab71c3d00d2518c819a957cae946f Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 3 Dec 2018 21:25:38 +0900 Subject: [PATCH] Replace NSInputManager for MacOS 10.6 and later. --- gdk/quartz/GdkQuartzView.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index 7237363f75..88485fc2c5 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -17,6 +17,7 @@ * License along with this library. If not, see . */ +#include #include "config.h" #import "GdkQuartzView.h" #include "gdkquartzwindow.h" @@ -201,8 +202,12 @@ /* discard invalid text input with Chinese input methods */ str = ""; [self unmarkText]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 NSInputManager *currentInputManager = [NSInputManager currentInputManager]; [currentInputManager markedTextAbandoned:self]; +#else + [[NSTextInputContext currentInputContext] discardMarkedText]; +#endif } else {