server: Send WM_WINE_CLIPCURSOR message only when necessary.
This commit is contained in:
parent
f1dca8914c
commit
1604d8a202
2 changed files with 8 additions and 2 deletions
|
@ -527,6 +527,7 @@ static void get_message_defaults( struct msg_queue *queue, int *x, int *y, unsig
|
|||
void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, unsigned int flags, int reset )
|
||||
{
|
||||
rectangle_t top_rect;
|
||||
unsigned int old_flags;
|
||||
int x, y;
|
||||
|
||||
get_top_window_rectangle( desktop, &top_rect );
|
||||
|
@ -542,6 +543,9 @@ void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, unsig
|
|||
}
|
||||
else desktop->cursor.clip = top_rect;
|
||||
|
||||
old_flags = desktop->cursor.clip_flags;
|
||||
desktop->cursor.clip_flags = flags;
|
||||
|
||||
/* warp the mouse to be inside the clip rect */
|
||||
x = max( min( desktop->cursor.x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left );
|
||||
y = max( min( desktop->cursor.y, desktop->cursor.clip.bottom - 1 ), desktop->cursor.clip.top );
|
||||
|
@ -550,8 +554,9 @@ void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, unsig
|
|||
/* request clip cursor rectangle reset to the desktop thread */
|
||||
if (reset) post_desktop_message( desktop, WM_WINE_CLIPCURSOR, flags, FALSE );
|
||||
|
||||
/* notify foreground thread, of reset, or to apply new cursor clipping rect */
|
||||
queue_cursor_message( desktop, 0, WM_WINE_CLIPCURSOR, flags, reset );
|
||||
/* notify foreground thread of reset, clipped, or released cursor rect */
|
||||
if (reset || flags != SET_CURSOR_NOCLIP || old_flags != SET_CURSOR_NOCLIP)
|
||||
queue_cursor_message( desktop, 0, WM_WINE_CLIPCURSOR, flags, reset );
|
||||
}
|
||||
|
||||
/* change the foreground input and reset the cursor clip rect */
|
||||
|
|
|
@ -59,6 +59,7 @@ struct global_cursor
|
|||
int x; /* cursor position */
|
||||
int y;
|
||||
rectangle_t clip; /* cursor clip rectangle */
|
||||
unsigned int clip_flags; /* last cursor clip flags */
|
||||
unsigned int last_change; /* time of last position change */
|
||||
user_handle_t win; /* window that contains the cursor */
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue