[gtk/wip/fanc999/gtk-3-24-meson-msvc: 41/297] Replace NSInputManager for MacOS 10.6 and later.



commit b95c45353b6949e97f56c837f8b506db611a9d50
Author: John Ralls <jralls ceridwen us>
Date:   Mon Dec 3 21:25:38 2018 +0900

    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 <http://www.gnu.org/licenses/>.
  */
 
+#include <AvailabilityMacros.h>
 #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
    {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]