<div dir="ltr">Hey,<div><br></div><div>Sorry, missed the ping... Just found a nit:</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 23, 2018 at 12:58 PM Simon Ser <<a href="mailto:contact@emersion.fr">contact@emersion.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: emersion <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>><br>
<br>
This primary selection is similar in spirit to the eponimous<br>
in X11, allowing a quick "select text + middle click" shortcut<br>
to copying and pasting.<br>
<br>
It's otherwise very similar to its Wayland counterpart, and<br>
explicitly made consistent with it.<br>
<br>
Signed-off-by: Simon Ser <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>><br>
---<br>
<br>
Changes from v1 to v2: renamed with the wp_ prefix<br>
<br>
Makefile.am | 3 +-<br>
unstable/primary-selection/README | 4 +<br>
.../primary-selection-unstable-v1.xml | 226 ++++++++++++++++++<br>
3 files changed, 232 insertions(+), 1 deletion(-)<br>
create mode 100644 unstable/primary-selection/README<br>
create mode 100644 unstable/primary-selection/primary-selection-unstable-v1.xml<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index 6394e26..aca32c2 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -20,7 +20,8 @@ unstable_protocols = \<br>
unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml \<br>
unstable/xdg-output/xdg-output-unstable-v1.xml \<br>
unstable/input-timestamps/input-timestamps-unstable-v1.xml \<br>
- unstable/xdg-decoration/xdg-decoration-unstable-v1.xml \<br>
+ unstable/xdg-decoration/xdg-decoration-unstable-v1.xml \<br>
+ unstable/xdg-primary-selection/xdg-primary-selection-unstable-v1.xml \<br>
$(NULL)<br>
<br>
stable_protocols = \<br>
diff --git a/unstable/primary-selection/README b/unstable/primary-selection/README<br>
new file mode 100644<br>
index 0000000..ae0a402<br>
--- /dev/null<br>
+++ b/unstable/primary-selection/README<br>
@@ -0,0 +1,4 @@<br>
+Primary selection protocol<br>
+<br>
+Maintainers:<br>
+Simon Ser <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>><br>
diff --git a/unstable/primary-selection/primary-selection-unstable-v1.xml b/unstable/primary-selection/primary-selection-unstable-v1.xml<br>
new file mode 100644<br>
index 0000000..749dd86<br>
--- /dev/null<br>
+++ b/unstable/primary-selection/primary-selection-unstable-v1.xml<br>
@@ -0,0 +1,226 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<protocol name="wp_primary_selection_unstable_v1"><br>
+ <copyright><br>
+ Copyright © 2015, 2016 Red Hat<br>
+<br>
+ Permission is hereby granted, free of charge, to any person obtaining a<br>
+ copy of this software and associated documentation files (the "Software"),<br>
+ to deal in the Software without restriction, including without limitation<br>
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ and/or sell copies of the Software, and to permit persons to whom the<br>
+ Software is furnished to do so, subject to the following conditions:<br>
+<br>
+ The above copyright notice and this permission notice (including the next<br>
+ paragraph) shall be included in all copies or substantial portions of the<br>
+ Software.<br>
+<br>
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
+ DEALINGS IN THE SOFTWARE.<br>
+ </copyright><br>
+<br>
+ <description summary="Primary selection protocol"><br>
+ This protocol provides the ability to have a primary selection device to<br>
+ match that of the X server. This primary selection is a shortcut to the<br>
+ common clipboard selection, where text just needs to be selected in order<br>
+ to allow copying it elsewhere. The de facto way to perform this action<br>
+ is the middle mouse button, although it is not limited to this one.<br>
+<br>
+ Clients wishing to honor primary selection should create a primary<br>
+ selection source and set it as the selection through<br>
+ wp_primary_selection_device.set_selection whenever the text selection<br>
+ changes. In order to minimize calls in pointer-driven text selection,<br>
+ it should happen only once after the operation finished. Similarly,<br>
+ a NULL source should be set when text is unselected.<br>
+<br>
+ wp_primary_selection_offer objects are first announced through the<br>
+ wp_primary_selection_device.data_offer event. Immediately after this event,<br>
+ the primary data offer will emit wp_primary_selection_offer.offer events<br>
+ to let know of the mime types being offered.<br>
+<br>
+ When the primary selection changes, the client with the keyboard focus<br>
+ will receive wp_primary_selection_device.selection events. Only the client<br>
+ with the keyboard focus will receive such events with a non-NULL<br>
+ wp_primary_selection_offer. Across keyboard focus changes, previously<br>
+ focused clients will receive wp_primary_selection_device.events with a<br>
+ NULL wp_primary_selection_offer.<br>
+<br>
+ In order to request the primary selection data, the client must pass<br>
+ a recent serial pertaining to the press event that is triggering the<br>
+ operation, if the compositor deems the serial valid and recent, the<br>
+ wp_primary_selection_source.send event will happen in the other end<br>
+ to let the transfer begin. The client owning the primary selection<br>
+ should write the requested data, and close the file descriptor<br>
+ immediately.<br>
+<br>
+ If the primary selection owner client disappeared during the transfer,<br>
+ the client reading the data will receive a<br>
+ wp_primary_selection_device.selection event with a NULL<br>
+ wp_primary_selection_offer, the client should take this as a hint<br>
+ to finish the reads related to the no longer existing offer.<br>
+<br>
+ The primary selection owner should be checking for errors during<br>
+ writes, merely cancelling the ongoing transfer if any happened.<br>
+ </description><br>
+<br>
+ <interface name="zwp_primary_selection_device_manager_v1" version="1"><br>
+ <description summary="X primary selection emulation"><br>
+ The primary selection device manager is a singleton global object that<br>
+ provides access to the primary selection. It allows to create<br>
+ wp_primary_selection_source objects, as well as retrieving the per-seat<br>
+ wp_primary_selection_device objects.<br>
+ </description><br>
+<br>
+ <request name="create_source"><br>
+ <description summary="create a new primary selection source"><br>
+ Create a new primary selection source.<br>
+ </description><br>
+ <arg name="id" type="new_id" interface="zwp_primary_selection_source_v1"/><br>
+ </request><br>
+<br>
+ <request name="get_device"><br>
+ <description summary="create a new primary selection device"><br>
+ Create a new data device for a given seat.<br>
+ </description><br>
+ <arg name="id" type="new_id" interface="zwp_primary_selection_device_v1"/><br>
+ <arg name="seat" type="object" interface="wl_seat"/><br>
+ </request><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="destroy the primary selection device manager"><br>
+ Destroy the primary selection device manager.<br>
+ </description><br>
+ </request><br>
+ </interface><br>
+<br>
+ <interface name="zwp_primary_selection_device_v1" version="1"><br>
+ <request name="set_selection"><br>
+ <description summary="set the primary selection"><br>
+ Replaces the current selection. The previous owner of the primary<br>
+ selection will receive a wp_primary_selection_source.cancelled event.<br>
+<br>
+ To unset the selection, set the source to NULL.<br>
+ </description><br>
+ <arg name="source" type="object" interface="zwp_primary_selection_source_v1" allow-null="true"/><br>
+ <arg name="serial" type="uint" summary="serial of the event that triggered this request"/><br>
+ </request><br>
+<br>
+ <event name="data_offer"><br>
+ <description summary="introduce a new wp_primary_selection_offer"><br>
+ Introduces a new wp_primary_selection_offer object that may be used<br>
+ to receive the current primary selection. Immediately following this<br>
+ event, the new wp_primary_selection_offer object will send<br>
+ wp_primary_selection_offer.offer events to describe the offered mime<br>
+ types.<br>
+ </description><br>
+ <arg name="offer" type="new_id" interface="zwp_primary_selection_offer_v1"/><br>
+ </event><br>
+<br>
+ <event name="selection"><br>
+ <description summary="advertise a new primary selection"><br>
+ The wp_primary_selection_device.selection event is sent to notify the<br>
+ client of a new primary selection. This event is sent after the<br>
+ wp_primary_selection.data_offer event introducing this object, and after<br>
+ the offer has announced its mimetypes through<br>
+ wp_primary_selection_offer.offer.<br>
+<br>
+ The data_offer is valid until a new offer or NULL is received<br>
+ or until the client loses keyboard focus. The client must destroy the<br>
+ previous selection data_offer, if any, upon receiving this event.<br>
+ </description><br>
+ <arg name="id" type="object" interface="zwp_primary_selection_offer_v1" allow-null="true"/><br>
+ </event><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="destroy the primary selection device"><br>
+ Destroy the primary selection device.<br>
+ </description><br>
+ </request><br>
+ </interface><br>
+<br>
+ <interface name="zwp_primary_selection_offer_v1" version="1"><br>
+ <description summary="offer to transfer primary selection contents"><br>
+ A wp_primary_selection_offer represents an offer to transfer the contents<br>
+ of the primary selection clipboard to the client. Similar to<br>
+ wl_data_offer, the offer also describes the mime types that the source<br>
+ will transferthat the<br></blockquote><div><br></div><div>This is in the original protocol, so definitely more my fault than yours, but would be nice not to drag this further :). I guess the original intention was:</div><div><br></div><div>"...describes the mime types that the data can be converted to..."</div><div><br></div><div>Besides that, the patch is</div><div><br></div><div>Reviewed-by: Carlos Garnacho <<a href="mailto:carlosg@gnome.org">carlosg@gnome.org</a>></div><div><br></div><div>Cheers,</div><div> Carlos</div></div></div>