Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2019
- 73 participants
- 1462 messages
[PATCH] msi: Close all handles opened by a custom action thread.
by Zebediah Figura
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47418
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/msi/custom.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index 03f9b085c04..b864270690b 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -580,7 +580,8 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
midl_user_free(dll);
midl_user_free(proc);
- MsiCloseHandle(hPackage);
+
+ MsiCloseAllHandles();
return r;
}
--
2.22.0
June 30, 2019
Re: [PATCH] wined3d: Always try to create a hardware cursor.
by Zebediah Figura
I guess the behaviour may have changed. I tested on Windows 10, and in
both windowed and fullscreen mode I got a scaled 32x32 HW cursor. I also
tested with a reduced testcase [essentially adapting test_cursor()] and
I was never able to get a SW cursor. Or at least, it was always scaled
to 32x32, and it always moved without me making any calls to d3d9.
I'd test with Windows 7 or something earlier, but I don't have immediate
access to any such machine myself.
On 6/30/19 5:04 AM, Stefan Dösinger wrote:
> If my memory of my own experiments are right then what your patch does is correct for windowed mode. In Windowed mode native d3d9 never renders an SW cursor and instead creates a scaled HW cursor.
>
> In fullscreen mode I do get a (non-moving by default) SW cursor for a 64x64 texture, or at least used to when I tested it on Windows 7 years ago. The behavior might have changed. Since comment 7 on bug 47386 indicates that the game calls SetCursorProperties over and over it might be the correct thing to update the cursor position to the current user32 cursor pos in SetCursorProperties.
>
> How does the cursor appear on Windows? Does it look like a 32x32 or 64x64 cursor? Also keep in mind the possibility that the cursor is a 64x64 one where only a 32x32 part of the texture contains non-transparent data.
>
>> Am 29.06.2019 um 01:46 schrieb Zebediah Figura <zfigura(a)codeweavers.com>:
>>
>> From: Zebediah Figura <z.figura12(a)gmail.com>
>>
>> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47386
>> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
>> ---
>> dlls/wined3d/device.c | 65 +++++++++++++++++++++----------------------
>> 1 file changed, 31 insertions(+), 34 deletions(-)
>>
>> diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
>> index d35a0648c9c..39dd93e11b7 100644
>> --- a/dlls/wined3d/device.c
>> +++ b/dlls/wined3d/device.c
>> @@ -5216,9 +5216,12 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
>> UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx)
>> {
>> unsigned int texture_level = sub_resource_idx % texture->level_count;
>> - unsigned int cursor_width, cursor_height;
>> + unsigned int cursor_width, cursor_height, mask_size;
>> struct wined3d_display_mode mode;
>> struct wined3d_map_desc map_desc;
>> + ICONINFO cursor_info;
>> + DWORD *mask_bits;
>> + HCURSOR cursor;
>> HRESULT hr;
>>
>> TRACE("device %p, x_hotspot %u, y_hotspot %u, texture %p, sub_resource_idx %u.\n",
>> @@ -5268,43 +5271,37 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
>> return WINED3DERR_INVALIDCALL;
>> }
>>
>> - if (cursor_width == 32 && cursor_height == 32)
>> - {
>> - UINT mask_size = cursor_width * cursor_height / 8;
>> - ICONINFO cursor_info;
>> - DWORD *mask_bits;
>> - HCURSOR cursor;
>> + mask_size = cursor_width * cursor_height / 8;
>>
>> - /* 32-bit user32 cursors ignore the alpha channel if it's all
>> - * zeroes, and use the mask instead. Fill the mask with all ones
>> - * to ensure we still get a fully transparent cursor. */
>> - if (!(mask_bits = heap_alloc(mask_size)))
>> - return E_OUTOFMEMORY;
>> - memset(mask_bits, 0xff, mask_size);
>> + /* 32-bit user32 cursors ignore the alpha channel if it's all
>> + * zeroes, and use the mask instead. Fill the mask with all ones
>> + * to ensure we still get a fully transparent cursor. */
>> + if (!(mask_bits = heap_alloc(mask_size)))
>> + return E_OUTOFMEMORY;
>> + memset(mask_bits, 0xff, mask_size);
>>
>> - wined3d_resource_map(&texture->resource, sub_resource_idx, &map_desc, NULL,
>> - WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READ);
>> - cursor_info.fIcon = FALSE;
>> - cursor_info.xHotspot = x_hotspot;
>> - cursor_info.yHotspot = y_hotspot;
>> - cursor_info.hbmMask = CreateBitmap(cursor_width, cursor_height, 1, 1, mask_bits);
>> - cursor_info.hbmColor = CreateBitmap(cursor_width, cursor_height, 1, 32, map_desc.data);
>> - wined3d_resource_unmap(&texture->resource, sub_resource_idx);
>> + wined3d_resource_map(&texture->resource, sub_resource_idx, &map_desc, NULL,
>> + WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READ);
>> + cursor_info.fIcon = FALSE;
>> + cursor_info.xHotspot = x_hotspot;
>> + cursor_info.yHotspot = y_hotspot;
>> + cursor_info.hbmMask = CreateBitmap(cursor_width, cursor_height, 1, 1, mask_bits);
>> + cursor_info.hbmColor = CreateBitmap(cursor_width, cursor_height, 1, 32, map_desc.data);
>> + wined3d_resource_unmap(&texture->resource, sub_resource_idx);
>>
>> - /* Create our cursor and clean up. */
>> - cursor = CreateIconIndirect(&cursor_info);
>> - if (cursor_info.hbmMask)
>> - DeleteObject(cursor_info.hbmMask);
>> - if (cursor_info.hbmColor)
>> - DeleteObject(cursor_info.hbmColor);
>> - if (device->hardwareCursor)
>> - DestroyCursor(device->hardwareCursor);
>> - device->hardwareCursor = cursor;
>> - if (device->bCursorVisible)
>> - SetCursor(cursor);
>> + /* Create our cursor and clean up. */
>> + cursor = CreateIconIndirect(&cursor_info);
>> + if (cursor_info.hbmMask)
>> + DeleteObject(cursor_info.hbmMask);
>> + if (cursor_info.hbmColor)
>> + DeleteObject(cursor_info.hbmColor);
>> + if (device->hardwareCursor)
>> + DestroyCursor(device->hardwareCursor);
>> + device->hardwareCursor = cursor;
>> + if (device->bCursorVisible)
>> + SetCursor(cursor);
>>
>> - heap_free(mask_bits);
>> - }
>> + heap_free(mask_bits);
>>
>> TRACE("New cursor dimensions are %ux%u.\n", cursor_width, cursor_height);
>> device->cursorWidth = cursor_width;
>> --
>> 2.20.1
>>
>>
>>
>
June 30, 2019
Re: [PATCH] wined3d: Always try to create a hardware cursor.
by Stefan Dösinger
If my memory of my own experiments are right then what your patch does is correct for windowed mode. In Windowed mode native d3d9 never renders an SW cursor and instead creates a scaled HW cursor.
In fullscreen mode I do get a (non-moving by default) SW cursor for a 64x64 texture, or at least used to when I tested it on Windows 7 years ago. The behavior might have changed. Since comment 7 on bug 47386 indicates that the game calls SetCursorProperties over and over it might be the correct thing to update the cursor position to the current user32 cursor pos in SetCursorProperties.
How does the cursor appear on Windows? Does it look like a 32x32 or 64x64 cursor? Also keep in mind the possibility that the cursor is a 64x64 one where only a 32x32 part of the texture contains non-transparent data.
> Am 29.06.2019 um 01:46 schrieb Zebediah Figura <zfigura(a)codeweavers.com>:
>
> From: Zebediah Figura <z.figura12(a)gmail.com>
>
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47386
> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
> ---
> dlls/wined3d/device.c | 65 +++++++++++++++++++++----------------------
> 1 file changed, 31 insertions(+), 34 deletions(-)
>
> diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
> index d35a0648c9c..39dd93e11b7 100644
> --- a/dlls/wined3d/device.c
> +++ b/dlls/wined3d/device.c
> @@ -5216,9 +5216,12 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
> UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx)
> {
> unsigned int texture_level = sub_resource_idx % texture->level_count;
> - unsigned int cursor_width, cursor_height;
> + unsigned int cursor_width, cursor_height, mask_size;
> struct wined3d_display_mode mode;
> struct wined3d_map_desc map_desc;
> + ICONINFO cursor_info;
> + DWORD *mask_bits;
> + HCURSOR cursor;
> HRESULT hr;
>
> TRACE("device %p, x_hotspot %u, y_hotspot %u, texture %p, sub_resource_idx %u.\n",
> @@ -5268,43 +5271,37 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
> return WINED3DERR_INVALIDCALL;
> }
>
> - if (cursor_width == 32 && cursor_height == 32)
> - {
> - UINT mask_size = cursor_width * cursor_height / 8;
> - ICONINFO cursor_info;
> - DWORD *mask_bits;
> - HCURSOR cursor;
> + mask_size = cursor_width * cursor_height / 8;
>
> - /* 32-bit user32 cursors ignore the alpha channel if it's all
> - * zeroes, and use the mask instead. Fill the mask with all ones
> - * to ensure we still get a fully transparent cursor. */
> - if (!(mask_bits = heap_alloc(mask_size)))
> - return E_OUTOFMEMORY;
> - memset(mask_bits, 0xff, mask_size);
> + /* 32-bit user32 cursors ignore the alpha channel if it's all
> + * zeroes, and use the mask instead. Fill the mask with all ones
> + * to ensure we still get a fully transparent cursor. */
> + if (!(mask_bits = heap_alloc(mask_size)))
> + return E_OUTOFMEMORY;
> + memset(mask_bits, 0xff, mask_size);
>
> - wined3d_resource_map(&texture->resource, sub_resource_idx, &map_desc, NULL,
> - WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READ);
> - cursor_info.fIcon = FALSE;
> - cursor_info.xHotspot = x_hotspot;
> - cursor_info.yHotspot = y_hotspot;
> - cursor_info.hbmMask = CreateBitmap(cursor_width, cursor_height, 1, 1, mask_bits);
> - cursor_info.hbmColor = CreateBitmap(cursor_width, cursor_height, 1, 32, map_desc.data);
> - wined3d_resource_unmap(&texture->resource, sub_resource_idx);
> + wined3d_resource_map(&texture->resource, sub_resource_idx, &map_desc, NULL,
> + WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READ);
> + cursor_info.fIcon = FALSE;
> + cursor_info.xHotspot = x_hotspot;
> + cursor_info.yHotspot = y_hotspot;
> + cursor_info.hbmMask = CreateBitmap(cursor_width, cursor_height, 1, 1, mask_bits);
> + cursor_info.hbmColor = CreateBitmap(cursor_width, cursor_height, 1, 32, map_desc.data);
> + wined3d_resource_unmap(&texture->resource, sub_resource_idx);
>
> - /* Create our cursor and clean up. */
> - cursor = CreateIconIndirect(&cursor_info);
> - if (cursor_info.hbmMask)
> - DeleteObject(cursor_info.hbmMask);
> - if (cursor_info.hbmColor)
> - DeleteObject(cursor_info.hbmColor);
> - if (device->hardwareCursor)
> - DestroyCursor(device->hardwareCursor);
> - device->hardwareCursor = cursor;
> - if (device->bCursorVisible)
> - SetCursor(cursor);
> + /* Create our cursor and clean up. */
> + cursor = CreateIconIndirect(&cursor_info);
> + if (cursor_info.hbmMask)
> + DeleteObject(cursor_info.hbmMask);
> + if (cursor_info.hbmColor)
> + DeleteObject(cursor_info.hbmColor);
> + if (device->hardwareCursor)
> + DestroyCursor(device->hardwareCursor);
> + device->hardwareCursor = cursor;
> + if (device->bCursorVisible)
> + SetCursor(cursor);
>
> - heap_free(mask_bits);
> - }
> + heap_free(mask_bits);
>
> TRACE("New cursor dimensions are %ux%u.\n", cursor_width, cursor_height);
> device->cursorWidth = cursor_width;
> --
> 2.20.1
>
>
>
June 30, 2019
Re: Re: [PATCH v2 1/6] user32: Add support for RIDEV_NOLEGACY flag.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=54270
Your paranoid android.
=== debian9 (build log) ===
error: corrupt patch at line 83
Task: Patch failed to apply
=== debian9 (build log) ===
error: corrupt patch at line 83
Task: Patch failed to apply
June 30, 2019
Re: [PATCH v2 3/6] server: Add request for sending native raw-input messages.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=54266
Your paranoid android.
=== debian9 (32 bit report) ===
user32:
msg.c:8713: Test failed: WaitForSingleObject failed 102
msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead
msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead
msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
June 30, 2019
Re: [PATCH v2 6/6] winex11.drv: Implement native mouse-movement raw-input using RawMotion.
by Derek Lesho
This patch had to be updated as multiple threads in a process were sending
identical rawinput messages and increasing sensitivity.
On Sat, Jun 29, 2019 at 10:26 PM Derek Lesho <dereklesho52(a)gmail.com> wrote:
> Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
> ---
> dlls/winex11.drv/mouse.c | 97 ++++++++++++++++++++++++++--------
> dlls/winex11.drv/x11drv.h | 6 ++-
> dlls/winex11.drv/x11drv_main.c | 10 ++++
> 3 files changed, 90 insertions(+), 23 deletions(-)
>
> diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
> index f737a306a5..b5afbb04df 100644
> --- a/dlls/winex11.drv/mouse.c
> +++ b/dlls/winex11.drv/mouse.c
> @@ -284,11 +284,26 @@ static void update_relative_valuators(XIAnyClassInfo
> **valuators, int n_valuator
> }
> #endif
>
> +/***********************************************************************
> + * inform_wineserver
> + */
> +static void inform_wineserver(void)
> +{
> + static int once = 0;
> + if (!once)
> + {
> + RAWINPUT raw_input;
> + raw_input.header.dwType = RIM_ENABLE_NATIVE_MOUSE_MOVE;
> + __wine_send_raw_input(&raw_input);
> + once = 1;
> + }
> +}
> +
>
> /***********************************************************************
> - * enable_xinput2
> + * X11DRV_XInput2_Enable
> */
> -static void enable_xinput2(void)
> +void X11DRV_XInput2_Enable(void)
> {
> #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
> struct x11drv_thread_data *data = x11drv_thread_data();
> @@ -318,7 +333,6 @@ static void enable_xinput2(void)
> memset( mask_bits, 0, sizeof(mask_bits) );
> XISetMask( mask_bits, XI_DeviceChanged );
> XISetMask( mask_bits, XI_RawMotion );
> - XISetMask( mask_bits, XI_ButtonPress );
>
> pXISelectEvents( data->display, DefaultRootWindow( data->display ),
> &mask, 1 );
>
> @@ -337,19 +351,21 @@ static void enable_xinput2(void)
> data->xi2_current_slave = 0;
>
> data->xi2_state = xi_enabled;
> +
> + inform_wineserver();
> #endif
> }
>
> /***********************************************************************
> - * disable_xinput2
> + * X11DRV_XInput2_Disable
> */
> -static void disable_xinput2(void)
> +void X11DRV_XInput2_Disable(void)
> {
> #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
> struct x11drv_thread_data *data = x11drv_thread_data();
> XIEventMask mask;
>
> - if (data->xi2_state != xi_enabled) return;
> + if (data->xi2_state < xi_enabled) return;
>
> TRACE( "disabling\n" );
> data->xi2_state = xi_disabled;
> @@ -368,6 +384,21 @@ static void disable_xinput2(void)
> #endif
> }
>
> +static void use_xinput2_path(void)
> +{
> + struct x11drv_thread_data *thread_data = x11drv_thread_data();
> +
> + if (thread_data->xi2_state == xi_enabled)
> + thread_data->xi2_state = xi_extra;
> +}
> +
> +static void disable_xinput2_path(void)
> +{
> + struct x11drv_thread_data *thread_data = x11drv_thread_data();
> +
> + if (thread_data->xi2_state == xi_extra)
> + thread_data->xi2_state = xi_enabled;
> +}
>
> /***********************************************************************
> * grab_clipping_window
> @@ -393,9 +424,9 @@ static BOOL grab_clipping_window( const RECT *clip )
> return TRUE;
>
> /* enable XInput2 unless we are already clipping */
> - if (!data->clip_hwnd) enable_xinput2();
> + if (!data->clip_hwnd) use_xinput2_path();
>
> - if (data->xi2_state != xi_enabled)
> + if (data->xi2_state < xi_extra)
> {
> WARN( "XInput2 not supported, refusing to clip to %s\n",
> wine_dbgstr_rect(clip) );
> DestroyWindow( msg_hwnd );
> @@ -423,7 +454,7 @@ static BOOL grab_clipping_window( const RECT *clip )
>
> if (!clipping_cursor)
> {
> - disable_xinput2();
> + disable_xinput2_path();
> DestroyWindow( msg_hwnd );
> return FALSE;
> }
> @@ -489,7 +520,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND
> new_clip_hwnd )
> TRACE( "clip hwnd reset from %p\n", hwnd );
> data->clip_hwnd = 0;
> data->clip_reset = GetTickCount();
> - disable_xinput2();
> + disable_xinput2_path();
> DestroyWindow( hwnd );
> }
> else if (hwnd == GetForegroundWindow()) /* request to clip */
> @@ -1724,16 +1755,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie
> *xev )
> {
> XIRawEvent *event = xev->data;
> const double *values = event->valuators.values;
> + const double *raw_values = event->raw_values;
> RECT virtual_rect;
> INPUT input;
> + RAWINPUT raw_input;
> int i;
> - double dx = 0, dy = 0, val;
> + double dx = 0, dy = 0, raw_dx = 0, raw_dy = 0, val, raw_val;
> struct x11drv_thread_data *thread_data = x11drv_thread_data();
> struct x11drv_valuator_data *x_rel, *y_rel;
>
> if (thread_data->x_rel_valuator.number < 0 ||
> thread_data->y_rel_valuator.number < 0) return FALSE;
> if (!event->valuators.mask_len) return FALSE;
> - if (thread_data->xi2_state != xi_enabled) return FALSE;
> + if (thread_data->xi2_state < xi_enabled) return FALSE;
>
> /* If there is no slave currently detected, no previous motion nor
> device
> * change events were received. Look it up now on the device list in
> this
> @@ -1758,25 +1791,21 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie
> *xev )
> x_rel = &thread_data->x_rel_valuator;
> y_rel = &thread_data->y_rel_valuator;
>
> - input.u.mi.mouseData = 0;
> - input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
> - input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
> - input.u.mi.dwExtraInfo = 0;
> - input.u.mi.dx = 0;
> - input.u.mi.dy = 0;
> -
> virtual_rect = get_virtual_screen_rect();
>
> for (i = 0; i <= max ( x_rel->number, y_rel->number ); i++)
> {
> if (!XIMaskIsSet( event->valuators.mask, i )) continue;
> val = *values++;
> + raw_val = *raw_values++;
> if (i == x_rel->number)
> {
> input.u.mi.dx = dx = val;
> if (x_rel->min < x_rel->max)
> input.u.mi.dx = val * (virtual_rect.right -
> virtual_rect.left)
> / (x_rel->max - x_rel->min);
> +
> + raw_dx = raw_val;
> }
> if (i == y_rel->number)
> {
> @@ -1784,6 +1813,8 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie
> *xev )
> if (y_rel->min < y_rel->max)
> input.u.mi.dy = val * (virtual_rect.bottom -
> virtual_rect.top)
> / (y_rel->max - y_rel->min);
> +
> + raw_dy = raw_val;
> }
> }
>
> @@ -1793,10 +1824,32 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie
> *xev )
> return FALSE;
> }
>
> - TRACE( "pos %d,%d (event %f,%f)\n", input.u.mi.dx, input.u.mi.dy, dx,
> dy );
> + raw_input.data.mouse.lLastX = raw_dx;
> + raw_input.data.mouse.lLastY = raw_dy;
> + raw_input.data.mouse.u.usButtonFlags = 0;
> + raw_input.data.mouse.u.usButtonData = 0;
> + raw_input.data.mouse.ulExtraInformation = 0;
> +
> + TRACE("raw event %f,%f\n", raw_dx, raw_dy);
> +
> + raw_input.header.dwType = RIM_TYPEMOUSE;
> +
> + if ( LIST_ENTRY((&g_x11_threads)->next, struct x11drv_thread_data,
> entry) == thread_data )
> + __wine_send_raw_input( &raw_input );
> +
> + if (thread_data->xi2_state == xi_extra)
> + {
> + input.u.mi.mouseData = 0;
> + input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
> + input.u.mi.time = EVENT_x11_time_to_win32_time(
> event->time );
> + input.u.mi.dwExtraInfo = 0;
> +
> + TRACE( "pos %d,%d (event %f,%f)\n", input.u.mi.dx, input.u.mi.dy,
> dx, dy );
> +
> + input.type = INPUT_MOUSE;
> + __wine_send_input( 0, &input );
> + }
>
> - input.type = INPUT_MOUSE;
> - __wine_send_input( 0, &input );
> return TRUE;
> }
>
> diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
> index a0308b0675..378c1d7508 100644
> --- a/dlls/winex11.drv/x11drv.h
> +++ b/dlls/winex11.drv/x11drv.h
> @@ -194,6 +194,8 @@ extern BOOL X11DRV_UnrealizePalette( HPALETTE hpal )
> DECLSPEC_HIDDEN;
>
> extern void X11DRV_Xcursor_Init(void) DECLSPEC_HIDDEN;
> extern void X11DRV_XInput2_Init(void) DECLSPEC_HIDDEN;
> +extern void X11DRV_XInput2_Enable(void) DECLSPEC_HIDDEN;
> +extern void X11DRV_XInput2_Disable(void) DECLSPEC_HIDDEN;
>
> extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage
> *image,
> const struct gdi_image_bits *src_bits,
> struct gdi_image_bits *dst_bits,
> @@ -335,14 +337,16 @@ struct x11drv_thread_data
> HWND clip_hwnd; /* message window stored in desktop
> while clipping is active */
> DWORD clip_reset; /* time when clipping was last reset */
> HKL kbd_layout; /* active keyboard layout */
> - enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled }
> xi2_state; /* XInput2 state */
> + enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled,
> xi_extra } xi2_state; /* XInput2 state */
> void *xi2_devices; /* list of XInput2 devices (valid when
> state is enabled) */
> int xi2_device_count;
> struct x11drv_valuator_data x_rel_valuator;
> struct x11drv_valuator_data y_rel_valuator;
> int xi2_core_pointer; /* XInput2 core pointer id */
> int xi2_current_slave; /* Current slave driving the Core
> pointer */
> + struct list entry; /* Entry in global list of setup X11
> threads */
> };
> +extern struct list g_x11_threads DECLSPEC_HIDDEN; /* Global list of setup
> X11 threads */
>
> extern struct x11drv_thread_data *x11drv_init_thread_data(void)
> DECLSPEC_HIDDEN;
> extern DWORD thread_data_tls_index DECLSPEC_HIDDEN;
> diff --git a/dlls/winex11.drv/x11drv_main.c
> b/dlls/winex11.drv/x11drv_main.c
> index e67a3c05a9..685b3dd0f4 100644
> --- a/dlls/winex11.drv/x11drv_main.c
> +++ b/dlls/winex11.drv/x11drv_main.c
> @@ -601,6 +601,9 @@ static BOOL process_attach(void)
> }
>
>
> +struct list g_x11_threads = LIST_INIT( g_x11_threads );
> +
> +
> /***********************************************************************
> * ThreadDetach (X11DRV.@)
> */
> @@ -610,6 +613,9 @@ void CDECL X11DRV_ThreadDetach(void)
>
> if (data)
> {
> + list_remove( &data->entry );
> + X11DRV_XInput2_Disable();
> +
> if (data->xim) XCloseIM( data->xim );
> if (data->font_set) XFreeFontSet( data->display, data->font_set );
> XCloseDisplay( data->display );
> @@ -680,6 +686,10 @@ struct x11drv_thread_data
> *x11drv_init_thread_data(void)
>
> if (use_xim) X11DRV_SetupXIM();
>
> + X11DRV_XInput2_Enable();
> +
> + list_add_tail( &g_x11_threads, &data->entry );
> +
> return data;
> }
>
> --
> 2.21.0
>
>
June 30, 2019
Re: [PATCH v2 1/6] user32: Add support for RIDEV_NOLEGACY flag.
by Derek Lesho
This patch had to be updated as I didn't account for mouse messages sent
from set_cursor_pos.
On Sat, Jun 29, 2019 at 10:26 PM Derek Lesho <dereklesho52(a)gmail.com> wrote:
> Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
> ---
> dlls/user32/rawinput.c | 2 +-
> server/queue.c | 9 +++++++++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
> index 2085fd3f9f..120de073c8 100644
> --- a/dlls/user32/rawinput.c
> +++ b/dlls/user32/rawinput.c
> @@ -250,7 +250,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH
> RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
> TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n",
> i, devices[i].usUsagePage, devices[i].usUsage,
> devices[i].dwFlags, devices[i].hwndTarget);
> - if (devices[i].dwFlags & ~RIDEV_REMOVE)
> + if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY))
> FIXME("Unhandled flags %#x for device %u.\n",
> devices[i].dwFlags, i);
>
> d[i].usage_page = devices[i].usUsagePage;
> diff --git a/server/queue.c b/server/queue.c
> index 24239916af..0ab5adfead 100644
> --- a/server/queue.c
> +++ b/server/queue.c
> @@ -372,6 +372,9 @@ static void set_cursor_pos( struct desktop *desktop,
> int x, int y )
> static const struct hw_msg_source source = { IMDT_UNAVAILABLE,
> IMO_SYSTEM };
> struct message *msg;
>
> + if (current->process->rawinput_mouse &&
> + current->process->rawinput_mouse->flags & RIDEV_NOLEGACY) return;
> +
> if (!(msg = alloc_hardware_message( 0, source, get_tick_count() )))
> return;
>
> msg->msg = WM_MOUSEMOVE;
> @@ -1668,6 +1671,9 @@ static int queue_mouse_message( struct desktop
> *desktop, user_handle_t win, cons
> msg_data->rawinput.mouse.data = input->mouse.data;
>
> queue_hardware_message( desktop, msg, 0 );
> +
> + if (device->flags & RIDEV_NOLEGACY)
> + return FALSE;
> }
>
> for (i = 0; i < ARRAY_SIZE( messages ); i++)
> @@ -1793,6 +1799,9 @@ static int queue_keyboard_message( struct desktop
> *desktop, user_handle_t win, c
> msg_data->rawinput.kbd.scan = input->kbd.scan;
>
> queue_hardware_message( desktop, msg, 0 );
> +
> + if (device->flags & RIDEV_NOLEGACY)
> + return FALSE;
> }
>
> if (!(msg = alloc_hardware_message( input->kbd.info, source, time
> ))) return 0;
> --
> 2.21.0
>
>
June 30, 2019
Re: [PATCH v2 1/6] user32: Add support for RIDEV_NOLEGACY flag.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=54264
Your paranoid android.
=== debian9 (32 bit WoW report) ===
user32:
msg.c:8713: Test failed: WaitForSingleObject failed 102
msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead
msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead
msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
June 30, 2019
[PATCH v2 6/6] winex11.drv: Implement native mouse-movement raw-input using RawMotion.
by Derek Lesho
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
---
dlls/winex11.drv/mouse.c | 97 ++++++++++++++++++++++++++--------
dlls/winex11.drv/x11drv.h | 6 ++-
dlls/winex11.drv/x11drv_main.c | 10 ++++
3 files changed, 90 insertions(+), 23 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index f737a306a5..b5afbb04df 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -284,11 +284,26 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
}
#endif
+/***********************************************************************
+ * inform_wineserver
+ */
+static void inform_wineserver(void)
+{
+ static int once = 0;
+ if (!once)
+ {
+ RAWINPUT raw_input;
+ raw_input.header.dwType = RIM_ENABLE_NATIVE_MOUSE_MOVE;
+ __wine_send_raw_input(&raw_input);
+ once = 1;
+ }
+}
+
/***********************************************************************
- * enable_xinput2
+ * X11DRV_XInput2_Enable
*/
-static void enable_xinput2(void)
+void X11DRV_XInput2_Enable(void)
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct x11drv_thread_data *data = x11drv_thread_data();
@@ -318,7 +333,6 @@ static void enable_xinput2(void)
memset( mask_bits, 0, sizeof(mask_bits) );
XISetMask( mask_bits, XI_DeviceChanged );
XISetMask( mask_bits, XI_RawMotion );
- XISetMask( mask_bits, XI_ButtonPress );
pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 );
@@ -337,19 +351,21 @@ static void enable_xinput2(void)
data->xi2_current_slave = 0;
data->xi2_state = xi_enabled;
+
+ inform_wineserver();
#endif
}
/***********************************************************************
- * disable_xinput2
+ * X11DRV_XInput2_Disable
*/
-static void disable_xinput2(void)
+void X11DRV_XInput2_Disable(void)
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct x11drv_thread_data *data = x11drv_thread_data();
XIEventMask mask;
- if (data->xi2_state != xi_enabled) return;
+ if (data->xi2_state < xi_enabled) return;
TRACE( "disabling\n" );
data->xi2_state = xi_disabled;
@@ -368,6 +384,21 @@ static void disable_xinput2(void)
#endif
}
+static void use_xinput2_path(void)
+{
+ struct x11drv_thread_data *thread_data = x11drv_thread_data();
+
+ if (thread_data->xi2_state == xi_enabled)
+ thread_data->xi2_state = xi_extra;
+}
+
+static void disable_xinput2_path(void)
+{
+ struct x11drv_thread_data *thread_data = x11drv_thread_data();
+
+ if (thread_data->xi2_state == xi_extra)
+ thread_data->xi2_state = xi_enabled;
+}
/***********************************************************************
* grab_clipping_window
@@ -393,9 +424,9 @@ static BOOL grab_clipping_window( const RECT *clip )
return TRUE;
/* enable XInput2 unless we are already clipping */
- if (!data->clip_hwnd) enable_xinput2();
+ if (!data->clip_hwnd) use_xinput2_path();
- if (data->xi2_state != xi_enabled)
+ if (data->xi2_state < xi_extra)
{
WARN( "XInput2 not supported, refusing to clip to %s\n", wine_dbgstr_rect(clip) );
DestroyWindow( msg_hwnd );
@@ -423,7 +454,7 @@ static BOOL grab_clipping_window( const RECT *clip )
if (!clipping_cursor)
{
- disable_xinput2();
+ disable_xinput2_path();
DestroyWindow( msg_hwnd );
return FALSE;
}
@@ -489,7 +520,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd )
TRACE( "clip hwnd reset from %p\n", hwnd );
data->clip_hwnd = 0;
data->clip_reset = GetTickCount();
- disable_xinput2();
+ disable_xinput2_path();
DestroyWindow( hwnd );
}
else if (hwnd == GetForegroundWindow()) /* request to clip */
@@ -1724,16 +1755,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
{
XIRawEvent *event = xev->data;
const double *values = event->valuators.values;
+ const double *raw_values = event->raw_values;
RECT virtual_rect;
INPUT input;
+ RAWINPUT raw_input;
int i;
- double dx = 0, dy = 0, val;
+ double dx = 0, dy = 0, raw_dx = 0, raw_dy = 0, val, raw_val;
struct x11drv_thread_data *thread_data = x11drv_thread_data();
struct x11drv_valuator_data *x_rel, *y_rel;
if (thread_data->x_rel_valuator.number < 0 || thread_data->y_rel_valuator.number < 0) return FALSE;
if (!event->valuators.mask_len) return FALSE;
- if (thread_data->xi2_state != xi_enabled) return FALSE;
+ if (thread_data->xi2_state < xi_enabled) return FALSE;
/* If there is no slave currently detected, no previous motion nor device
* change events were received. Look it up now on the device list in this
@@ -1758,25 +1791,21 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
x_rel = &thread_data->x_rel_valuator;
y_rel = &thread_data->y_rel_valuator;
- input.u.mi.mouseData = 0;
- input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
- input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
- input.u.mi.dwExtraInfo = 0;
- input.u.mi.dx = 0;
- input.u.mi.dy = 0;
-
virtual_rect = get_virtual_screen_rect();
for (i = 0; i <= max ( x_rel->number, y_rel->number ); i++)
{
if (!XIMaskIsSet( event->valuators.mask, i )) continue;
val = *values++;
+ raw_val = *raw_values++;
if (i == x_rel->number)
{
input.u.mi.dx = dx = val;
if (x_rel->min < x_rel->max)
input.u.mi.dx = val * (virtual_rect.right - virtual_rect.left)
/ (x_rel->max - x_rel->min);
+
+ raw_dx = raw_val;
}
if (i == y_rel->number)
{
@@ -1784,6 +1813,8 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
if (y_rel->min < y_rel->max)
input.u.mi.dy = val * (virtual_rect.bottom - virtual_rect.top)
/ (y_rel->max - y_rel->min);
+
+ raw_dy = raw_val;
}
}
@@ -1793,10 +1824,32 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
return FALSE;
}
- TRACE( "pos %d,%d (event %f,%f)\n", input.u.mi.dx, input.u.mi.dy, dx, dy );
+ raw_input.data.mouse.lLastX = raw_dx;
+ raw_input.data.mouse.lLastY = raw_dy;
+ raw_input.data.mouse.u.usButtonFlags = 0;
+ raw_input.data.mouse.u.usButtonData = 0;
+ raw_input.data.mouse.ulExtraInformation = 0;
+
+ TRACE("raw event %f,%f\n", raw_dx, raw_dy);
+
+ raw_input.header.dwType = RIM_TYPEMOUSE;
+
+ if ( LIST_ENTRY((&g_x11_threads)->next, struct x11drv_thread_data, entry) == thread_data )
+ __wine_send_raw_input( &raw_input );
+
+ if (thread_data->xi2_state == xi_extra)
+ {
+ input.u.mi.mouseData = 0;
+ input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
+ input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
+ input.u.mi.dwExtraInfo = 0;
+
+ TRACE( "pos %d,%d (event %f,%f)\n", input.u.mi.dx, input.u.mi.dy, dx, dy );
+
+ input.type = INPUT_MOUSE;
+ __wine_send_input( 0, &input );
+ }
- input.type = INPUT_MOUSE;
- __wine_send_input( 0, &input );
return TRUE;
}
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index a0308b0675..378c1d7508 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -194,6 +194,8 @@ extern BOOL X11DRV_UnrealizePalette( HPALETTE hpal ) DECLSPEC_HIDDEN;
extern void X11DRV_Xcursor_Init(void) DECLSPEC_HIDDEN;
extern void X11DRV_XInput2_Init(void) DECLSPEC_HIDDEN;
+extern void X11DRV_XInput2_Enable(void) DECLSPEC_HIDDEN;
+extern void X11DRV_XInput2_Disable(void) DECLSPEC_HIDDEN;
extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image,
const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits,
@@ -335,14 +337,16 @@ struct x11drv_thread_data
HWND clip_hwnd; /* message window stored in desktop while clipping is active */
DWORD clip_reset; /* time when clipping was last reset */
HKL kbd_layout; /* active keyboard layout */
- enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled } xi2_state; /* XInput2 state */
+ enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled, xi_extra } xi2_state; /* XInput2 state */
void *xi2_devices; /* list of XInput2 devices (valid when state is enabled) */
int xi2_device_count;
struct x11drv_valuator_data x_rel_valuator;
struct x11drv_valuator_data y_rel_valuator;
int xi2_core_pointer; /* XInput2 core pointer id */
int xi2_current_slave; /* Current slave driving the Core pointer */
+ struct list entry; /* Entry in global list of setup X11 threads */
};
+extern struct list g_x11_threads DECLSPEC_HIDDEN; /* Global list of setup X11 threads */
extern struct x11drv_thread_data *x11drv_init_thread_data(void) DECLSPEC_HIDDEN;
extern DWORD thread_data_tls_index DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index e67a3c05a9..685b3dd0f4 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -601,6 +601,9 @@ static BOOL process_attach(void)
}
+struct list g_x11_threads = LIST_INIT( g_x11_threads );
+
+
/***********************************************************************
* ThreadDetach (X11DRV.@)
*/
@@ -610,6 +613,9 @@ void CDECL X11DRV_ThreadDetach(void)
if (data)
{
+ list_remove( &data->entry );
+ X11DRV_XInput2_Disable();
+
if (data->xim) XCloseIM( data->xim );
if (data->font_set) XFreeFontSet( data->display, data->font_set );
XCloseDisplay( data->display );
@@ -680,6 +686,10 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
if (use_xim) X11DRV_SetupXIM();
+ X11DRV_XInput2_Enable();
+
+ list_add_tail( &g_x11_threads, &data->entry );
+
return data;
}
--
2.21.0
June 30, 2019
[PATCH v2 5/6] server: Don't emulate rawinput mouse events if native exist.
by Derek Lesho
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
---
server/protocol.def | 2 +
server/queue.c | 99 ++++++++++++++++++++++++++-------------------
2 files changed, 59 insertions(+), 42 deletions(-)
diff --git a/server/protocol.def b/server/protocol.def
index 3a6a202f49..9703b49154 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -358,6 +358,8 @@ typedef union
} hw;
} hw_input_t;
+#define RIM_ENABLE_NATIVE_MOUSE_MOVE 0x0800
+#define RIM_ENABLE_NATIVE_MOUSE_PRESS 0x1000
typedef union
{
int type;
diff --git a/server/queue.c b/server/queue.c
index 35cfcecff5..41c26d8fa0 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1599,6 +1599,9 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa
return 1;
}
+int emulate_raw_mouse_move = 1;
+int emulate_raw_mouse_press = 1;
+
/* queue a hardware message for a mouse event */
static int queue_mouse_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input,
unsigned int origin, struct msg_queue *sender )
@@ -1666,53 +1669,59 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
if ((device = current->process->rawinput_mouse))
{
- if (!(msg = alloc_hardware_message( input->mouse.info, source, time ))) return 0;
- msg_data = msg->data;
+ if ( (emulate_raw_mouse_press && flags & ~MOUSEEVENTF_MOVE) || (emulate_raw_mouse_move && flags & MOUSEEVENTF_MOVE) )
+ {
+ if (!(msg = alloc_hardware_message( input->mouse.info, source, time ))) return 0;
+ msg_data = msg->data;
- msg->win = device->target;
- msg->msg = WM_INPUT;
- msg->wparam = RIM_INPUT;
- msg->lparam = 0;
+ msg->win = device->target;
+ msg->msg = WM_INPUT;
+ msg->wparam = RIM_INPUT;
+ msg->lparam = 0;
- msg_data->flags = 0;
- msg_data->rawinput.type = RIM_TYPEMOUSE;
- msg_data->rawinput.mouse.x = x - desktop->cursor.x;
- msg_data->rawinput.mouse.y = y - desktop->cursor.y;
- msg_data->rawinput.mouse.button_flags = 0;
- msg_data->rawinput.mouse.button_data = 0;
+ msg_data->flags = 0;
+ msg_data->rawinput.type = RIM_TYPEMOUSE;
+ msg_data->rawinput.mouse.x = emulate_raw_mouse_move ? x - desktop->cursor.x : 0;
+ msg_data->rawinput.mouse.y = emulate_raw_mouse_move ? y - desktop->cursor.y : 0;
+ msg_data->rawinput.mouse.button_flags = 0;
+ msg_data->rawinput.mouse.button_data = 0;
- for (i = 1; i < ARRAY_SIZE(raw_button_flags); ++i)
- {
- if (flags & (1 << i))
- msg_data->rawinput.mouse.button_flags |= raw_button_flags[i];
- }
+ if (emulate_raw_mouse_press)
+ {
+ for (i = 1; i < ARRAY_SIZE(raw_button_flags); ++i)
+ {
+ if (flags & (1 << i))
+ msg_data->rawinput.mouse.button_flags |= raw_button_flags[i];
+ }
- if (flags & MOUSEEVENTF_WHEEL)
- {
- msg_data->rawinput.mouse.button_flags |= RI_MOUSE_WHEEL;
- msg_data->rawinput.mouse.button_data = input->mouse.data;
- }
- if (flags & MOUSEEVENTF_HWHEEL)
- {
- msg_data->rawinput.mouse.button_flags |= RI_MOUSE_HORIZONTAL_WHEEL;
- msg_data->rawinput.mouse.button_data = input->mouse.data;
- }
- if (flags & MOUSEEVENTF_XDOWN)
- {
- if (input->mouse.data == XBUTTON1)
- msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_4_DOWN;
- else if (input->mouse.data == XBUTTON2)
- msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_5_DOWN;
- }
- if (flags & MOUSEEVENTF_XUP)
- {
- if (input->mouse.data == XBUTTON1)
- msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_4_UP;
- else if (input->mouse.data == XBUTTON2)
- msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_5_UP;
- }
+ if (flags & MOUSEEVENTF_WHEEL)
+ {
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_WHEEL;
+ msg_data->rawinput.mouse.button_data = input->mouse.data;
+ }
+ if (flags & MOUSEEVENTF_HWHEEL)
+ {
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_HORIZONTAL_WHEEL;
+ msg_data->rawinput.mouse.button_data = input->mouse.data;
+ }
+ if (flags & MOUSEEVENTF_XDOWN)
+ {
+ if (input->mouse.data == XBUTTON1)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_4_DOWN;
+ else if (input->mouse.data == XBUTTON2)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_5_DOWN;
+ }
+ if (flags & MOUSEEVENTF_XUP)
+ {
+ if (input->mouse.data == XBUTTON1)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_4_UP;
+ else if (input->mouse.data == XBUTTON2)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_5_UP;
+ }
+ }
- queue_hardware_message( desktop, msg, 0 );
+ queue_hardware_message( desktop, msg, 0 );
+ }
if (device->flags & RIDEV_NOLEGACY)
return FALSE;
@@ -2455,6 +2464,12 @@ DECL_HANDLER(send_rawinput_message)
queue_hardware_message( desktop, msg, 0 );
}
break;
+ case RIM_ENABLE_NATIVE_MOUSE_MOVE:
+ emulate_raw_mouse_move = 0;
+ break;
+ case RIM_ENABLE_NATIVE_MOUSE_PRESS:
+ emulate_raw_mouse_press = 0;
+ break;
default:
set_error( STATUS_INVALID_PARAMETER );
}
--
2.21.0
June 30, 2019