From 4f610adfc29a2aa2f1159ded016ca4f8960c52e9 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 14 Dec 2010 21:58:47 +0200 Subject: libvo: register X11 connection fd in input event system Register the X11 connection fd in the input system so that mp_input_get_cmd() can immediately wake up and handle keyboard or other X events. The callback calls vo_check_events() and tells the input system to handle any input possibly recorded during that. Before this was done for vo_xv only; this commit generalizes it to all VOs that call vo_x11_create_vo_window() - those are hopefully ones that will handle all X events in check_events(). The callback is only kept registered while the vo is properly configured. At other times calling check_events() would not clear pending input and so could lead to a busy loop. --- libvo/x11_common.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libvo/x11_common.c') diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 655b1c69d0..b7fbb72307 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1123,6 +1123,7 @@ final: x11->vo_gc = XCreateGC(mDisplay, x11->window, GCForeground, &xgcv); XSync(mDisplay, False); x11->vo_mouse_autohide = 1; + vo->event_fd = ConnectionNumber(x11->display); } void vo_x11_clearwindow_part(struct vo *vo, Window vo_window, -- cgit v1.2.3