server: Move the desktop flags to the shared memory.

This commit is contained in:
Rémi Bernon 2024-06-21 22:27:44 +02:00 committed by Alexandre Julliard
parent 1e1fb212ad
commit d0d94195a6
Notes: Alexandre Julliard 2024-07-03 23:43:42 +02:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/5984
4 changed files with 21 additions and 9 deletions

View file

@ -893,6 +893,7 @@ struct shared_cursor
typedef volatile struct
{
unsigned int flags;
struct shared_cursor cursor;
unsigned char keystate[256];
} desktop_shm_t;
@ -6591,7 +6592,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 821
#define SERVER_PROTOCOL_VERSION 822
/* ### protocol_version end ### */

View file

@ -909,6 +909,7 @@ struct shared_cursor
typedef volatile struct
{
unsigned int flags; /* desktop flags */
struct shared_cursor cursor; /* global cursor information */
unsigned char keystate[256]; /* asynchronous key state */
} desktop_shm_t;

View file

@ -67,7 +67,6 @@ struct key_repeat
struct desktop
{
struct object obj; /* object header */
unsigned int flags; /* desktop flags */
struct winstation *winstation; /* winstation this desktop belongs to */
timeout_t input_time; /* last time this desktop had the input */
struct list entry; /* entry in winstation list of desktops */

View file

@ -274,13 +274,11 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
{
/* initialize it if it didn't already exist */
desktop->flags = flags;
/* inherit DF_WINE_*_DESKTOP flags if none of them are specified */
if (!(flags & (DF_WINE_ROOT_DESKTOP | DF_WINE_VIRTUAL_DESKTOP))
&& (current_desktop = get_thread_desktop( current, 0 )))
{
desktop->flags |= current_desktop->flags & (DF_WINE_VIRTUAL_DESKTOP | DF_WINE_ROOT_DESKTOP);
flags |= current_desktop->shared->flags & (DF_WINE_VIRTUAL_DESKTOP | DF_WINE_ROOT_DESKTOP);
release_object( current_desktop );
}
@ -308,6 +306,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
SHARED_WRITE_BEGIN( desktop->shared, desktop_shm_t )
{
shared->flags = flags;
shared->cursor.x = 0;
shared->cursor.y = 0;
shared->cursor.last_change = 0;
@ -321,7 +320,12 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
}
else
{
desktop->flags |= flags & (DF_WINE_VIRTUAL_DESKTOP | DF_WINE_ROOT_DESKTOP);
SHARED_WRITE_BEGIN( desktop->shared, desktop_shm_t )
{
shared->flags |= flags & (DF_WINE_VIRTUAL_DESKTOP | DF_WINE_ROOT_DESKTOP);
}
SHARED_WRITE_END;
clear_error();
}
}
@ -333,7 +337,7 @@ static void desktop_dump( struct object *obj, int verbose )
struct desktop *desktop = (struct desktop *)obj;
fprintf( stderr, "Desktop flags=%x winstation=%p top_win=%p hooks=%p\n",
desktop->flags, desktop->winstation, desktop->top_window, desktop->global_hooks );
desktop->shared->flags, desktop->winstation, desktop->top_window, desktop->global_hooks );
}
static int desktop_link_name( struct object *obj, struct object_name *name, struct object *parent )
@ -839,8 +843,15 @@ DECL_HANDLER(set_user_object_info)
{
struct desktop *desktop = (struct desktop *)obj;
reply->is_desktop = 1;
reply->old_obj_flags = desktop->flags;
if (req->flags & SET_USER_OBJECT_SET_FLAGS) desktop->flags = req->obj_flags;
reply->old_obj_flags = desktop->shared->flags;
if (req->flags & SET_USER_OBJECT_SET_FLAGS)
{
SHARED_WRITE_BEGIN( desktop->shared, desktop_shm_t )
{
shared->flags = req->obj_flags;
}
SHARED_WRITE_END;
}
}
else if (obj->ops == &winstation_ops)
{