From: Max Qian Subject: [PATCH 2/2] user32: Only use the driver for getting the position Message-Id: <20160827043508.2591-2-public@maxqia.com> Date: Fri, 26 Aug 2016 21:35:08 -0700 In-Reply-To: <20160827043508.2591-1-public@maxqia.com> References: <20160827043508.2591-1-public@maxqia.com> This fixes bug 24951 and reverts GetCursorPos related changes from commits 39c4e6d, f1a3480, and 6576703. Signed-off-by: Max Qian --- dlls/user32/input.c | 19 +------------------ include/wine/server_protocol.h | 4 +--- server/protocol.def | 1 - server/queue.c | 5 +---- server/request.h | 3 +-- server/trace.c | 1 - server/user.h | 1 - 7 files changed, 4 insertions(+), 30 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 63fae67..23bf509 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -238,25 +238,8 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, */ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt ) { - BOOL ret; - DWORD last_change; - if (!pt) return FALSE; - - SERVER_START_REQ( set_cursor ) - { - if ((ret = !wine_server_call( req ))) - { - pt->x = reply->new_x; - pt->y = reply->new_y; - last_change = reply->last_change; - } - } - SERVER_END_REQ; - - /* query new position from graphics driver if we haven't updated recently */ - if (ret && GetTickCount() - last_change > 100) ret = USER_Driver->pGetCursorPos( pt ); - return ret; + return USER_Driver->pGetCursorPos( pt ); } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index c1854b5..6ff5150 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -5315,8 +5315,6 @@ struct set_cursor_reply int new_x; int new_y; rectangle_t new_clip; - unsigned int last_change; - char __pad_52[4]; }; #define SET_CURSOR_HANDLE 0x01 #define SET_CURSOR_COUNT 0x02 @@ -6314,6 +6312,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 514 +#define SERVER_PROTOCOL_VERSION 515 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index 379a2b5..b2b89d0 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3678,7 +3678,6 @@ struct handle_info int new_x; /* new position */ int new_y; rectangle_t new_clip; /* new clip rectangle */ - unsigned int last_change; /* time of last position change */ @END #define SET_CURSOR_HANDLE 0x01 #define SET_CURSOR_COUNT 0x02 diff --git a/server/queue.c b/server/queue.c index d09a905..eab1863 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1494,7 +1494,6 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg if (desktop->cursor.x != x || desktop->cursor.y != y) always_queue = 1; desktop->cursor.x = x; desktop->cursor.y = y; - desktop->cursor.last_change = get_tick_count(); } if (desktop->keystate[VK_LBUTTON] & 0x80) msg->wparam |= MK_LBUTTON; if (desktop->keystate[VK_MBUTTON] & 0x80) msg->wparam |= MK_MBUTTON; @@ -1610,10 +1609,9 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons WM_MOUSEHWHEEL /* 0x1000 = MOUSEEVENTF_HWHEEL */ }; - desktop->cursor.last_change = get_tick_count(); flags = input->mouse.flags; time = input->mouse.time; - if (!time) time = desktop->cursor.last_change; + if (!time) time = get_tick_count(); if (flags & MOUSEEVENTF_MOVE) { @@ -3111,7 +3109,6 @@ DECL_HANDLER(set_cursor) 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; } DECL_HANDLER(update_rawinput_devices) diff --git a/server/request.h b/server/request.h index 71e7083..cf8a5f6 100644 --- a/server/request.h +++ b/server/request.h @@ -2298,8 +2298,7 @@ C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, prev_y) == 20 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_x) == 24 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_y) == 28 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_clip) == 32 ); -C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, last_change) == 48 ); -C_ASSERT( sizeof(struct set_cursor_reply) == 56 ); +C_ASSERT( sizeof(struct set_cursor_reply) == 48 ); C_ASSERT( sizeof(struct update_rawinput_devices_request) == 16 ); C_ASSERT( sizeof(struct get_suspend_context_request) == 16 ); C_ASSERT( sizeof(struct get_suspend_context_reply) == 8 ); diff --git a/server/trace.c b/server/trace.c index 4d56465..6e27db0 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4325,7 +4325,6 @@ static void dump_set_cursor_reply( const struct set_cursor_reply *req ) fprintf( stderr, ", new_x=%d", req->new_x ); fprintf( stderr, ", new_y=%d", req->new_y ); dump_rectangle( ", new_clip=", &req->new_clip ); - fprintf( stderr, ", last_change=%08x", req->last_change ); } static void dump_update_rawinput_devices_request( const struct update_rawinput_devices_request *req ) diff --git a/server/user.h b/server/user.h index 2f70674..4b0ab60 100644 --- a/server/user.h +++ b/server/user.h @@ -58,7 +58,6 @@ struct global_cursor int y; rectangle_t clip; /* cursor clip rectangle */ unsigned int clip_msg; /* message to post for cursor clip changes */ - unsigned int last_change; /* time of last position change */ user_handle_t win; /* window that contains the cursor */ }; -- 2.9.3