Skip to content

Commit

Permalink
Update patchset 233 from Proton.
Browse files Browse the repository at this point in the history
  • Loading branch information
openglfreak committed Jan 24, 2021
1 parent c34dae4 commit 5448128
Show file tree
Hide file tree
Showing 17 changed files with 1,448 additions and 96 deletions.
81 changes: 52 additions & 29 deletions ps0233-p0001-server-Create-a-desktop-shared-mapping.mypatch
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
From 9825767d24230aea712ee1d756beb273c136b69b Mon Sep 17 00:00:00 2001
From: Huw Davies <huw@codeweavers.com>
Subject: [PATCH 1/5] server: Create a desktop shared mapping.
Message-Id: <20201119130931.89653-1-huw@codeweavers.com>
Date: Thu, 19 Nov 2020 13:09:27 +0000
Date: Fri, 19 Jun 2020 16:06:17 +0100
Subject: [PATCH 01/15] server: Create a desktop shared mapping.

Signed-off-by: Huw Davies <huw@codeweavers.com>
---
server/directory.c | 17 +++++++++++++++++
server/file.h | 6 ++++++
server/mapping.c | 19 ++++++++++++++++++-
server/protocol.def | 5 +++++
server/user.h | 28 +++++++++++++++-------------
server/winstation.c | 22 ++++++++++++++++++++++
6 files changed, 83 insertions(+), 14 deletions(-)
include/wine/server_protocol.h | 7 ++++++-
server/directory.c | 17 +++++++++++++++++
server/file.h | 6 ++++++
server/mapping.c | 19 ++++++++++++++++++-
server/protocol.def | 5 +++++
server/user.h | 28 +++++++++++++++-------------
server/winstation.c | 22 ++++++++++++++++++++++
7 files changed, 89 insertions(+), 15 deletions(-)

diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index aed7090572b..0b956894110 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -800,6 +800,11 @@ struct cpu_topology_override
unsigned char host_cpu_id[64];
};

+struct desktop_shared_memory
+{
+ int placeholder;
+};
+



@@ -6721,7 +6726,7 @@ union generic_reply

/* ### protocol_version begin ### */

-#define SERVER_PROTOCOL_VERSION 655
+#define SERVER_PROTOCOL_VERSION 656

/* ### protocol_version end ### */

diff --git a/server/directory.c b/server/directory.c
index 6f8fb179808..a54ca0e91f3 100644
index 386d615fcf7..d6c7330a60e 100644
--- a/server/directory.c
+++ b/server/directory.c
@@ -38,6 +38,7 @@
Expand All @@ -25,7 +51,7 @@ index 6f8fb179808..a54ca0e91f3 100644

#define HASH_SIZE 7 /* default hash size */

@@ -240,6 +241,22 @@ struct object_type *get_object_type( const struct unicode_str *name )
@@ -248,6 +249,22 @@ struct object_type *get_object_type( const struct unicode_str *name )
return type;
}

Expand All @@ -49,10 +75,10 @@ index 6f8fb179808..a54ca0e91f3 100644

static void create_session( unsigned int id )
diff --git a/server/file.h b/server/file.h
index 2fb634fad8d..9c376e4c483 100644
index bfe14ec353a..f688a19d174 100644
--- a/server/file.h
+++ b/server/file.h
@@ -151,6 +151,10 @@ extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback f
@@ -156,6 +156,10 @@ extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback f
extern void remove_timeout_user( struct timeout_user *user );
extern const char *get_timeout_str( timeout_t timeout );

Expand All @@ -63,7 +89,7 @@ index 2fb634fad8d..9c376e4c483 100644
/* file functions */

extern struct file *get_file_obj( struct process *process, obj_handle_t handle,
@@ -173,6 +177,8 @@ extern void free_mapped_views( struct process *process );
@@ -178,6 +182,8 @@ extern void free_mapped_views( struct process *process );
extern int get_page_size(void);
extern struct object *create_user_data_mapping( struct object *root, const struct unicode_str *name,
unsigned int attr, const struct security_descriptor *sd );
Expand All @@ -73,10 +99,10 @@ index 2fb634fad8d..9c376e4c483 100644
/* device functions */

diff --git a/server/mapping.c b/server/mapping.c
index 769a986ae21..48bc7361977 100644
index 8d9890d4619..e4418879703 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -959,7 +959,7 @@ int get_page_size(void)
@@ -962,7 +962,7 @@ int get_page_size(void)
}

struct object *create_user_data_mapping( struct object *root, const struct unicode_str *name,
Expand All @@ -85,7 +111,7 @@ index 769a986ae21..48bc7361977 100644
{
void *ptr;
struct mapping *mapping;
@@ -975,6 +975,23 @@ struct object *create_user_data_mapping( struct object *root, const struct unico
@@ -978,6 +978,23 @@ struct object *create_user_data_mapping( struct object *root, const struct unico
return &mapping->obj;
}

Expand All @@ -110,12 +136,12 @@ index 769a986ae21..48bc7361977 100644
DECL_HANDLER(create_mapping)
{
diff --git a/server/protocol.def b/server/protocol.def
index a3708f20705..c1c33d7e3d1 100644
index 0f2fe077b80..7a561ee45c1 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -796,6 +796,11 @@ typedef struct
lparam_t info;
} cursor_pos_t;
@@ -816,6 +816,11 @@ struct cpu_topology_override
unsigned char host_cpu_id[64];
};

+struct desktop_shared_memory
+{
Expand Down Expand Up @@ -167,10 +193,10 @@ index 6267f3e2881..9a28ba7f449 100644

/* user handles functions */
diff --git a/server/winstation.c b/server/winstation.c
index c9c85e50fff..7cf62f27e89 100644
index e4100e316ec..a3f6cfbfdf3 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -210,6 +210,22 @@ struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle, u
@@ -212,6 +212,22 @@ struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle, u
return (struct desktop *)get_handle_obj( process, handle, access, &desktop_ops );
}

Expand All @@ -193,7 +219,7 @@ index c9c85e50fff..7cf62f27e89 100644
/* create a desktop object */
static struct desktop *create_desktop( const struct unicode_str *name, unsigned int attr,
unsigned int flags, struct winstation *winstation )
@@ -233,6 +249,11 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
@@ -235,6 +251,11 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
memset( desktop->keystate, 0, sizeof(desktop->keystate) );
list_add_tail( &winstation->desktops, &desktop->entry );
list_init( &desktop->hotkeys );
Expand All @@ -205,7 +231,7 @@ index c9c85e50fff..7cf62f27e89 100644
}
else clear_error();
}
@@ -293,6 +314,7 @@ static void desktop_destroy( struct object *obj )
@@ -295,6 +316,7 @@ static void desktop_destroy( struct object *obj )
if (desktop->global_hooks) release_object( desktop->global_hooks );
if (desktop->close_timeout) remove_timeout_user( desktop->close_timeout );
list_remove( &desktop->entry );
Expand All @@ -214,6 +240,3 @@ index c9c85e50fff..7cf62f27e89 100644
}


--
2.23.0

Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
From c664dccf746da80efd88444e6e13a0b345c181ca Mon Sep 17 00:00:00 2001
From: Huw Davies <huw@codeweavers.com>
Subject: [PATCH 2/5] server: Use the helper to update the cursor last change time.
Message-Id: <20201119130931.89653-2-huw@codeweavers.com>
Date: Thu, 19 Nov 2020 13:09:28 +0000
Date: Mon, 29 Jun 2020 11:12:12 +0100
Subject: [PATCH 02/15] server: Use the helper to update the cursor last change
time.

Signed-off-by: Huw Davies <huw@codeweavers.com>
---
server/queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/queue.c b/server/queue.c
index 7e7e6fbdf29..935475b4c09 100644
index 36ff33b7da1..b945c96f7ea 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1737,7 +1737,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1803,7 +1803,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
WM_MOUSEHWHEEL /* 0x1000 = MOUSEEVENTF_HWHEEL */
};

Expand All @@ -22,6 +23,3 @@ index 7e7e6fbdf29..935475b4c09 100644
time = input->mouse.time;
if (!time) time = desktop->cursor.last_change;

--
2.23.0

Original file line number Diff line number Diff line change
@@ -1,22 +1,55 @@
From f663f9eb66e2d7ca42a6b2b05c71938924e45c9e Mon Sep 17 00:00:00 2001
From: Huw Davies <huw@codeweavers.com>
Subject: [PATCH 3/5] server: Move the cursor position and last change time to the shared data.
Message-Id: <20201119130931.89653-3-huw@codeweavers.com>
Date: Thu, 19 Nov 2020 13:09:29 +0000
Date: Mon, 29 Jun 2020 11:30:14 +0100
Subject: [PATCH 03/15] server: Move the cursor position and last change time
to the shared data.

Signed-off-by: Huw Davies <huw@codeweavers.com>
---
server/protocol.def | 9 ++++++-
server/queue.c | 62 ++++++++++++++++++++++-----------------------
server/user.h | 3 ---
3 files changed, 39 insertions(+), 35 deletions(-)
include/wine/server_protocol.h | 11 ++++--
server/protocol.def | 9 ++++-
server/queue.c | 62 +++++++++++++++++-----------------
server/user.h | 3 --
4 files changed, 48 insertions(+), 37 deletions(-)

diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 0b956894110..ba6d198f95d 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -800,9 +800,16 @@ struct cpu_topology_override
unsigned char host_cpu_id[64];
};

+struct shared_cursor
+{
+ int x;
+ int y;
+ unsigned int last_change;
+};
+
struct desktop_shared_memory
{
- int placeholder;
+ struct shared_cursor cursor;
};


@@ -6726,7 +6733,7 @@ union generic_reply

/* ### protocol_version begin ### */

-#define SERVER_PROTOCOL_VERSION 656
+#define SERVER_PROTOCOL_VERSION 657

/* ### protocol_version end ### */

diff --git a/server/protocol.def b/server/protocol.def
index c1c33d7e3d1..d61d7f3c549 100644
index 7a561ee45c1..3ea38463f80 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -796,9 +796,16 @@ typedef struct
lparam_t info;
} cursor_pos_t;
@@ -816,9 +816,16 @@ struct cpu_topology_override
unsigned char host_cpu_id[64];
};

+struct shared_cursor
+{
Expand All @@ -33,10 +66,10 @@ index c1c33d7e3d1..d61d7f3c549 100644

/****************************************************************/
diff --git a/server/queue.c b/server/queue.c
index 935475b4c09..f6664509ee3 100644
index b945c96f7ea..e6ebfd2d0b5 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -377,10 +377,10 @@ static int update_desktop_cursor_pos( struct desktop *desktop, int x, int y )
@@ -397,10 +397,10 @@ static int update_desktop_cursor_pos( struct desktop *desktop, int x, int y )

x = max( min( x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left );
y = max( min( y, desktop->cursor.clip.bottom - 1 ), desktop->cursor.clip.top );
Expand All @@ -51,7 +84,7 @@ index 935475b4c09..f6664509ee3 100644

return updated;
}
@@ -411,8 +411,8 @@ static void get_message_defaults( struct msg_queue *queue, int *x, int *y, unsig
@@ -431,8 +431,8 @@ static void get_message_defaults( struct msg_queue *queue, int *x, int *y, unsig
{
struct desktop *desktop = queue->input->desktop;

Expand All @@ -62,7 +95,7 @@ index 935475b4c09..f6664509ee3 100644
*time = get_tick_count();
}

@@ -439,9 +439,9 @@ static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect
@@ -459,9 +459,9 @@ static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect
post_desktop_message( desktop, desktop->cursor.clip_msg, rect != NULL, 0 );

/* warp the mouse to be inside the clip rect */
Expand All @@ -75,7 +108,7 @@ index 935475b4c09..f6664509ee3 100644
}

/* change the foreground input and reset the cursor clip rect */
@@ -1568,8 +1568,8 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg
@@ -1615,8 +1615,8 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg
if (desktop->keystate[VK_XBUTTON1] & 0x80) msg->wparam |= MK_XBUTTON1;
if (desktop->keystate[VK_XBUTTON2] & 0x80) msg->wparam |= MK_XBUTTON2;
}
Expand All @@ -86,7 +119,7 @@ index 935475b4c09..f6664509ee3 100644

if (msg->win && (thread = get_window_thread( msg->win )))
{
@@ -1737,10 +1737,10 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1803,10 +1803,10 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
WM_MOUSEHWHEEL /* 0x1000 = MOUSEEVENTF_HWHEEL */
};

Expand All @@ -99,7 +132,7 @@ index 935475b4c09..f6664509ee3 100644

if (flags & MOUSEEVENTF_MOVE)
{
@@ -1749,19 +1749,19 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1815,19 +1815,19 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
x = input->mouse.x;
y = input->mouse.y;
if (flags & ~(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE) &&
Expand All @@ -124,7 +157,7 @@ index 935475b4c09..f6664509ee3 100644
}

if ((foreground = get_foreground_thread( desktop, win )))
#@@ -1775,8 +1775,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
#@@ -1843,8 +1843,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
# msg_data->info = input->mouse.info;
# msg_data->flags = flags;
# msg_data->rawinput.type = RIM_TYPEMOUSE;
Expand All @@ -134,8 +167,8 @@ index 935475b4c09..f6664509ee3 100644
#+ msg_data->rawinput.mouse.y = y - desktop->shared->cursor.y;
# msg_data->rawinput.mouse.data = input->mouse.data;
#
# enum_processes( queue_rawinput_message, &raw_msg );
@@ -1967,8 +1967,8 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
# if ((req_flags & SEND_HWMSG_RAWINPUT))
@@ -2045,8 +2045,8 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
msg->msg = input->hw.msg;
msg->wparam = 0;
msg->lparam = input->hw.lparam;
Expand All @@ -146,7 +179,7 @@ index 935475b4c09..f6664509ee3 100644

queue_hardware_message( desktop, msg, 1 );
}
@@ -2473,8 +2473,8 @@ DECL_HANDLER(send_hardware_message)
@@ -2586,8 +2586,8 @@ DECL_HANDLER(send_hardware_message)
}
}

Expand All @@ -157,7 +190,7 @@ index 935475b4c09..f6664509ee3 100644

switch (req->input.type)
{
@@ -2492,8 +2492,8 @@ DECL_HANDLER(send_hardware_message)
@@ -2614,8 +2614,8 @@ DECL_HANDLER(send_hardware_message)
}
if (thread) release_object( thread );

Expand All @@ -168,7 +201,7 @@ index 935475b4c09..f6664509ee3 100644
set_reply_data( desktop->keystate, size );
release_object( desktop );
}
@@ -3202,8 +3202,8 @@ DECL_HANDLER(set_cursor)
@@ -3325,8 +3325,8 @@ DECL_HANDLER(set_cursor)

reply->prev_handle = input->cursor;
reply->prev_count = input->cursor_count;
Expand All @@ -179,7 +212,7 @@ index 935475b4c09..f6664509ee3 100644

if (req->flags & SET_CURSOR_HANDLE)
{
@@ -3234,10 +3234,10 @@ DECL_HANDLER(set_cursor)
@@ -3357,10 +3357,10 @@ DECL_HANDLER(set_cursor)
set_clip_rectangle( desktop, (req->flags & SET_CURSOR_NOCLIP) ? NULL : &req->clip, 0 );
}

Expand Down Expand Up @@ -210,6 +243,3 @@ index 9a28ba7f449..e525957c5bc 100644
};


--
2.23.0

Loading

0 comments on commit 5448128

Please sign in to comment.