1
0
Fork 0

(svn r25686) -Codechange: [OSX] Abandon IME input if the edit box lost the focus.

release/1.4
michi_cc 2013-08-05 20:37:33 +00:00
parent de097dd989
commit e4d48f3a3b
2 changed files with 19 additions and 0 deletions

View File

@ -50,6 +50,11 @@ public:
*/
/* virtual */ bool AfterBlitterChange();
/**
* An edit box lost the input focus. Abort character compositing if necessary.
*/
/* virtual */ void EditBoxLostFocus();
/** Return driver name
* @return driver name
*/

View File

@ -494,6 +494,20 @@ bool VideoDriver_Cocoa::AfterBlitterChange()
return this->ChangeResolution(_screen.width, _screen.height);
}
/**
* 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.
*