Use NSTextInputContext discardMarkedText when MacOS is Lion or later.

NSInput manager has been deprecated since 10.6
This commit is contained in:
John Ralls 2020-04-14 17:07:24 -07:00
parent 114f374623
commit 0e30a96404

View File

@ -270,9 +270,12 @@ discard_preedit (GtkIMContext *context)
/* reset any partial input for this NSView */
[(GdkQuartzView *)nsview unmarkText];
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
NSInputManager *currentInputManager = [NSInputManager currentInputManager];
[currentInputManager markedTextAbandoned:nsview];
#else
[[NSTextInputContext currentInputContext] discardMarkedText];
#endif
if (qc->preedit_str && strlen (qc->preedit_str) > 0)
{
g_signal_emit_by_name (context, "commit", qc->preedit_str);