summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2013-11-17 12:05:40 +0000
committermichi_cc <michi_cc@openttd.org>2013-11-17 12:05:40 +0000
commit2708aff85370fab3cb64a9f2eea17bac3e9e65a5 (patch)
treefff834b4f1028ed73522dee98ed9ac48a85190fb
parent89a4455dbc32ae79841e78c476af96f18f35feb1 (diff)
downloadopenttd-2708aff85370fab3cb64a9f2eea17bac3e9e65a5.tar.xz
(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.
-rw-r--r--src/video/cocoa/cocoa_v.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index a9f3981d1..df2e7809c 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -573,7 +573,7 @@ bool VideoDriver_Cocoa::AfterBlitterChange()
void VideoDriver_Cocoa::EditBoxLostFocus()
{
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) ];
} else {
[ [ NSInputManager currentInputManager ] markedTextAbandoned:_cocoa_subdriver->cocoaview ];