Alexandre Julliard : server: Return the owner window in the close_clipboard request.

Alexandre Julliard julliard at winehq.org
Wed Sep 14 10:28:51 CDT 2016


Module: wine
Branch: master
Commit: 305d89f1ed313dc74941b755be4848ab85d111b8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=305d89f1ed313dc74941b755be4848ab85d111b8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep 14 15:29:03 2016 +0900

server: Return the owner window in the close_clipboard request.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 01fdde7..dc94794 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 e71e98b..bd55a0f 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 a5e0c37..43172ae 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 3a4f9c1..e17cf23 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 db52b0a..bcd7998 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 )




More information about the wine-cvs mailing list