winex11.drv: Update INPUT mouse coordinates directly.

Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-03-25 19:00:19 +01:00 committed by Alexandre Julliard
parent 40f101e288
commit 29d56fcb8b
1 changed files with 5 additions and 8 deletions

View File

@ -592,7 +592,7 @@ static BOOL is_old_motion_event( unsigned long serial )
*
* Map the input event coordinates so they're relative to the desktop.
*/
static POINT map_event_coords( HWND hwnd, Window window, struct x11drv_win_data *data, const INPUT *input )
static void map_event_coords( HWND hwnd, Window window, struct x11drv_win_data *data, INPUT *input )
{
POINT pt = { input->u.mi.dx, input->u.mi.dy };
@ -611,7 +611,8 @@ static POINT map_event_coords( HWND hwnd, Window window, struct x11drv_win_data
TRACE( "mapped %s to %s\n", wine_dbgstr_point( (POINT *)&input->u.mi.dx ), wine_dbgstr_point( &pt ) );
return pt;
input->u.mi.dx = pt.x;
input->u.mi.dy = pt.y;
}
@ -623,7 +624,6 @@ static POINT map_event_coords( HWND hwnd, Window window, struct x11drv_win_data
static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
{
struct x11drv_win_data *data;
POINT pt;
input->type = INPUT_MOUSE;
@ -647,7 +647,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
}
if (!(data = get_win_data( hwnd ))) return;
pt = map_event_coords( hwnd, window, data, input );
map_event_coords( hwnd, window, data, input );
if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
input->u.mi.time - last_cursor_change > 100)
@ -670,8 +670,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
/* ignore event if a button is pressed, since the mouse is then grabbed too */
!(state & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask|Button6Mask|Button7Mask)))
{
RECT rect;
SetRect( &rect, pt.x, pt.y, pt.x + 1, pt.y + 1 );
RECT rect = { input->u.mi.dx, input->u.mi.dy, input->u.mi.dx + 1, input->u.mi.dy + 1 };
SERVER_START_REQ( update_window_zorder )
{
@ -685,8 +684,6 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
SERVER_END_REQ;
}
input->u.mi.dx = pt.x;
input->u.mi.dy = pt.y;
__wine_send_input( hwnd, input );
}