# HG changeset patch # User uau # Date 1188016100 0 # Node ID e18a800a02e784540c87b6f50f178b41a1116f4c # Parent d43cda21236d556951b612dca9ab4dbafb76fba9 Handle queued commands from input event functions immediately Check whether an event handler called mp_input_queue_cmd and return the command immediately if so. Currently x11_common.c creates commands from mouse position updates. diff -r d43cda21236d -r e18a800a02e7 input/input.c --- a/input/input.c Sat Aug 25 04:28:17 2007 +0000 +++ b/input/input.c Sat Aug 25 04:28:20 2007 +0000 @@ -1173,6 +1173,8 @@ int code; if (key_fds[i].no_readfunc_retval) { // getch2 handler special-cased for now ((void (*)(void))key_fds[i].read_func)(); + if (cmd_queue_length) + return NULL; code = mplayer_get_key(0); if (code < 0) code = MP_INPUT_NOTHING; @@ -1264,6 +1266,10 @@ if(ret) break; from_queue = 0; ret = read_events(time, paused); + if (!ret) { + from_queue = 1; + ret = mp_input_get_queued_cmd(peek_only); + } break; } if(!ret) return NULL;