From 85358b10f35e829ba42da8f46a40a8fd7eee6f9a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 31 Mar 2011 20:25:45 +0200 Subject: [PATCH] server: Add a more general way of posting messages to the desktop window. --- server/user.h | 3 ++- server/window.c | 7 ++++--- server/winstation.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/user.h b/server/user.h index cc603cfe29f..2a3f36985cf 100644 --- a/server/user.h +++ b/server/user.h @@ -143,7 +143,8 @@ extern int rect_in_region( struct region *region, const rectangle_t *rect ); extern struct process *get_top_window_owner( struct desktop *desktop ); extern void get_top_window_rectangle( struct desktop *desktop, rectangle_t *rect ); -extern void close_desktop_window( struct desktop *desktop ); +extern void post_desktop_message( struct desktop *desktop, unsigned int message, + lparam_t wparam, lparam_t lparam ); extern void destroy_window( struct window *win ); extern void destroy_thread_windows( struct thread *thread ); extern int is_child_window( user_handle_t parent, user_handle_t child ); diff --git a/server/window.c b/server/window.c index 0fbce24c8d3..3465eba296f 100644 --- a/server/window.c +++ b/server/window.c @@ -402,11 +402,12 @@ void get_top_window_rectangle( struct desktop *desktop, rectangle_t *rect ) else *rect = win->window_rect; } -/* attempt to close the desktop window when the last process using it is gone */ -void close_desktop_window( struct desktop *desktop ) +/* post a message to the desktop window */ +void post_desktop_message( struct desktop *desktop, unsigned int message, + lparam_t wparam, lparam_t lparam ) { struct window *win = desktop->top_window; - if (win && win->thread) post_message( win->handle, WM_CLOSE, 0, 0 ); + if (win && win->thread) post_message( win->handle, message, wparam, lparam ); } /* create a new window structure (note: the window is not linked in the window tree) */ diff --git a/server/winstation.c b/server/winstation.c index 7b01919d6e9..20656aa454a 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -376,7 +376,7 @@ static void close_desktop_timeout( void *private ) desktop->close_timeout = NULL; unlink_named_object( &desktop->obj ); /* make sure no other process can open it */ - close_desktop_window( desktop ); /* and signal the owner to quit */ + post_desktop_message( desktop, WM_CLOSE, 0, 0 ); /* and signal the owner to quit */ } /* close the desktop of a given process */