Use NSTextInputContext discardMarkedText when MacOS is Lion or later.
NSInput manager has been deprecated since 10.6
This commit is contained in:
parent
114f374623
commit
0e30a96404
@ -270,9 +270,12 @@ discard_preedit (GtkIMContext *context)
|
|||||||
|
|
||||||
/* reset any partial input for this NSView */
|
/* reset any partial input for this NSView */
|
||||||
[(GdkQuartzView *)nsview unmarkText];
|
[(GdkQuartzView *)nsview unmarkText];
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
NSInputManager *currentInputManager = [NSInputManager currentInputManager];
|
NSInputManager *currentInputManager = [NSInputManager currentInputManager];
|
||||||
[currentInputManager markedTextAbandoned:nsview];
|
[currentInputManager markedTextAbandoned:nsview];
|
||||||
|
#else
|
||||||
|
[[NSTextInputContext currentInputContext] discardMarkedText];
|
||||||
|
#endif
|
||||||
if (qc->preedit_str && strlen (qc->preedit_str) > 0)
|
if (qc->preedit_str && strlen (qc->preedit_str) > 0)
|
||||||
{
|
{
|
||||||
g_signal_emit_by_name (context, "commit", qc->preedit_str);
|
g_signal_emit_by_name (context, "commit", qc->preedit_str);
|
||||||
|
Loading…
Reference in New Issue
Block a user