Alexandre Julliard : winex11: Use standard clipboard APIs to retrieve the data to export.
Alexandre Julliard
julliard at winehq.org
Wed Sep 21 10:14:51 CDT 2016
Module: wine
Branch: master
Commit: 96930bdc04fd2f61ba58e7a9ef15170fd8ad1232
URL: http://source.winehq.org/git/wine.git/?a=commit;h=96930bdc04fd2f61ba58e7a9ef15170fd8ad1232
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Sep 21 13:34:32 2016 +0900
winex11: Use standard clipboard APIs to retrieve the data to export.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winex11.drv/clipboard.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index f4c8866..dcb1403 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -1744,20 +1744,26 @@ static BOOL export_selection( Display *display, Window win, Atom prop, Atom targ
{
struct clipboard_format *format = X11DRV_CLIPBOARD_LookupProperty( NULL, target );
HANDLE handle = 0;
+ BOOL ret = FALSE;
if (!format || !format->export) return FALSE;
TRACE( "win %lx prop %s target %s exporting %s\n", win,
debugstr_xatom( prop ), debugstr_xatom( target ), debugstr_format( format->id ) );
- if (format->id)
+ if (!format->id) return format->export( display, win, prop, target, 0 );
+
+ if (!OpenClipboard( 0 ))
{
- LPWINE_CLIPDATA data = X11DRV_CLIPBOARD_LookupData( format->id );
- if (!data) return FALSE;
- if (!X11DRV_CLIPBOARD_RenderFormat( display, data )) return FALSE;
- handle = data->hData;
+ ERR( "failed to open clipboard for %s\n", debugstr_format( format->id ));
+ return FALSE;
}
- return format->export( display, win, prop, target, handle );
+
+ if ((handle = GetClipboardData( format->id )))
+ ret = format->export( display, win, prop, target, handle );
+
+ CloseClipboard();
+ return ret;
}
More information about the wine-cvs
mailing list