[Spice-commits] server/cursor-channel.c server/red_worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Fri Oct 30 10:56:37 PDT 2015
server/cursor-channel.c | 35 ++++++++++++++++++++---------------
server/red_worker.c | 7 +++++--
2 files changed, 25 insertions(+), 17 deletions(-)
New commits:
commit 0eedafaf0c83c87a14485f6ee42f23338ed73e00
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Fri Oct 30 12:09:35 2015 -0500
Various minor style changes to worker and cursor channel
Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index e8d0057..eef0121 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -228,17 +228,17 @@ static void red_marshall_cursor_init(RedChannelClient *rcc, SpiceMarshaller *bas
}
static void cursor_marshall(RedChannelClient *rcc,
- SpiceMarshaller *m, CursorPipeItem *cursor_pipe_item)
+ SpiceMarshaller *m, CursorPipeItem *cursor_pipe_item)
{
CursorChannel *cursor_channel = SPICE_CONTAINEROF(rcc->channel, CursorChannel, common.base);
CursorChannelClient *ccc = RCC_TO_CCC(rcc);
- CursorItem *cursor = cursor_pipe_item->cursor_item;
+ CursorItem *item = cursor_pipe_item->cursor_item;
PipeItem *pipe_item = &cursor_pipe_item->base;
RedCursorCmd *cmd;
spice_assert(cursor_channel);
- cmd = cursor->red_cursor;
+ cmd = item->red_cursor;
switch (cmd->type) {
case QXL_CURSOR_MOVE:
{
@@ -257,7 +257,7 @@ static void cursor_marshall(RedChannelClient *rcc,
cursor_set.position = cmd->u.set.position;
cursor_set.visible = cursor_channel->cursor_visible;
- cursor_fill(ccc, &cursor_set.cursor, cursor, &info);
+ cursor_fill(ccc, &cursor_set.cursor, item, &info);
spice_marshall_msg_cursor_set(m, &cursor_set);
add_buf_from_info(m, &info);
break;
@@ -281,7 +281,7 @@ static void cursor_marshall(RedChannelClient *rcc,
}
static inline void red_marshall_inval(RedChannelClient *rcc,
- SpiceMarshaller *base_marshaller, CacheItem *cach_item)
+ SpiceMarshaller *base_marshaller, CacheItem *cach_item)
{
SpiceMsgDisplayInvalOne inval_one;
@@ -427,31 +427,36 @@ void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd,
spice_error("invalid cursor command %u", cursor_cmd->type);
}
- if (red_channel_is_connected(&cursor->common.base) && (cursor->mouse_mode == SPICE_MOUSE_MODE_SERVER ||
- cursor_cmd->type != QXL_CURSOR_MOVE || cursor_show)) {
- red_channel_pipes_new_add(&cursor->common.base, new_cursor_pipe_item,
- (void*)cursor_item);
+ if (red_channel_is_connected(&cursor->common.base) &&
+ (cursor->mouse_mode == SPICE_MOUSE_MODE_SERVER
+ || cursor_cmd->type != QXL_CURSOR_MOVE
+ || cursor_show)) {
+ red_channel_pipes_new_add(&cursor->common.base,
+ new_cursor_pipe_item, cursor_item);
}
cursor_item_unref(red_worker_get_qxl(cursor->common.worker), cursor_item);
}
void cursor_channel_reset(CursorChannel *cursor)
{
+ RedChannel *channel = &cursor->common.base;
+
+ spice_return_if_fail(cursor);
+
cursor_set_item(cursor, NULL);
cursor->cursor_visible = TRUE;
cursor->cursor_position.x = cursor->cursor_position.y = 0;
cursor->cursor_trail_length = cursor->cursor_trail_frequency = 0;
- if (red_channel_is_connected(&cursor->common.base)) {
- red_channel_pipes_add_type(&cursor->common.base,
- PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE);
+ if (red_channel_is_connected(channel)) {
+ red_channel_pipes_add_type(channel, PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE);
if (!cursor->common.during_target_migrate) {
- red_pipes_add_verb(&cursor->common.base, SPICE_MSG_CURSOR_RESET);
+ red_pipes_add_verb(channel, SPICE_MSG_CURSOR_RESET);
}
if (!red_channel_wait_all_sent(&cursor->common.base,
DISPLAY_CLIENT_TIMEOUT)) {
- red_channel_apply_clients(&cursor->common.base,
- red_channel_client_disconnect_if_pending_send);
+ red_channel_apply_clients(channel,
+ red_channel_client_disconnect_if_pending_send);
}
}
}
diff --git a/server/red_worker.c b/server/red_worker.c
index 3b50c3d..fb1d69e 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10196,7 +10196,8 @@ static void dev_create_primary_surface(RedWorker *worker, uint32_t surface_id,
red_channel_push(&worker->display_channel->common.base);
}
- if (cursor_is_connected(worker) && !worker->cursor_channel->common.during_target_migrate) {
+ if (cursor_is_connected(worker)
+ && !worker->cursor_channel->common.during_target_migrate) {
red_channel_pipes_add_type(&worker->cursor_channel->common.base,
PIPE_ITEM_TYPE_CURSOR_INIT);
}
@@ -10398,7 +10399,9 @@ void handle_dev_oom(void *opaque, void *payload)
void handle_dev_reset_cursor(void *opaque, void *payload)
{
- cursor_channel_reset(((RedWorker*)opaque)->cursor_channel);
+ RedWorker *worker = opaque;
+
+ cursor_channel_reset(worker->cursor_channel);
}
void handle_dev_reset_image_cache(void *opaque, void *payload)
More information about the Spice-commits
mailing list