Rebase against 5a8bc554ef06c4a21d8b49ea8d936299f2cb2f34.

This commit is contained in:
Zebediah Figura 2021-04-06 18:45:52 -05:00
parent 0c295023f1
commit d1169e15ee
7 changed files with 25 additions and 248 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "8d076bc5e46cc11ec94db631e7c608f62d75cee2"
echo "5a8bc554ef06c4a21d8b49ea8d936299f2cb2f34"
}
# Show version information

View File

@ -1,18 +1,18 @@
From c9234e0e3cf1c326bd3fae7d931d70d16878b863 Mon Sep 17 00:00:00 2001
From b2aaf77c425652cb53e7e8d2617d2c00c706eb45 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 17 Sep 2017 19:59:08 +0200
Subject: user32/tests: Add tests for DC region.
Subject: [PATCH] user32/tests: Add tests for DC region.
---
dlls/user32/tests/input.c | 41 +++++++++++++++++++++++++++++++++++++++++
dlls/user32/tests/input.c | 41 +++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 41c7e3f1721..c4316d3041b 100644
index f3e5c14ea6c..082ac59544a 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1992,6 +1992,23 @@ static DWORD WINAPI create_static_win(void *arg)
return 0;
@@ -3207,6 +3207,23 @@ static LRESULT CALLBACK mouse_move_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L
return DefWindowProcW(hwnd, msg, wparam, lparam);
}
+static void get_dc_region(RECT *region, HWND hwnd, DWORD flags)
@ -35,7 +35,7 @@ index 41c7e3f1721..c4316d3041b 100644
static void test_Input_mouse(void)
{
BOOL got_button_down, got_button_up;
@@ -2226,6 +2243,10 @@ static void test_Input_mouse(void)
@@ -3450,6 +3467,10 @@ static void test_Input_mouse(void)
WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, button_win, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed\n");
@ -46,7 +46,7 @@ index 41c7e3f1721..c4316d3041b 100644
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
SetWindowLongA(hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
ret = SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
@@ -2337,6 +2358,25 @@ static void test_Input_mouse(void)
@@ -3463,6 +3484,25 @@ static void test_Input_mouse(void)
ok(region_type == ERROR, "expected ERROR, got %d\n", region_type);
}
@ -72,7 +72,7 @@ index 41c7e3f1721..c4316d3041b 100644
got_button_down = got_button_up = FALSE;
simulate_click(TRUE, 150, 150);
while (wait_for_message(&msg))
@@ -2426,6 +2466,7 @@ static void test_Input_mouse(void)
@@ -3650,6 +3690,7 @@ static void test_Input_mouse(void)
ok(got_button_down, "expected WM_LBUTTONDOWN message\n");
ok(got_button_up, "expected WM_LBUTTONUP message\n");
@ -81,5 +81,5 @@ index 41c7e3f1721..c4316d3041b 100644
SetCursorPos(pt_org.x, pt_org.y);
--
2.14.1
2.30.2

View File

@ -1,5 +1,4 @@
Fixes: [42631] Mouse drift, jump or don't react to small slow movements in Unity-engine games and Fallout 4 (partly fixed in Unity games, have walkaround in Fallout4 )
Fixes: [42675] Overwatch: Phantom mouse input / view pulled up to ceiling
# Depends: winex11.drv-mouse-coorrds
# Dependency is in the process of upstreaming.
# In the process of upstreaming.
Disabled: true

View File

@ -1,4 +1,4 @@
From 3a12873dae3a59fcaf723880f4cfb62c5ca66481 Mon Sep 17 00:00:00 2001
From a53e3b95850d3af54f919c219a2fc02e88f3f965 Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 14:24:50 +0300
Subject: [PATCH] d3d9: Support SWVP vertex shader float constants limits.
@ -10,7 +10,7 @@ Subject: [PATCH] d3d9: Support SWVP vertex shader float constants limits.
3 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index e78ce75a2f0..e2007f962d3 100644
index 7bb277c2a75..eff04c448d7 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -40,6 +40,7 @@
@ -31,10 +31,10 @@ index e78ce75a2f0..e2007f962d3 100644
struct fvf_declaration
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 2693b94ce71..380b1d92ce8 100644
index 2cd9d73d0d9..6df6f0099ee 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -361,7 +361,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
@@ -367,7 +367,7 @@ static BOOL wined3d_swapchain_desc_from_d3d9(struct wined3d_swapchain_desc *swap
}
void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_ordinal,
@ -43,7 +43,7 @@ index 2693b94ce71..380b1d92ce8 100644
{
static const DWORD ps_minor_version[] = {0, 4, 0, 0};
static const DWORD vs_minor_version[] = {0, 1, 0, 0};
@@ -501,7 +501,10 @@ void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_or
@@ -507,7 +507,10 @@ void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_or
D3DPTEXTURECAPS_MIPMAP | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP |
D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV;
@ -55,7 +55,7 @@ index 2693b94ce71..380b1d92ce8 100644
caps->NumSimultaneousRTs = min(D3D_MAX_SIMULTANEOUS_RENDERTARGETS, caps->NumSimultaneousRTs);
if (caps->PixelShaderVersion > 3)
@@ -749,6 +752,7 @@ static HRESULT WINAPI d3d9_device_GetDirect3D(IDirect3DDevice9Ex *iface, IDirect
@@ -755,6 +758,7 @@ static HRESULT WINAPI d3d9_device_GetDirect3D(IDirect3DDevice9Ex *iface, IDirect
static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCAPS9 *caps)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
@ -63,7 +63,7 @@ index 2693b94ce71..380b1d92ce8 100644
struct wined3d_caps wined3d_caps;
HRESULT hr;
@@ -757,13 +761,15 @@ static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCA
@@ -763,13 +767,15 @@ static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCA
if (!caps)
return D3DERR_INVALIDCALL;
@ -80,7 +80,7 @@ index 2693b94ce71..380b1d92ce8 100644
return hr;
}
@@ -3631,14 +3637,20 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i
@@ -3647,14 +3653,20 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i
UINT reg_idx, const float *data, UINT count)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
@ -103,7 +103,7 @@ index 2693b94ce71..380b1d92ce8 100644
return D3DERR_INVALIDCALL;
}
@@ -3654,14 +3666,21 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
@@ -3670,14 +3682,21 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
UINT start_idx, float *constants, UINT count)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
@ -126,9 +126,9 @@ index 2693b94ce71..380b1d92ce8 100644
{
WARN("Trying to access %u constants, but d3d9 only supports %u\n",
start_idx + count, device->vs_uniform_count);
@@ -4718,7 +4737,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine
}
@@ -4735,7 +4754,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine
device->immediate_context = wined3d_device_get_immediate_context(device->wined3d_device);
wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps);
- d3d9_caps_from_wined3dcaps(parent, adapter, &caps, &wined3d_caps);
+ d3d9_caps_from_wined3dcaps(parent, adapter, &caps, &wined3d_caps, 0);
@ -149,5 +149,5 @@ index b6cb25cf8ea..72e86f95f0c 100644
return hr;
}
--
2.25.1
2.30.2

View File

@ -1,219 +0,0 @@
From 712e41cd7a3d09291616d50836215b79a867d43a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
Date: Tue, 7 May 2019 14:43:42 +0300
Subject: [PATCH] winex11.drv/mouse: Use root-relative coordinates for events,
if possible
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some applications control their own position when they are being moved. Since
events' x and y fields are reported relative to the window, this can
apparently result in them being out of sync from the X server side and ours
(hwnd). This makes applications like Winamp go nuts when they are being
moved and move all over the place "randomly".
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
---
dlls/winex11.drv/mouse.c | 106 +++++++++++++++++++++++++--------------
1 file changed, 68 insertions(+), 38 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index f737a30..e59a281 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -554,6 +554,46 @@ static BOOL is_old_motion_event( unsigned long serial )
}
+/***********************************************************************
+ * map_event_coords
+ *
+ * Map the input event coordinates so they're relative to the desktop.
+ */
+static POINT map_event_coords(const XButtonEvent *event, HWND hwnd)
+{
+ POINT pt = { event->x, event->y };
+ struct x11drv_win_data *data;
+
+ if (event->window == root_window)
+ pt = root_to_virtual_screen(event->x, event->y);
+
+ if ((data = get_win_data(hwnd)))
+ {
+ if (event->window == data->whole_window)
+ {
+ pt.x += data->whole_rect.left - data->client_rect.left;
+ pt.y += data->whole_rect.top - data->client_rect.top;
+ }
+
+ if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_LAYOUTRTL)
+ pt.x = data->client_rect.right - data->client_rect.left - 1 - pt.x;
+ MapWindowPoints(hwnd, 0, &pt, 1);
+
+ if (event->root == root_window && event->same_screen && data->managed)
+ {
+ /* Try to use root coordinates, unless the window is at the (0,0)
+ position on the desktop to workaround full-screen or apps like
+ vst-bridge which reparent the window, so they don't break. */
+ if (pt.x != event->x || pt.y != event->y)
+ pt = root_to_virtual_screen(event->x_root, event->y_root);
+ }
+ release_win_data(data);
+ }
+
+ return pt;
+}
+
+
/***********************************************************************
* send_mouse_input
*
@@ -562,7 +602,6 @@ static BOOL is_old_motion_event( unsigned long serial )
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;
@@ -585,32 +624,14 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
return;
}
- if (window != root_window)
- {
- pt.x = input->u.mi.dx;
- pt.y = input->u.mi.dy;
- }
- else pt = root_to_virtual_screen( input->u.mi.dx, input->u.mi.dy );
-
- if (!(data = get_win_data( hwnd ))) return;
-
- if (window == data->whole_window)
- {
- pt.x += data->whole_rect.left - data->client_rect.left;
- pt.y += data->whole_rect.top - data->client_rect.top;
- }
-
- if (GetWindowLongW( data->hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL)
- pt.x = data->client_rect.right - data->client_rect.left - 1 - pt.x;
- MapWindowPoints( hwnd, 0, &pt, 1 );
-
- if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
- input->u.mi.time - last_cursor_change > 100)
+ if ((InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
+ input->u.mi.time - last_cursor_change > 100) &&
+ (data = get_win_data( hwnd )))
{
sync_window_cursor( data->whole_window );
last_cursor_change = input->u.mi.time;
+ release_win_data( data );
}
- release_win_data( data );
if (hwnd != GetDesktopWindow())
{
@@ -625,8 +646,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 )
{
@@ -640,8 +660,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 );
}
@@ -1598,13 +1616,16 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev )
XButtonEvent *event = &xev->xbutton;
int buttonNum = event->button - 1;
INPUT input;
+ POINT pt;
if (buttonNum >= NB_BUTTONS) return FALSE;
- TRACE( "hwnd %p/%lx button %u pos %d,%d\n", hwnd, event->window, buttonNum, event->x, event->y );
+ pt = map_event_coords(event, hwnd);
+
+ TRACE( "hwnd %p/%lx button %u pos %d,%d\n", hwnd, event->window, buttonNum, pt.x, pt.y );
- input.u.mi.dx = event->x;
- input.u.mi.dy = event->y;
+ input.u.mi.dx = pt.x;
+ input.u.mi.dy = pt.y;
input.u.mi.mouseData = button_down_data[buttonNum];
input.u.mi.dwFlags = button_down_flags[buttonNum] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
@@ -1624,13 +1645,16 @@ BOOL X11DRV_ButtonRelease( HWND hwnd, XEvent *xev )
XButtonEvent *event = &xev->xbutton;
int buttonNum = event->button - 1;
INPUT input;
+ POINT pt;
if (buttonNum >= NB_BUTTONS || !button_up_flags[buttonNum]) return FALSE;
- TRACE( "hwnd %p/%lx button %u pos %d,%d\n", hwnd, event->window, buttonNum, event->x, event->y );
+ pt = map_event_coords(event, hwnd);
+
+ TRACE( "hwnd %p/%lx button %u pos %d,%d\n", hwnd, event->window, buttonNum, pt.x, pt.y );
- input.u.mi.dx = event->x;
- input.u.mi.dy = event->y;
+ input.u.mi.dx = pt.x;
+ input.u.mi.dy = pt.y;
input.u.mi.mouseData = button_up_data[buttonNum];
input.u.mi.dwFlags = button_up_flags[buttonNum] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
@@ -1648,12 +1672,15 @@ BOOL X11DRV_MotionNotify( HWND hwnd, XEvent *xev )
{
XMotionEvent *event = &xev->xmotion;
INPUT input;
+ POINT pt;
+
+ pt = map_event_coords((XButtonEvent*)event, hwnd);
TRACE( "hwnd %p/%lx pos %d,%d is_hint %d serial %lu\n",
- hwnd, event->window, event->x, event->y, event->is_hint, event->serial );
+ hwnd, event->window, pt.x, pt.y, event->is_hint, event->serial );
- input.u.mi.dx = event->x;
- input.u.mi.dy = event->y;
+ input.u.mi.dx = pt.x;
+ input.u.mi.dy = pt.y;
input.u.mi.mouseData = 0;
input.u.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
@@ -1676,6 +1703,7 @@ BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *xev )
{
XCrossingEvent *event = &xev->xcrossing;
INPUT input;
+ POINT pt;
TRACE( "hwnd %p/%lx pos %d,%d detail %d\n", hwnd, event->window, event->x, event->y, event->detail );
@@ -1683,8 +1711,10 @@ BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *xev )
if (hwnd == x11drv_thread_data()->grab_hwnd) return FALSE;
/* simulate a mouse motion event */
- input.u.mi.dx = event->x;
- input.u.mi.dy = event->y;
+ pt = map_event_coords((XButtonEvent*)event, hwnd);
+
+ input.u.mi.dx = pt.x;
+ input.u.mi.dy = pt.y;
input.u.mi.mouseData = 0;
input.u.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
--
2.21.0

View File

@ -1,3 +0,0 @@
Fixes: [46309] winex11.drv: Use root-relative coordinates for events, if possible.
# In the process of upstreaming...
Disabled: true

View File

@ -1 +1 @@
8d076bc5e46cc11ec94db631e7c608f62d75cee2
5a8bc554ef06c4a21d8b49ea8d936299f2cb2f34