From 04783e11c995fb1ffa2dcd91ebc494ad35ce898b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Feb 2016 21:43:16 +0100 Subject: w32_common: switch to UniformResourceLocatorW This is the "unicode" version of it. It appears Firefox uses it now? I'm not sure if we still need to support the old variant, but hopefully not. Fixes #2782. --- video/out/w32_common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 6eac4cde61..d26de3b079 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -272,8 +272,9 @@ static HRESULT STDMETHODCALLTYPE DropTarget_Drop(IDropTarget* This, } else if (pDataObj->lpVtbl->GetData(pDataObj, &fmtetc_url, &medium) == S_OK) { // get the URL encoded in US-ASCII - char* url = (char*)GlobalLock(medium.hGlobal); - if (url != NULL) { + wchar_t* wurl = GlobalLock(medium.hGlobal); + if (wurl != NULL) { + char *url = mp_to_utf8(NULL, wurl); if (mp_event_drop_mime_data(t->w32->input_ctx, "text/uri-list", bstr0(url), action) > 0) { MP_VERBOSE(t->w32, "received dropped URL: %s\n", url); @@ -281,6 +282,7 @@ static HRESULT STDMETHODCALLTYPE DropTarget_Drop(IDropTarget* This, MP_ERR(t->w32, "error getting dropped URL\n"); } + talloc_free(url); GlobalUnlock(medium.hGlobal); } @@ -1224,7 +1226,7 @@ static void *gui_thread(void *ptr) if (SUCCEEDED(OleInitialize(NULL))) { ole_ok = true; - fmtetc_url.cfFormat = (CLIPFORMAT)RegisterClipboardFormat(TEXT("UniformResourceLocator")); + fmtetc_url.cfFormat = (CLIPFORMAT)RegisterClipboardFormat(TEXT("UniformResourceLocatorW")); DropTarget* dropTarget = talloc(NULL, DropTarget); DropTarget_Init(dropTarget, w32); RegisterDragDrop(w32->window, &dropTarget->iface); -- cgit v1.2.3