diff options
author | wm4 <wm4@nowhere> | 2014-01-04 01:16:44 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-04 01:27:28 +0100 |
commit | 6a1b12158d903c09b7889820451b07dc73ee8576 (patch) | |
tree | cc69c8e91cf32b8355e0a109a2994f0303330b9e /video/out/x11_common.h | |
parent | 0702f642d576ee085f65bb1363b1b61f84150e51 (diff) | |
download | mpv-6a1b12158d903c09b7889820451b07dc73ee8576.tar.bz2 mpv-6a1b12158d903c09b7889820451b07dc73ee8576.tar.xz |
x11: implement dropping files on the VO window
Drag and drop is pretty complicated (just note how the number of Atoms
in use almost doubles), so I'm not sure whether this works everywhere.
This has been written by looking at the specification [1] or what looks
like the specification, and some external example code [2]. (The latter
one has no code license, but we didn't copy any code.)
We completely ignore the "requirement" of the spec. that the filename
"must" include username and hostname, e.g. "file://user@host/path/file".
In theory, this is required because X is network transparent, but at
this point the so called network transparency is a complete joke, and
Konqueror for one didn't include hostnames in "file://" URIs.
Tested with konqueror as drop source.
[1] http://www.newplanetsoftware.com/xdnd/
[2] http://www.edwardrosten.com/code/dist/x_clipboard-1.1/paste.cc
Diffstat (limited to 'video/out/x11_common.h')
-rw-r--r-- | video/out/x11_common.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/video/out/x11_common.h b/video/out/x11_common.h index 2763009755..f65af8e79f 100644 --- a/video/out/x11_common.h +++ b/video/out/x11_common.h @@ -102,6 +102,11 @@ struct vo_x11_state { /* Increment it before XShmPutImage */ int ShmCompletionWaitCount; + /* drag and drop */ + Atom dnd_property; + Atom dnd_requested_format; + Window dnd_src_window; + Atom XA_NET_SUPPORTED; Atom XA_NET_WM_STATE; Atom XA_NET_WM_STATE_FULLSCREEN; @@ -119,6 +124,18 @@ struct vo_x11_state { Atom XAWM_DELETE_WINDOW; Atom XAUTF8_STRING; Atom XA_NET_WM_CM; + Atom XATARGETS; + Atom XAXdndAware; + Atom XAXdndEnter; + Atom XAXdndLeave; + Atom XAXdndPosition; + Atom XAXdndStatus; + Atom XAXdndActionCopy; + Atom XAXdndTypeList; + Atom XAXdndDrop; + Atom XAXdndSelection; + Atom XAXdndFinished; + Atom XA_uri_list; }; int vo_x11_init(struct vo *vo); |