[Spice-commits] server/reds.c

Jonathon Jongsma jjongsma at kemper.freedesktop.org
Thu Jun 2 21:07:26 UTC 2016


 server/reds.c |   23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

New commits:
commit 3037b078f511fc585014b30533c35b9963b3e737
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date:   Thu Jun 2 10:47:58 2016 -0500

    Remove global "allowed" variable
    
    This variable was always the same value as
    dispatcher_allows_client_mouse.
    
    Acked-by: Frediano Ziglio <fziglio at redhat.com>
    Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 914d70d..4fd1d35 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1855,17 +1855,6 @@ static void reds_handle_main_link(RedsState *reds, RedLinkInfo *link)
      ((state & SPICE_MOUSE_BUTTON_MASK_MIDDLE) ? VD_AGENT_MBUTTON_MASK : 0) |    \
      ((state & SPICE_MOUSE_BUTTON_MASK_RIGHT) ? VD_AGENT_RBUTTON_MASK : 0))
 
-static void reds_set_client_mouse_allowed(RedsState *reds, int is_client_mouse_allowed, int x_res, int y_res)
-{
-    reds->monitor_mode.x_res = x_res;
-    reds->monitor_mode.y_res = y_res;
-    reds->dispatcher_allows_client_mouse = is_client_mouse_allowed;
-    reds_update_mouse_mode(reds);
-    if (reds->is_client_mouse_allowed && inputs_channel_has_tablet(reds->inputs_channel)) {
-        inputs_channel_set_tablet_logical_size(reds->inputs_channel, reds->monitor_mode.x_res, reds->monitor_mode.y_res);
-    }
-}
-
 static void openssl_init(RedLinkInfo *link)
 {
     unsigned long f4 = RSA_F4;
@@ -4185,7 +4174,6 @@ void reds_core_timer_remove(RedsState *reds,
 
 void reds_update_client_mouse_allowed(RedsState *reds)
 {
-    static int allowed = FALSE;
     int allow_now = FALSE;
     int x_res = 0;
     int y_res = 0;
@@ -4203,9 +4191,14 @@ void reds_update_client_mouse_allowed(RedsState *reds)
         }
     }
 
-    if (allow_now || allow_now != allowed) {
-        allowed = allow_now;
-        reds_set_client_mouse_allowed(reds, allowed, x_res, y_res);
+    if (allow_now || allow_now != reds->dispatcher_allows_client_mouse) {
+        reds->monitor_mode.x_res = x_res;
+        reds->monitor_mode.y_res = y_res;
+        reds->dispatcher_allows_client_mouse = allow_now;
+        reds_update_mouse_mode(reds);
+        if (reds->is_client_mouse_allowed && inputs_channel_has_tablet(reds->inputs_channel)) {
+            inputs_channel_set_tablet_logical_size(reds->inputs_channel, reds->monitor_mode.x_res, reds->monitor_mode.y_res);
+        }
     }
 }
 


More information about the Spice-commits mailing list