summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-02 21:43:16 +0100
committerwm4 <wm4@nowhere>2016-02-02 21:51:50 +0100
commit04783e11c995fb1ffa2dcd91ebc494ad35ce898b (patch)
treef3af6e09a077589d8975d7615486755b6085d959
parent8996f79edbf4286807d5255b6db68550aa473951 (diff)
downloadmpv-04783e11c995fb1ffa2dcd91ebc494ad35ce898b.tar.bz2
mpv-04783e11c995fb1ffa2dcd91ebc494ad35ce898b.tar.xz
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.
-rw-r--r--video/out/w32_common.c8
1 files 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);