Commit 29d56fcb authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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=46309Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 40f101e2
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment