changeset 24134:e18a800a02e7

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.
author uau
date Sat, 25 Aug 2007 04:28:20 +0000
parents d43cda21236d
children 84bc662dc979
files input/input.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;