From 2dd904289dcaf7b11b30ec362288f9af90531879 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 26 May 2015 22:39:04 +0200 Subject: osx: never expose input_ctx from EventsResponder Keep it internal, so we can synchronize access to it properly. --- osdep/macosx_application.m | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'osdep/macosx_application.m') diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 595c47e3c6..6e91809464 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -77,8 +77,7 @@ static void terminate_cocoa_application(void) { [super sendEvent:event]; - if (_eventsResponder.inputContext) - mp_input_wakeup(_eventsResponder.inputContext); + [_eventsResponder wakeup]; } - (id)init @@ -167,16 +166,10 @@ static void terminate_cocoa_application(void) - (void)stopMPV:(char *)cmd { - struct input_ctx *inputContext = _eventsResponder.inputContext; - if (inputContext) { - mp_cmd_t *cmdt = mp_input_parse_cmd(inputContext, bstr0(cmd), ""); - mp_input_queue_cmd(inputContext, cmdt); - } else { + if (![_eventsResponder queueCommand:cmd]) terminate_cocoa_application(); - } } - - (void)registerMenuItem:(NSMenuItem*)menuItem forKey:(MPMenuKey)key { [self.menuItems setObject:menuItem forKey:[NSNumber numberWithInt:key]]; -- cgit v1.2.3