Alexandre Julliard : user32: Add an UpdateClipboard entry point to allow the driver to refresh the clipboard before it 's open.

Alexandre Julliard julliard at winehq.org
Fri Sep 23 10:25:16 CDT 2016


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Sep 23 14:07:08 2016 +0900

user32: Add an UpdateClipboard entry point to allow the driver to refresh the clipboard before it's open.

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

---

 dlls/user32/clipboard.c    | 14 ++++++++++++--
 dlls/user32/driver.c       | 12 ++++++++++++
 dlls/user32/user_private.h |  1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c
index 1693aae..43729e6 100644
--- a/dlls/user32/clipboard.c
+++ b/dlls/user32/clipboard.c
@@ -523,6 +523,8 @@ BOOL WINAPI OpenClipboard( HWND hwnd )
 
     TRACE( "%p\n", hwnd );
 
+    USER_Driver->pUpdateClipboard();
+
     SERVER_START_REQ( open_clipboard )
     {
         req->window = wine_server_user_handle( hwnd );
@@ -759,7 +761,11 @@ HANDLE WINAPI SetClipboardData( UINT format, HANDLE data )
  */
 INT WINAPI CountClipboardFormats(void)
 {
-    INT count = USER_Driver->pCountClipboardFormats();
+    INT count;
+
+    USER_Driver->pUpdateClipboard();
+
+    count = USER_Driver->pCountClipboardFormats();
     TRACE("returning %d\n", count);
     return count;
 }
@@ -790,7 +796,11 @@ UINT WINAPI EnumClipboardFormats( UINT format )
  */
 BOOL WINAPI IsClipboardFormatAvailable( UINT format )
 {
-    BOOL ret = USER_Driver->pIsClipboardFormatAvailable( format );
+    BOOL ret;
+
+    USER_Driver->pUpdateClipboard();
+
+    ret = USER_Driver->pIsClipboardFormatAvailable( format );
     TRACE( "%s -> %u\n", debugstr_format( format ), ret );
     return ret;
 }
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c
index 32acf28..1745b50 100644
--- a/dlls/user32/driver.c
+++ b/dlls/user32/driver.c
@@ -128,6 +128,7 @@ static const USER_DRIVER *load_driver(void)
         GET_USER_FUNC(EnumClipboardFormats);
         GET_USER_FUNC(IsClipboardFormatAvailable);
         GET_USER_FUNC(EndClipboardUpdate);
+        GET_USER_FUNC(UpdateClipboard);
         GET_USER_FUNC(ChangeDisplaySettingsEx);
         GET_USER_FUNC(EnumDisplayMonitors);
         GET_USER_FUNC(EnumDisplaySettingsEx);
@@ -369,6 +370,10 @@ static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL own
     return FALSE;
 }
 
+static void CDECL nulldrv_UpdateClipboard(void)
+{
+}
+
 static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
                                              DWORD flags, LPVOID lparam )
 {
@@ -548,6 +553,7 @@ static USER_DRIVER null_driver =
     nulldrv_GetClipboardData,
     nulldrv_IsClipboardFormatAvailable,
     nulldrv_SetClipboardData,
+    nulldrv_UpdateClipboard,
     /* display modes */
     nulldrv_ChangeDisplaySettingsEx,
     nulldrv_EnumDisplayMonitors,
@@ -716,6 +722,11 @@ static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL o
     return load_driver()->pSetClipboardData( format, handle, owner );
 }
 
+static void CDECL loaderdrv_UpdateClipboard(void)
+{
+    load_driver()->pUpdateClipboard();
+}
+
 static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
                                                      DWORD flags, LPVOID lparam )
 {
@@ -805,6 +816,7 @@ static USER_DRIVER lazy_load_driver =
     loaderdrv_GetClipboardData,
     loaderdrv_IsClipboardFormatAvailable,
     loaderdrv_SetClipboardData,
+    loaderdrv_UpdateClipboard,
     /* display modes */
     loaderdrv_ChangeDisplaySettingsEx,
     loaderdrv_EnumDisplayMonitors,
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index c8b283a..3b9b200 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -87,6 +87,7 @@ typedef struct tagUSER_DRIVER {
     HANDLE (CDECL *pGetClipboardData)(UINT);                     /* Get specified selection data */
     BOOL   (CDECL *pIsClipboardFormatAvailable)(UINT);           /* Check if specified format is available */
     BOOL   (CDECL *pSetClipboardData)(UINT, HANDLE, BOOL);       /* Set specified selection data */
+    void   (CDECL *pUpdateClipboard)(void);
     /* display modes */
     LONG   (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
     BOOL   (CDECL *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);




More information about the wine-cvs mailing list