5c4272b8e9
Currently, there's no means for the DnD origin to know whether the destination is actually finished with the DnD transaction, short of finalizing it after the first transfer finishes, or leaking it forever. But this poses other interoperation problems, drag destinations might be requesting several mimetypes at once, might be just poking to find out the most suitable format, might want to defer the action to a popup, might be poking contents early before the selection was dropped... In addition, data_source.cancelled is suitable for the situations where the DnD operation fails (not on a drop target, no matching mimetypes, etc..), but seems undocumented for that use (and unused in weston's DnD). In order to improve the situation, the drag source should be notified of all stages of DnD. In addition to documenting the "cancelled" event for DnD purposes, The following 2 events have been added: - wl_data_source.dnd_drop_performed: Happens when the operation has been physically finished (eg. the button is released), it could be the right place to reset the pointer cursor back and undo any other state resulting from the initial button press. - wl_data_source.dnd_finished: Happens when the destination side destroys the wl_data_offer, at this point the source can just forget all data related to the DnD selection as well, plus optionally deleting the data on move operations. Changes since v6: - Turned wl_data_offer.finish calls with 0/NULL state/mimetype an error, made it explicit that it will only result in wl_data_offer.dnd_finished being sent if successful. Changes since v5: - Further rewording of wl_data_offer.finish and wl_data_offer.accept. Added error for untimely wl_data_offer.finish requests. Changes since v4: - Applied rewording suggestions from Jonas Ådahl. Added new wl_data_offer.finish request to allow explicit finalization on the destination side. Changes since v3: - Renamed dnd_performed to a more descriptive dnd_drop_performed, documented backwards compatible behavior on wl_data_offer.accept and wl_data_source.cancelled. Changes since v2: - Minor rewording. Changes since v1: - Renamed events to have a common "dnd" namespace. Made dnd_performed to happen invariably, data_device.cancelled may still happen afterwards. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Michael Catanzaro <mcatanzaro@igalia.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mike Blumenkrantz <zmike@samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> |
||
---|---|---|
cursor | ||
doc | ||
m4 | ||
protocol | ||
spec | ||
src | ||
tests | ||
.gitignore | ||
autogen.sh | ||
configure.ac | ||
COPYING | ||
Makefile.am | ||
publish-doc | ||
README | ||
TODO | ||
wayland-scanner.m4 | ||
wayland-scanner.mk |
What is Wayland? Wayland is a project to define a protocol for a compositor to talk to its clients as well as a library implementation of the protocol. The compositor can be a standalone display server running on Linux kernel modesetting and evdev input devices, an X application, or a wayland client itself. The clients can be traditional applications, X servers (rootless or fullscreen) or other display servers. The wayland protocol is essentially only about input handling and buffer management. The compositor receives input events and forwards them to the relevant client. The clients creates buffers and renders into them and notifies the compositor when it needs to redraw. The protocol also handles drag and drop, selections, window management and other interactions that must go through the compositor. However, the protocol does not handle rendering, which is one of the features that makes wayland so simple. All clients are expected to handle rendering themselves, typically through cairo or OpenGL. The weston compositor is a reference implementation of a wayland compositor and the weston repository also includes a few example clients. Building the wayland libraries is fairly simple, aside from libffi, they don't have many dependencies: $ git clone git://anongit.freedesktop.org/wayland/wayland $ cd wayland $ ./autogen.sh --prefix=PREFIX $ make $ make install where PREFIX is where you want to install the libraries. See http://wayland.freedesktop.org for more complete build instructions for wayland, weston, xwayland and various toolkits.