From: Rémi Bernon rbernon@codeweavers.com
Based on a patch by Huw Davies huw@codeweavers.com. --- server/queue.c | 12 ++++++------ server/user.h | 9 ++------- server/winstation.c | 3 ++- 3 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/server/queue.c b/server/queue.c index e06f6afe0f7..1a98714004c 100644 --- a/server/queue.c +++ b/server/queue.c @@ -440,7 +440,7 @@ static struct thread_input *get_desktop_cursor_thread_input( struct desktop *des struct thread_input *input = NULL; struct thread *thread;
- if ((thread = get_window_thread( desktop->cursor.win ))) + if ((thread = get_window_thread( desktop->cursor_win ))) { if (thread->queue) input = thread->queue->input; release_object( thread ); @@ -451,9 +451,9 @@ static struct thread_input *get_desktop_cursor_thread_input( struct desktop *des
static int update_desktop_cursor_window( struct desktop *desktop, user_handle_t win ) { - int updated = win != desktop->cursor.win; + int updated = win != desktop->cursor_win; struct thread_input *input; - desktop->cursor.win = win; + desktop->cursor_win = win;
if (updated && (input = get_desktop_cursor_thread_input( desktop ))) { @@ -495,7 +495,7 @@ static void update_desktop_cursor_handle( struct desktop *desktop, struct thread { if (input == get_desktop_cursor_thread_input( desktop )) { - user_handle_t win = desktop->cursor.win; + user_handle_t win = desktop->cursor_win; /* when clipping send the message to the foreground window as well, as some driver have an artificial overlay window */ if (is_cursor_clipped( desktop )) queue_cursor_message( desktop, 0, WM_WINE_SETCURSOR, win, handle ); queue_cursor_message( desktop, win, WM_WINE_SETCURSOR, win, handle ); @@ -560,8 +560,8 @@ void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, unsig } SHARED_WRITE_END;
- old_flags = desktop->cursor.clip_flags; - desktop->cursor.clip_flags = flags; + old_flags = desktop->clip_flags; + desktop->clip_flags = flags;
/* warp the mouse to be inside the clip rect */ x = max( min( desktop_shm->cursor.x, new_rect.right - 1 ), new_rect.left ); diff --git a/server/user.h b/server/user.h index 7ad1e82ae54..7355177e13d 100644 --- a/server/user.h +++ b/server/user.h @@ -54,12 +54,6 @@ struct winstation struct namespace *desktop_names; /* namespace for desktops of this winstation */ };
-struct global_cursor -{ - unsigned int clip_flags; /* last cursor clip flags */ - user_handle_t win; /* window that contains the cursor */ -}; - struct key_repeat { int enable; /* enable auto-repeat */ @@ -86,9 +80,10 @@ struct desktop struct timeout_user *close_timeout; /* timeout before closing the desktop */ struct thread_input *foreground_input; /* thread input of foreground thread */ unsigned int users; /* processes and threads using this desktop */ - struct global_cursor cursor; /* global cursor information */ unsigned char keystate[256]; /* asynchronous key state */ struct key_repeat key_repeat; /* key auto-repeat */ + unsigned int clip_flags; /* last cursor clip flags */ + user_handle_t cursor_win; /* window that contains the cursor */ const desktop_shm_t *shared; /* desktop session shared memory */ };
diff --git a/server/winstation.c b/server/winstation.c index 3e08f4b3337..300d899638b 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -292,7 +292,8 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned desktop->foreground_input = NULL; desktop->users = 0; list_init( &desktop->threads ); - memset( &desktop->cursor, 0, sizeof(desktop->cursor) ); + desktop->clip_flags = 0; + desktop->cursor_win = 0; memset( desktop->keystate, 0, sizeof(desktop->keystate) ); memset( &desktop->key_repeat, 0, sizeof(desktop->key_repeat) ); list_add_tail( &winstation->desktops, &desktop->entry );