Skip to content

Instantly share code, notes, and snippets.

@michicc
Created April 3, 2021 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michicc/1c6f8f0b5322c2cb8f0acc908d6b755a to your computer and use it in GitHub Desktop.
Save michicc/1c6f8f0b5322c2cb8f0acc908d6b755a to your computer and use it in GitHub Desktop.
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 9fb74cd04..9fecbf7ac 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -224,7 +224,7 @@
*/
void VideoDriver_Cocoa::EditBoxLostFocus()
{
- [ [ this->cocoaview inputContext ] discardMarkedText ];
+ [ [ this->cocoaview inputContext ] performSelectorOnMainThread:@selector(discardMarkedText) withObject:nil waitUntilDone:NO ];
/* Clear any marked string from the current edit box. */
HandleTextInput(nullptr, true);
}
@michicc
Copy link
Author

michicc commented Apr 3, 2021

Is is possible that waitUntilDone:YES is better, but as said, I can't test this myself in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment