[Spice-commits] inputs.js

Jeremy White jwhite at kemper.freedesktop.org
Wed Sep 26 08:23:19 PDT 2012


 inputs.js |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 2e5ef9b93de8e769f3050171161b2e18dcb294e2
Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Sep 26 10:01:31 2012 -0500

    Discard input messages until input channel is ready
    
    Signed-off-by: Aric Stewart <aric at codeweavers.com>

diff --git a/inputs.js b/inputs.js
index 57ee626..4d3b28f 100644
--- a/inputs.js
+++ b/inputs.js
@@ -86,7 +86,7 @@ function handle_mousemove(e)
         move = new SpiceMsgcMouseMotion(this.sc, e)
         msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_MOTION, move);
     }
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
     {
         if (this.sc.inputs.waiting_for_ack < (2 * SPICE_INPUT_MOTION_ACK_BUNCH))
         {
@@ -105,7 +105,7 @@ function handle_mousedown(e)
     var press = new SpiceMsgcMousePress(this.sc, e)
     var msg = new SpiceMiniData();
     msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_PRESS, press);
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
         this.sc.inputs.send_msg(msg);
 
     e.preventDefault();
@@ -122,7 +122,7 @@ function handle_mouseup(e)
     var release = new SpiceMsgcMouseRelease(this.sc, e)
     var msg = new SpiceMiniData();
     msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_RELEASE, release);
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
         this.sc.inputs.send_msg(msg);
 
     e.preventDefault();
@@ -141,11 +141,11 @@ function handle_mousewheel(e)
 
     var msg = new SpiceMiniData();
     msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_PRESS, press);
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
         this.sc.inputs.send_msg(msg);
 
     msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_RELEASE, release);
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
         this.sc.inputs.send_msg(msg);
 
     e.preventDefault();
@@ -157,7 +157,7 @@ function handle_keydown(e)
     var msg = new SpiceMiniData();
     check_and_update_modifiers(e, key.code, this.sc);
     msg.build_msg(SPICE_MSGC_INPUTS_KEY_DOWN, key);
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
         this.sc.inputs.send_msg(msg);
 
     e.preventDefault();
@@ -169,7 +169,7 @@ function handle_keyup(e)
     var msg = new SpiceMiniData();
     check_and_update_modifiers(e, key.code, this.sc);
     msg.build_msg(SPICE_MSGC_INPUTS_KEY_UP, key);
-    if (this.sc && this.sc.inputs)
+    if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
         this.sc.inputs.send_msg(msg);
 
     e.preventDefault();
@@ -221,7 +221,7 @@ function check_and_update_modifiers(e, code, sc)
     else if (code === (0x80|0xE0B5))
         Meta_state = false;
 
-    if (sc && sc.inputs)
+    if (sc && sc.inputs && sc.inputs.state === "ready")
     {
         if (Shift_state != e.shiftKey)
         {


More information about the Spice-commits mailing list