Alexandre Julliard : winex11: Use standard clipboard APIs to retrieve the data to export.
Module: wine Branch: master Commit: 96930bdc04fd2f61ba58e7a9ef15170fd8ad1232 URL: http://source.winehq.org/git/wine.git/?a=commit;h=96930bdc04fd2f61ba58e7a9ef... Author: Alexandre Julliard <julliard(a)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(a)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; }
participants (1)
-
Alexandre Julliard