[PATCH 0/2] MR7102: winex11: Map mouse/touch event coordinates even without a hwnd.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57601 First change is needed to ignore hidraw touchscreen devices, it happens for instance on the Steam Deck in desktop mode. Although we indeed support them with mouhid.sys, there are multiple issues with it: * The input coordinates are raw and inconsistent with the system X display configuration (the Steam Deck default configuration has a 90° rotated screen). * They come in first and cause duplicate touch events with the X11 touch events, which makes the X touch events to always be considered as secondary touch points. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7102
From: Rémi Bernon <rbernon(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57601 --- dlls/winebus.sys/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index f0003d0774d..82bc8667bde 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -427,6 +427,12 @@ static BOOL is_hidraw_enabled(WORD vid, WORD pid, const USAGE_AND_PAGE *usages, DWORD size; if (check_bus_option(L"DisableHidraw", FALSE)) return FALSE; + + if (usages->UsagePage == HID_USAGE_PAGE_DIGITIZER) + { + WARN("Ignoring unsupported %04X:%04X hidraw touchscreen\n", vid, pid); + return FALSE; + } if (usages->UsagePage != HID_USAGE_PAGE_GENERIC) return TRUE; if (usages->Usage != HID_USAGE_GENERIC_GAMEPAD && usages->Usage != HID_USAGE_GENERIC_JOYSTICK) return TRUE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7102
From: Rémi Bernon <rbernon(a)codeweavers.com> Some touch events don't have the window set properly, we don't really need it but we need the mouse coordinate to be mapped correctly. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57601 --- dlls/winex11.drv/mouse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 5f6b9f34d2a..9d25b71c992 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -497,7 +497,9 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x TRACE( "hwnd %p, window %lx, event_root %lx, x_root %d, y_root %d, input %p\n", hwnd, window, event_root, x_root, y_root, input ); - if (!hwnd) + if (window == root_window) pt = root_to_virtual_screen( pt.x, pt.y ); + else if (event_root == root_window) pt = root_to_virtual_screen( x_root, y_root ); + else if (!hwnd) { thread_data = x11drv_thread_data(); if (!thread_data->clipping_cursor) return; @@ -507,9 +509,7 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x } else if ((data = get_win_data( hwnd ))) { - if (window == root_window) pt = root_to_virtual_screen( pt.x, pt.y ); - else if (event_root == root_window) pt = root_to_virtual_screen( x_root, y_root ); - else if (window == data->client_window) + if (window == data->client_window) { pt.x += data->rects.client.left; pt.y += data->rects.client.top; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7102
participants (1)
-
Rémi Bernon