From 305d89f1ed313dc74941b755be4848ab85d111b8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 14 Sep 2016 15:29:03 +0900 Subject: [PATCH] server: Return the owner window in the close_clipboard request. Signed-off-by: Alexandre Julliard --- dlls/user32/clipboard.c | 10 +++++----- include/wine/server_protocol.h | 4 ++-- server/clipboard.c | 2 +- server/protocol.def | 2 +- server/trace.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 01fdde7d224..dc947947de5 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -546,8 +546,8 @@ BOOL WINAPI OpenClipboard( HWND hwnd ) */ BOOL WINAPI CloseClipboard(void) { - HWND viewer = 0; - BOOL ret, owner = FALSE; + HWND viewer = 0, owner = 0; + BOOL ret; TRACE("() Changed=%d\n", bCBHasChanged); @@ -565,7 +565,7 @@ BOOL WINAPI CloseClipboard(void) if ((ret = !wine_server_call_err( req ))) { viewer = wine_server_ptr_handle( reply->viewer ); - owner = reply->owner; + owner = wine_server_ptr_handle( reply->owner ); } } SERVER_END_REQ; @@ -574,10 +574,10 @@ BOOL WINAPI CloseClipboard(void) if (bCBHasChanged) { - if (owner) USER_Driver->pEndClipboardUpdate(); + USER_Driver->pEndClipboardUpdate(); bCBHasChanged = FALSE; } - if (viewer) SendNotifyMessageW( viewer, WM_DRAWCLIPBOARD, (WPARAM)GetClipboardOwner(), 0 ); + if (viewer) SendNotifyMessageW( viewer, WM_DRAWCLIPBOARD, (WPARAM)owner, 0 ); return TRUE; } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e71e98be814..bd55a0f2626 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4483,7 +4483,7 @@ struct close_clipboard_reply { struct reply_header __header; user_handle_t viewer; - int owner; + user_handle_t owner; }; @@ -6365,6 +6365,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 516 +#define SERVER_PROTOCOL_VERSION 517 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/clipboard.c b/server/clipboard.c index a5e0c37dd3c..43172ae9016 100644 --- a/server/clipboard.c +++ b/server/clipboard.c @@ -293,7 +293,7 @@ DECL_HANDLER(close_clipboard) if (req->changed) clipboard->seqno++; reply->viewer = close_clipboard( clipboard ); - reply->owner = (clipboard->owner_thread && clipboard->owner_thread->process == current->process); + reply->owner = clipboard->owner_win; } diff --git a/server/protocol.def b/server/protocol.def index 3a4f9c16e49..e17cf23ac60 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3171,7 +3171,7 @@ enum caret_state int changed; /* did it change since the open? */ @REPLY user_handle_t viewer; /* first clipboard viewer */ - int owner; /* is the process already the owner? */ + user_handle_t owner; /* current clipboard owner */ @END diff --git a/server/trace.c b/server/trace.c index db52b0af139..bcd7998da64 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3752,7 +3752,7 @@ static void dump_close_clipboard_request( const struct close_clipboard_request * static void dump_close_clipboard_reply( const struct close_clipboard_reply *req ) { fprintf( stderr, " viewer=%08x", req->viewer ); - fprintf( stderr, ", owner=%d", req->owner ); + fprintf( stderr, ", owner=%08x", req->owner ); } static void dump_set_clipboard_info_request( const struct set_clipboard_info_request *req )