mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r26023) -Fix [FS#5805] (r25686): [OSX] Checking for a valid NSTextInputContext is supposed to fail on 10.4 according to docs, but somehow didn't, leading to a crash when an edit box lost focus.
This commit is contained in:
parent
89a4455dbc
commit
2708aff853
@ -573,7 +573,7 @@ bool VideoDriver_Cocoa::AfterBlitterChange()
|
|||||||
void VideoDriver_Cocoa::EditBoxLostFocus()
|
void VideoDriver_Cocoa::EditBoxLostFocus()
|
||||||
{
|
{
|
||||||
if (_cocoa_subdriver != NULL) {
|
if (_cocoa_subdriver != NULL) {
|
||||||
if ([ _cocoa_subdriver->cocoaview respondsToSelector:@selector(inputContext) ]) {
|
if ([ _cocoa_subdriver->cocoaview respondsToSelector:@selector(inputContext) ] && [ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] respondsToSelector:@selector(discardMarkedText) ]) {
|
||||||
[ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] performSelector:@selector(discardMarkedText) ];
|
[ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] performSelector:@selector(discardMarkedText) ];
|
||||||
} else {
|
} else {
|
||||||
[ [ NSInputManager currentInputManager ] markedTextAbandoned:_cocoa_subdriver->cocoaview ];
|
[ [ NSInputManager currentInputManager ] markedTextAbandoned:_cocoa_subdriver->cocoaview ];
|
||||||
|
Loading…
Reference in New Issue
Block a user