From 26c6386de90b93503231dcf44dc4efee28bbd736 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Bernon?= Date: Mon, 25 Jan 2021 15:05:19 +0100 Subject: [PATCH] server: Move set_cursor desktop local variable to wider scope. --- server/queue.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/server/queue.c b/server/queue.c index 586f0c99696..22842ff286f 100644 --- a/server/queue.c +++ b/server/queue.c @@ -3264,14 +3264,16 @@ DECL_HANDLER(set_cursor) { struct msg_queue *queue = get_current_queue(); struct thread_input *input; + struct desktop *desktop; if (!queue) return; input = queue->input; + desktop = input->desktop; reply->prev_handle = input->cursor; reply->prev_count = input->cursor_count; - reply->prev_x = input->desktop->cursor.x; - reply->prev_y = input->desktop->cursor.y; + reply->prev_x = desktop->cursor.x; + reply->prev_y = desktop->cursor.y; if (req->flags & SET_CURSOR_HANDLE) { @@ -3287,20 +3289,14 @@ DECL_HANDLER(set_cursor) queue->cursor_count += req->show_count; input->cursor_count += req->show_count; } - if (req->flags & SET_CURSOR_POS) - { - set_cursor_pos( input->desktop, req->x, req->y ); - } - if (req->flags & (SET_CURSOR_CLIP | SET_CURSOR_NOCLIP)) - { - struct desktop *desktop = input->desktop; - set_clip_rectangle( desktop, (req->flags & SET_CURSOR_NOCLIP) ? NULL : &req->clip, 0 ); - } + if (req->flags & SET_CURSOR_POS) set_cursor_pos( desktop, req->x, req->y ); + if (req->flags & SET_CURSOR_CLIP) set_clip_rectangle( desktop, &req->clip, 0 ); + if (req->flags & SET_CURSOR_NOCLIP) set_clip_rectangle( desktop, NULL, 0 ); - reply->new_x = input->desktop->cursor.x; - reply->new_y = input->desktop->cursor.y; - reply->new_clip = input->desktop->cursor.clip; - reply->last_change = input->desktop->cursor.last_change; + reply->new_x = desktop->cursor.x; + reply->new_y = desktop->cursor.y; + reply->new_clip = desktop->cursor.clip; + reply->last_change = desktop->cursor.last_change; } /* Get the history of the 64 last cursor positions */ -- 2.11.4.GIT