summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-19 18:19:45 +0200
committerwm4 <wm4@nowhere>2013-06-29 22:58:13 +0200
commit831a7cf3eea1015a76f4accba4f4d237a5336f7b (patch)
tree2f7206e2243936b7e030a81c80e99042575199b3 /video
parentfc422f5aebbfe6dd2ea12b92fe9b13ba5fd65041 (diff)
downloadmpv-831a7cf3eea1015a76f4accba4f4d237a5336f7b.tar.bz2
mpv-831a7cf3eea1015a76f4accba4f4d237a5336f7b.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c7
1 files changed, 5 insertions, 2 deletions
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);
}