Updated user32-rawinput-nolegacy patchset

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48433
This commit is contained in:
Alistair Leslie-Hughes
2020-01-10 08:20:14 +11:00
parent 89af635b94
commit ccd0bc4ccd
3 changed files with 93 additions and 15 deletions

View File

@@ -0,0 +1,76 @@
From a09689c9022603d7c7d41e6095a400fbf7841869 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 9 Jan 2020 17:50:32 +0100
Subject: [PATCH] server: Update desktop cursor pos even if RIDEV_NOLEGACY flag
is set.
---
server/queue.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/server/queue.c b/server/queue.c
index f5dc06100d1..4b2fef8a20a 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -421,6 +421,20 @@ static struct message *alloc_hardware_message( lparam_t info, struct hw_msg_sour
return msg;
}
+static int update_desktop_cursor_pos( struct desktop *desktop, int x, int y )
+{
+ int updated;
+
+ x = max( min( x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left );
+ y = max( min( y, desktop->cursor.clip.bottom - 1 ), desktop->cursor.clip.top );
+ updated = (desktop->cursor.x != x || desktop->cursor.y != y);
+ desktop->cursor.x = x;
+ desktop->cursor.y = y;
+ desktop->cursor.last_change = get_tick_count();
+
+ return updated;
+}
+
/* set the cursor position and queue the corresponding mouse message */
static void set_cursor_pos( struct desktop *desktop, int x, int y )
{
@@ -428,7 +442,11 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y )
struct message *msg;
if (current->process->rawinput_mouse &&
- current->process->rawinput_mouse->flags & RIDEV_NOLEGACY) return;
+ current->process->rawinput_mouse->flags & RIDEV_NOLEGACY)
+ {
+ update_desktop_cursor_pos( desktop, x, y );
+ return;
+ }
if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return;
@@ -1634,12 +1652,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg
{
if (msg->msg == WM_MOUSEMOVE)
{
- int x = max( min( msg->x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left );
- int y = max( min( msg->y, desktop->cursor.clip.bottom - 1 ), desktop->cursor.clip.top );
- 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 (update_desktop_cursor_pos( desktop, msg->x, msg->y )) always_queue = 1;
}
if (desktop->keystate[VK_LBUTTON] & 0x80) msg->wparam |= MK_LBUTTON;
if (desktop->keystate[VK_MBUTTON] & 0x80) msg->wparam |= MK_MBUTTON;
@@ -1871,7 +1884,10 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
if (!(req_flags & SEND_HWMSG_WINDOW))
return 0;
if ((device = current->process->rawinput_mouse) && (device->flags & RIDEV_NOLEGACY))
+ {
+ if (flags & MOUSEEVENTF_MOVE) update_desktop_cursor_pos( desktop, x, y );
return 0;
+ }
for (i = 0; i < ARRAY_SIZE( messages ); i++)
{
--
2.25.0.rc1