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:
parent
40f101e288
commit
29d56fcb8b
|
@ -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.
|
* 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 };
|
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 ) );
|
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 )
|
static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
|
||||||
{
|
{
|
||||||
struct x11drv_win_data *data;
|
struct x11drv_win_data *data;
|
||||||
POINT pt;
|
|
||||||
|
|
||||||
input->type = INPUT_MOUSE;
|
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;
|
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 ||
|
if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
|
||||||
input->u.mi.time - last_cursor_change > 100)
|
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 */
|
/* ignore event if a button is pressed, since the mouse is then grabbed too */
|
||||||
!(state & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask|Button6Mask|Button7Mask)))
|
!(state & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask|Button6Mask|Button7Mask)))
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect = { input->u.mi.dx, input->u.mi.dy, input->u.mi.dx + 1, input->u.mi.dy + 1 };
|
||||||
SetRect( &rect, pt.x, pt.y, pt.x + 1, pt.y + 1 );
|
|
||||||
|
|
||||||
SERVER_START_REQ( update_window_zorder )
|
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;
|
SERVER_END_REQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
input->u.mi.dx = pt.x;
|
|
||||||
input->u.mi.dy = pt.y;
|
|
||||||
__wine_send_input( hwnd, input );
|
__wine_send_input( hwnd, input );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue