[Spice-devel] [PATCH spice-server] inputs-channel: Remove reds argument from inputs_channel_set_tablet

Frediano Ziglio fziglio at redhat.com
Thu Nov 23 14:46:55 UTC 2017


All other inputs_channel_set_* functions does not have this
parameter and get from the channel.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/inputs-channel.c | 4 ++--
 server/inputs-channel.h | 2 +-
 server/reds.c           | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index b4292f0e..ac598424 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -633,7 +633,7 @@ static SpiceTabletInstance* inputs_channel_get_tablet(InputsChannel *inputs)
     return inputs->tablet;
 }
 
-int inputs_channel_set_tablet(InputsChannel *inputs, SpiceTabletInstance *tablet, RedsState *reds)
+int inputs_channel_set_tablet(InputsChannel *inputs, SpiceTabletInstance *tablet)
 {
     if (inputs->tablet) {
         spice_printerr("already have tablet");
@@ -641,7 +641,7 @@ int inputs_channel_set_tablet(InputsChannel *inputs, SpiceTabletInstance *tablet
     }
     inputs->tablet = tablet;
     inputs->tablet->st = spice_tablet_state_new();
-    inputs->tablet->st->reds = reds;
+    inputs->tablet->st->reds = red_channel_get_server(RED_CHANNEL(inputs));
     return 0;
 }
 
diff --git a/server/inputs-channel.h b/server/inputs-channel.h
index 27d81a87..1082d66c 100644
--- a/server/inputs-channel.h
+++ b/server/inputs-channel.h
@@ -52,7 +52,7 @@ void inputs_channel_set_tablet_logical_size(InputsChannel *inputs, int x_res, in
 
 int inputs_channel_set_keyboard(InputsChannel *inputs, SpiceKbdInstance *keyboard);
 int inputs_channel_set_mouse(InputsChannel *inputs, SpiceMouseInstance *mouse);
-int inputs_channel_set_tablet(InputsChannel *inputs, SpiceTabletInstance *tablet, RedsState *reds);
+int inputs_channel_set_tablet(InputsChannel *inputs, SpiceTabletInstance *tablet);
 int inputs_channel_has_tablet(InputsChannel *inputs);
 void inputs_channel_detach_tablet(InputsChannel *inputs, SpiceTabletInstance *tablet);
 RedsState* spice_tablet_state_get_server(SpiceTabletState *dev);
diff --git a/server/reds.c b/server/reds.c
index 26789959..64b3a967 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3331,7 +3331,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *reds,
             spice_warning("unsupported tablet interface");
             return -1;
         }
-        if (inputs_channel_set_tablet(reds->inputs_channel, tablet, reds) != 0) {
+        if (inputs_channel_set_tablet(reds->inputs_channel, tablet) != 0) {
             return -1;
         }
         reds_update_mouse_mode(reds);
-- 
2.14.3



More information about the Spice-devel mailing list