diff options
author | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-08-25 04:28:20 +0000 |
---|---|---|
committer | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-08-25 04:28:20 +0000 |
commit | ad5c7d5bb1bf83d7f339704512e43035fa61d560 (patch) | |
tree | 632912c6a73ab31d4f95235f61a3f2119dcf15b8 /input | |
parent | 37babdb3a1e78ead92bf25632c7af180c95976ad (diff) | |
download | mpv-ad5c7d5bb1bf83d7f339704512e43035fa61d560.tar.bz2 mpv-ad5c7d5bb1bf83d7f339704512e43035fa61d560.tar.xz |
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.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24154 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c index f37da37088..84a2ae6661 100644 --- a/input/input.c +++ b/input/input.c @@ -1173,6 +1173,8 @@ static mp_cmd_t *read_events(int time, int paused) 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 @@ mp_input_get_cmd(int time, int paused, int peek_only) { 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; |