summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_common.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-17 19:15:17 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-17 19:19:45 +0200
commiteb902efb0450b0080688fd210951049579d316b6 (patch)
treeec589a437eb64566cc23356feff39c0224b8db5a /video/out/cocoa_common.m
parent49b6fa877938e9f53ca905467975ef580d3a4ab2 (diff)
downloadmpv-eb902efb0450b0080688fd210951049579d316b6.tar.bz2
mpv-eb902efb0450b0080688fd210951049579d316b6.tar.xz
cocoa: allow mouse events to bubble up with no-input-cursor
Previously we didn't report events to the core, but still prevented the events to travel on the responder chain.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r--video/out/cocoa_common.m23
1 files changed, 13 insertions, 10 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 655c740169..0b1acdcce7 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -693,6 +693,14 @@ void *vo_cocoa_cgl_pixel_format(struct vo *vo)
vo_cocoa_set_current_context(self.vout, false);
}
+- (BOOL)keyboardEnabled {
+ return !!mp_input_vo_keyboard_enabled(self.vout->input_ctx);
+}
+
+- (BOOL)mouseEnabled {
+ return !!mp_input_mouse_enabled(self.vout->input_ctx);
+}
+
- (void)setNeedsResize {
struct vo_cocoa_state *s = self.vout->cocoa;
s->pending_events |= VO_EVENT_RESIZE;
@@ -710,28 +718,23 @@ void *vo_cocoa_cgl_pixel_format(struct vo *vo)
}
- (void)signalMouseMovement:(NSPoint)point {
- if (mp_input_mouse_enabled(self.vout->input_ctx)) {
- mp_input_set_mouse_pos(self.vout->input_ctx, point.x, point.y);
- [self recalcMovableByWindowBackground:point];
- }
+ mp_input_set_mouse_pos(self.vout->input_ctx, point.x, point.y);
+ [self recalcMovableByWindowBackground:point];
}
- (void)putKeyEvent:(NSEvent*)event
{
- if (mp_input_vo_keyboard_enabled(self.vout->input_ctx))
- cocoa_put_key_event(event);
+ cocoa_put_key_event(event);
}
- (void)putKey:(int)mpkey withModifiers:(int)modifiers
{
- if (mp_input_vo_keyboard_enabled(self.vout->input_ctx))
- cocoa_put_key_with_modifiers(mpkey, modifiers);
+ cocoa_put_key_with_modifiers(mpkey, modifiers);
}
- (void)putAxis:(int)mpkey delta:(float)delta;
{
- if (mp_input_mouse_enabled(self.vout->input_ctx))
- mp_input_put_axis(self.vout->input_ctx, mpkey, delta);
+ mp_input_put_axis(self.vout->input_ctx, mpkey, delta);
}
- (void)putCommand:(char*)cmd