From 0236a379929a2f0ce8174008c65f95f583d4fe6c Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 5 Nov 2024 11:32:58 +1100 Subject: [PATCH] Rebase against eeabbe812ffc3ed7c06fc85cd63f0d85bffe207e. --- ...lement-waiting-on-server-bound-objec.patch | 47 ++++++++++++------- ...ort-for-absolute-position-in-RawMoti.patch | 14 +++--- staging/upstream-commit | 2 +- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/patches/eventfd_synchronization/0014-ntdll-server-Implement-waiting-on-server-bound-objec.patch b/patches/eventfd_synchronization/0014-ntdll-server-Implement-waiting-on-server-bound-objec.patch index 13df89b0..8a3b1a90 100644 --- a/patches/eventfd_synchronization/0014-ntdll-server-Implement-waiting-on-server-bound-objec.patch +++ b/patches/eventfd_synchronization/0014-ntdll-server-Implement-waiting-on-server-bound-objec.patch @@ -1,4 +1,4 @@ -From 7476e7b2e8680352cf2e1de7552ae58e11ff7869 Mon Sep 17 00:00:00 2001 +From 0ef3de9bd3b51a1e37c50fd75ceb3db6ea24abd0 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 15:19:37 -0500 Subject: [PATCH] ntdll, server: Implement waiting on server-bound objects. @@ -16,14 +16,15 @@ With this patch we break waiting on svcctl.exe. dlls/ntdll/unix/esync.c | 84 ++++++++++++++++++++++++++++++++++++++--- server/esync.c | 16 ++++++++ server/esync.h | 1 + + server/named_pipe.c | 1 + server/thread.c | 4 ++ - 4 files changed, 99 insertions(+), 6 deletions(-) + 5 files changed, 100 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index 4f993689e0d..6fd195df759 100644 +index 65ef70acd36..b0168f5cde5 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -199,6 +199,72 @@ static struct esync *get_cached_object( HANDLE handle ) +@@ -193,6 +193,72 @@ static struct esync *get_cached_object( HANDLE handle ) return &esync_list[entry][idx]; } @@ -96,7 +97,7 @@ index 4f993689e0d..6fd195df759 100644 NTSTATUS esync_close( HANDLE handle ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); -@@ -278,10 +344,11 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) +@@ -272,10 +338,11 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) struct semaphore *semaphore; uint64_t count64 = count; ULONG current; @@ -109,7 +110,7 @@ index 4f993689e0d..6fd195df759 100644 semaphore = obj->shm; do -@@ -320,10 +387,11 @@ NTSTATUS esync_set_event( HANDLE handle ) +@@ -314,10 +381,11 @@ NTSTATUS esync_set_event( HANDLE handle ) { static const uint64_t value = 1; struct esync *obj; @@ -122,7 +123,7 @@ index 4f993689e0d..6fd195df759 100644 if (write( obj->fd, &value, sizeof(value) ) == -1) ERR("write: %s\n", strerror(errno)); -@@ -335,10 +403,11 @@ NTSTATUS esync_reset_event( HANDLE handle ) +@@ -329,10 +397,11 @@ NTSTATUS esync_reset_event( HANDLE handle ) { uint64_t value; struct esync *obj; @@ -135,7 +136,7 @@ index 4f993689e0d..6fd195df759 100644 if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN) ERR("read: %s\n", strerror(errno)); -@@ -427,10 +496,13 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an +@@ -421,10 +490,13 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an for (i = 0; i < count; i++) { @@ -151,7 +152,7 @@ index 4f993689e0d..6fd195df759 100644 } if (has_esync && has_server) -@@ -483,7 +555,7 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an +@@ -477,7 +549,7 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an int64_t value; ssize_t size; @@ -161,10 +162,10 @@ index 4f993689e0d..6fd195df759 100644 /* Don't grab the object, just check if it's signaled. */ if (fds[i].revents & POLLIN) diff --git a/server/esync.c b/server/esync.c -index e18b76bff5b..2b9307267f9 100644 +index 44214e5fe02..60e98936455 100644 --- a/server/esync.c +++ b/server/esync.c -@@ -315,6 +315,22 @@ int esync_create_fd( int initval, int flags ) +@@ -313,6 +313,22 @@ int esync_create_fd( int initval, int flags ) #endif } @@ -188,19 +189,31 @@ index e18b76bff5b..2b9307267f9 100644 { struct esync *esync; diff --git a/server/esync.h b/server/esync.h -index 6a0a367124d..1e12560ddd6 100644 +index 8522d8a69ae..1241e6d9f1a 100644 --- a/server/esync.h +++ b/server/esync.h -@@ -21,3 +21,4 @@ +@@ -23,3 +23,4 @@ extern int do_esync(void); void esync_init(void); int esync_create_fd( int initval, int flags ); +void esync_wake_up( struct object *obj ); +diff --git a/server/named_pipe.c b/server/named_pipe.c +index 68fa8953cca..1535c5188ec 100644 +--- a/server/named_pipe.c ++++ b/server/named_pipe.c +@@ -344,6 +344,7 @@ static const struct object_ops named_pipe_dir_ops = + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ + default_fd_signaled, /* signaled */ ++ NULL, /* get_esync_fd */ + no_satisfied, /* satisfied */ + no_signal, /* signal */ + named_pipe_dir_get_fd, /* get_fd */ diff --git a/server/thread.c b/server/thread.c -index 1e6f60182df..0413e889c7d 100644 +index 339cdfec1fa..4262b841fca 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -51,6 +51,7 @@ +@@ -50,6 +50,7 @@ #include "request.h" #include "user.h" #include "security.h" @@ -208,7 +221,7 @@ index 1e6f60182df..0413e889c7d 100644 /* thread queues */ -@@ -1053,6 +1054,9 @@ void wake_up( struct object *obj, int max ) +@@ -1073,6 +1074,9 @@ void wake_up( struct object *obj, int max ) struct list *ptr; int ret; @@ -219,5 +232,5 @@ index 1e6f60182df..0413e889c7d 100644 { struct wait_queue_entry *entry = LIST_ENTRY( ptr, struct wait_queue_entry, entry ); -- -2.30.2 +2.45.2 diff --git a/patches/user32-rawinput-mouse/0003-winex11-Add-support-for-absolute-position-in-RawMoti.patch b/patches/user32-rawinput-mouse/0003-winex11-Add-support-for-absolute-position-in-RawMoti.patch index e6e86788..c7901b1d 100644 --- a/patches/user32-rawinput-mouse/0003-winex11-Add-support-for-absolute-position-in-RawMoti.patch +++ b/patches/user32-rawinput-mouse/0003-winex11-Add-support-for-absolute-position-in-RawMoti.patch @@ -1,4 +1,4 @@ -From 8e45c14f92426d1a9610ef21f0f3223b7276b13f Mon Sep 17 00:00:00 2001 +From cd57704c5a232a8ed0beb3b951fb0b4a06d28b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Mar 2024 11:15:57 +0100 Subject: [PATCH] winex11: Add support for absolute position in RawMotion @@ -9,7 +9,7 @@ Subject: [PATCH] winex11: Add support for absolute position in RawMotion 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c -index b596ec546b4..59fbd2bbe52 100644 +index 43df1408f39..6b0fb873fad 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -30,6 +30,7 @@ @@ -52,7 +52,7 @@ index b596ec546b4..59fbd2bbe52 100644 thread_data->x_valuator.value = 0; thread_data->y_valuator.value = 0; -@@ -1669,6 +1680,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +@@ -1667,6 +1678,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator; @@ -60,11 +60,11 @@ index b596ec546b4..59fbd2bbe52 100644 double x_value = 0, y_value = 0, x_scale, y_scale; const double *values = event->valuators.values; RECT virtual_rect; -@@ -1679,7 +1691,15 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +@@ -1677,7 +1689,15 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) if (!xinput2_available) return FALSE; if (event->deviceid != thread_data->xinput2_pointer) return FALSE; -- virtual_rect = NtUserGetVirtualScreenRect( MDT_DEFAULT ); +- virtual_rect = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); + if (x->mode == XIModeRelative && y->mode == XIModeRelative) + input->mi.dwFlags &= ~absolute_flags; + else if (x->mode == XIModeAbsolute && y->mode == XIModeAbsolute) @@ -73,11 +73,11 @@ index b596ec546b4..59fbd2bbe52 100644 + FIXME( "Unsupported relative/absolute X/Y axis mismatch\n." ); + + if (input->mi.dwFlags & MOUSEEVENTF_VIRTUALDESK) SetRect( &virtual_rect, 0, 0, UINT16_MAX, UINT16_MAX ); -+ else virtual_rect = NtUserGetVirtualScreenRect( MDT_DEFAULT ); ++ else virtual_rect = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); if (x->max <= x->min) x_scale = 1; else x_scale = (virtual_rect.right - virtual_rect.left) / (x->max - x->min); -@@ -1692,17 +1712,26 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +@@ -1690,17 +1710,26 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) if (i == x->number) { x_value = *values; diff --git a/staging/upstream-commit b/staging/upstream-commit index 24d124e2..2838e2c9 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -83febc6b55cf9e7f97299e391771b9ad0d1f1ceb +eeabbe812ffc3ed7c06fc85cd63f0d85bffe207e