[Spice-commits] 2 commits - server/cursor-channel.c server/cursor-channel.h server/red-worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Thu May 26 09:27:44 UTC 2016
server/cursor-channel.c | 33 +++++++++++++++++++++++++++++----
server/cursor-channel.h | 10 +++++-----
server/red-worker.c | 32 ++++----------------------------
3 files changed, 38 insertions(+), 37 deletions(-)
New commits:
commit 6ad393d82b9e8b80310fc9c83f0a363f5785c36f
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu May 12 12:56:04 2016 +0100
Make cursor_channel_client_new static
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index df36a43..c9e9657 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -373,10 +373,12 @@ void cursor_channel_client_migrate(CursorChannelClient* client)
red_channel_client_default_migrate(rcc);
}
-CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor, RedClient *client, RedsStream *stream,
- int mig_target,
- uint32_t *common_caps, int num_common_caps,
- uint32_t *caps, int num_caps)
+static CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor,
+ RedClient *client,
+ RedsStream *stream,
+ int mig_target,
+ uint32_t *common_caps, int num_common_caps,
+ uint32_t *caps, int num_caps)
{
spice_return_val_if_fail(cursor, NULL);
spice_return_val_if_fail(client, NULL);
diff --git a/server/cursor-channel.h b/server/cursor-channel.h
index ecb20a4..6bba822 100644
--- a/server/cursor-channel.h
+++ b/server/cursor-channel.h
@@ -40,11 +40,6 @@ void cursor_channel_connect (CursorChannel *cursor, RedClien
uint32_t *common_caps, int num_common_caps,
uint32_t *caps, int num_caps);
-CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor,
- RedClient *client, RedsStream *stream,
- int mig_target,
- uint32_t *common_caps, int num_common_caps,
- uint32_t *caps, int num_caps);
void cursor_channel_client_migrate(CursorChannelClient* client);
#endif /* CURSOR_CHANNEL_H_ */
commit c0a8b6982218b96b5bb637711e5903bb7ca03bc0
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu May 12 12:52:33 2016 +0100
Move cursor_connect to CursorChannel
This function was handling mainly CursorChannel state
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index ab6864c..df36a43 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -492,3 +492,26 @@ void cursor_channel_set_mouse_mode(CursorChannel *cursor, uint32_t mode)
cursor->mouse_mode = mode;
}
+
+void cursor_channel_connect(CursorChannel *cursor, RedClient *client, RedsStream *stream,
+ int migrate,
+ uint32_t *common_caps, int num_common_caps,
+ uint32_t *caps, int num_caps)
+{
+ CursorChannelClient *ccc;
+
+ spice_return_if_fail(cursor != NULL);
+
+ spice_info("add cursor channel client");
+ ccc = cursor_channel_client_new(cursor, client, stream,
+ migrate,
+ common_caps, num_common_caps,
+ caps, num_caps);
+ spice_return_if_fail(ccc != NULL);
+
+ RedChannelClient *rcc = RED_CHANNEL_CLIENT(ccc);
+ red_channel_client_ack_zero_messages_window(rcc);
+ red_channel_client_push_set_ack(rcc);
+
+ cursor_channel_init(cursor, ccc);
+}
diff --git a/server/cursor-channel.h b/server/cursor-channel.h
index 4dad4b6..ecb20a4 100644
--- a/server/cursor-channel.h
+++ b/server/cursor-channel.h
@@ -34,6 +34,11 @@ void cursor_channel_reset (CursorChannel *cursor);
void cursor_channel_init (CursorChannel *cursor, CursorChannelClient* client);
void cursor_channel_process_cmd (CursorChannel *cursor, RedCursorCmd *cursor_cmd);
void cursor_channel_set_mouse_mode(CursorChannel *cursor, uint32_t mode);
+void cursor_channel_connect (CursorChannel *cursor, RedClient *client,
+ RedsStream *stream,
+ int migrate,
+ uint32_t *common_caps, int num_common_caps,
+ uint32_t *caps, int num_caps);
CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor,
RedClient *client, RedsStream *stream,
diff --git a/server/red-worker.c b/server/red-worker.c
index 0c945c1..b7e40f5 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -544,30 +544,6 @@ static void guest_set_client_capabilities(RedWorker *worker)
}
}
-static void cursor_connect(RedWorker *worker, RedClient *client, RedsStream *stream,
- int migrate,
- uint32_t *common_caps, int num_common_caps,
- uint32_t *caps, int num_caps)
-{
- CursorChannel *channel = worker->cursor_channel;
- CursorChannelClient *ccc;
-
- spice_return_if_fail(channel != NULL);
-
- spice_info("add cursor channel client");
- ccc = cursor_channel_client_new(channel, client, stream,
- migrate,
- common_caps, num_common_caps,
- caps, num_caps);
- spice_return_if_fail(ccc != NULL);
-
- RedChannelClient *rcc = RED_CHANNEL_CLIENT(ccc);
- red_channel_client_ack_zero_messages_window(rcc);
- red_channel_client_push_set_ack(rcc);
-
- cursor_channel_init(channel, ccc);
-}
-
static void handle_dev_update_async(void *opaque, void *payload)
{
RedWorker *worker = opaque;
@@ -1000,10 +976,10 @@ static void handle_dev_cursor_connect(void *opaque, void *payload)
RedWorker *worker = opaque;
spice_info("cursor connect");
- cursor_connect(worker,
- msg->client, msg->stream, msg->migration,
- msg->common_caps, msg->num_common_caps,
- msg->caps, msg->num_caps);
+ cursor_channel_connect(worker->cursor_channel,
+ msg->client, msg->stream, msg->migration,
+ msg->common_caps, msg->num_common_caps,
+ msg->caps, msg->num_caps);
free(msg->caps);
free(msg->common_caps);
}
More information about the Spice-commits
mailing list