mirror of
https://github.com/mpv-player/mpv
synced 2025-03-18 17:40:30 +00:00
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
This commit is contained in:
parent
37babdb3a1
commit
ad5c7d5bb1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user