From 831a7cf3eea1015a76f4accba4f4d237a5336f7b Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 19 Jun 2013 18:19:45 +0200 Subject: input: trigger mouse_leave key bindings if mouse leaves mouse area Also, implement mouse leave events for X11. But evne on other platforms, these events will be generated if mouse crosses a section's mouse area boundaries within the mpv window. --- video/out/x11_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'video/out/x11_common.c') diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 9d2db30924..bbb6fca997 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -756,6 +756,9 @@ int vo_x11_check_events(struct vo *vo) case MotionNotify: vo_mouse_movement(vo, Event.xmotion.x, Event.xmotion.y); break; + case LeaveNotify: + mplayer_put_key(vo->key_fifo, MP_KEY_MOUSE_LEAVE); + break; case ButtonPress: mplayer_put_key(vo->key_fifo, (MP_MOUSE_BTN0 + Event.xbutton.button - 1) @@ -987,10 +990,10 @@ static void vo_x11_map_window(struct vo *vo, int x, int y, int w, int h) vo_x11_decoration(vo, 0); // map window vo_x11_selectinput_witherr(vo, x11->display, x11->window, - StructureNotifyMask | + StructureNotifyMask | ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | ExposureMask); + PointerMotionMask | LeaveWindowMask); XMapWindow(x11->display, x11->window); vo_x11_clearwindow(vo, x11->window); } -- cgit v1.2.3