diff options
Diffstat (limited to 'src/video/cocoa/cocoa_v.mm')
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 8e7b7824e..11ba8ab84 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -495,6 +495,20 @@ bool VideoDriver_Cocoa::AfterBlitterChange() } /** + * An edit box lost the input focus. Abort character compositing if necessary. + */ +void VideoDriver_Cocoa::EditBoxLostFocus() +{ + if (_cocoa_subdriver != NULL) { + if ([ _cocoa_subdriver->cocoaview respondsToSelector:@selector(inputContext) ]) { + [ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] performSelector:@selector(discardMarkedText) ]; + } else { + [ [ NSInputManager currentInputManager ] markedTextAbandoned:_cocoa_subdriver->cocoaview ]; + } + } +} + +/** * Catch asserts prior to initialization of the videodriver. * * @param title Window title. |