summaryrefslogtreecommitdiffstats
path: root/osdep/macosx_application.m
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-26 22:39:04 +0200
committerwm4 <wm4@nowhere>2015-05-26 22:39:04 +0200
commit2dd904289dcaf7b11b30ec362288f9af90531879 (patch)
treea024ffe4631bd5c3b8ad8cdbbda675d045902128 /osdep/macosx_application.m
parent39a339c813ee3bb7f8e1f65dcf325e7f0db110a2 (diff)
downloadmpv-2dd904289dcaf7b11b30ec362288f9af90531879.tar.bz2
mpv-2dd904289dcaf7b11b30ec362288f9af90531879.tar.xz
osx: never expose input_ctx from EventsResponder
Keep it internal, so we can synchronize access to it properly.
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r--osdep/macosx_application.m11
1 files changed, 2 insertions, 9 deletions
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]];