[PATCH] user32: Only use the driver for getting the position
Max Qian
public at maxqia.com
Thu Aug 25 07:00:45 CDT 2016
This fixes bug 24951 and reverts GetCursorPos related
changes from commits 39c4e6d, f1a3480, and 6576703.
Signed-off-by: Max Qian <public at maxqia.com>
---
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 a52c001..b20e12f 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -5319,8 +5319,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
@@ -6318,6 +6316,6 @@ union generic_reply
struct terminate_job_reply terminate_job_reply;
};
-#define SERVER_PROTOCOL_VERSION 513
+#define SERVER_PROTOCOL_VERSION 514
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/protocol.def b/server/protocol.def
index 523f5bf..5f50335 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3682,7 +3682,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 f82060f..c765fab 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)
{
@@ -3116,7 +3114,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 c5236f5..49f4bca 100644
--- a/server/request.h
+++ b/server/request.h
@@ -2302,8 +2302,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 6c9518e..0ea3f13 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -4329,7 +4329,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
More information about the wine-patches
mailing list