From d9df977006bceb883ccd68afb9b57a0da3ae4112 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 23 Aug 2016 17:57:50 +0900 Subject: [PATCH] user32: Don't disallow delayed rendering even when not the clipboard owner. Signed-off-by: Alexandre Julliard --- dlls/user32/clipboard.c | 8 -------- dlls/user32/tests/clipboard.c | 2 +- dlls/winex11.drv/clipboard.c | 6 ++---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index c72a76b8842..251eadb73db 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -352,14 +352,6 @@ HANDLE WINAPI SetClipboardData(UINT wFormat, HANDLE hData) return 0; } - /* If it's not owned, data can only be set if the format isn't - available and its rendering is not delayed */ - if (!(flags & CB_OWNER) && !hData) - { - WARN("Clipboard not owned by calling task. Operation failed.\n"); - return 0; - } - if (USER_Driver->pSetClipboardData(wFormat, hData, flags & CB_OWNER)) { hResult = hData; diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 33a9c6916c6..ddd8d1a0753 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -65,7 +65,7 @@ static DWORD WINAPI set_clipboard_data_thread(LPVOID arg) if (GetClipboardOwner() == hwnd) { SetClipboardData( CF_WAVE, 0 ); - todo_wine ok( IsClipboardFormatAvailable( CF_WAVE ), "%u: SetClipboardData failed\n", thread_from_line ); + ok( IsClipboardFormatAvailable( CF_WAVE ), "%u: SetClipboardData failed\n", thread_from_line ); ret = SetClipboardData( CF_WAVE, GlobalAlloc( GMEM_DDESHARE | GMEM_ZEROINIT, 100 )); ok( ret != 0, "%u: SetClipboardData failed err %u\n", thread_from_line, GetLastError() ); } diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 9b8ff654f42..b7c89cb654b 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -3016,16 +3016,14 @@ BOOL CDECL X11DRV_SetClipboardData(UINT wFormat, HANDLE hData, BOOL owner) DWORD flags = 0; BOOL bResult = TRUE; - /* If it's not owned, data can only be set if the format data is not already owned - and its rendering is not delayed */ + /* If it's not owned, data can only be set if the format data is not already owned */ if (!owner) { LPWINE_CLIPDATA lpRender; X11DRV_CLIPBOARD_UpdateCache(); - if (!hData || - ((lpRender = X11DRV_CLIPBOARD_LookupData(wFormat)) && + if (((lpRender = X11DRV_CLIPBOARD_LookupData(wFormat)) && !(lpRender->wFlags & CF_FLAG_UNOWNED))) bResult = FALSE; else