<div dir="ltr">Reviewed-By: Mike Blumenkrantz <<a href="mailto:zmike@osg.samsung.com">zmike@osg.samsung.com</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 27, 2016 at 3:55 AM Jonas Ådahl <<a href="mailto:jadahl@gmail.com">jadahl@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">xdg-foreign is a protocol meant to enable setting up inter surface<br>
relationships across clients. Potential use cases are out-of-process<br>
dialogs, such as file dialogs, meant to be used by sandboxed processes<br>
that may not have the access it needs to implement such dialogs.<br>
<br>
It works by enabling a client to export a surface, creating a handle<br>
for the exported surface. The handle, in form of a unique string, may<br>
be shared in some way with other clients (for example the provider of<br>
the file dialog) which can then import the exported surface.<br>
<br>
Signed-off-by: Jonas Ådahl <<a href="mailto:jadahl@gmail.com" target="_blank">jadahl@gmail.com</a>><br>
---<br>
<br>
Changes since v1:<br>
<br>
- Spelling and grammar fixes<br>
- Wording changes (unexport -> revoke)<br>
- Fixed the "Warning! .. unstable .." paragraph (was an old version)<br>
- Added sandbox client -> unsandboxed file browser dialog example to protocol<br>
description<br>
- Removed left-over note about restriction of importing a handle only once. It<br>
should be possible to import a handle multiple times, but the protocol text<br>
had only been updated in one of two places.<br>
<br>
<br>
Jonas<br>
<br>
<br>
<br>
Makefile.am | 1 +<br>
unstable/xdg-foreign/README | 4 +<br>
unstable/xdg-foreign/xdg-foreign-unstable-v1.xml | 186 +++++++++++++++++++++++<br>
3 files changed, 191 insertions(+)<br>
create mode 100644 unstable/xdg-foreign/README<br>
create mode 100644 unstable/xdg-foreign/xdg-foreign-unstable-v1.xml<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index 9e2a029..35df201 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -9,6 +9,7 @@ unstable_protocols = \<br>
unstable/pointer-constraints/pointer-constraints-unstable-v1.xml \<br>
unstable/tablet/tablet-unstable-v1.xml \<br>
unstable/tablet/tablet-unstable-v2.xml \<br>
+ unstable/xdg-foreign/xdg-foreign-unstable-v1.xml \<br>
$(NULL)<br>
<br>
stable_protocols = \<br>
diff --git a/unstable/xdg-foreign/README b/unstable/xdg-foreign/README<br>
new file mode 100644<br>
index 0000000..f5bcb83<br>
--- /dev/null<br>
+++ b/unstable/xdg-foreign/README<br>
@@ -0,0 +1,4 @@<br>
+xdg foreign protocol<br>
+<br>
+Maintainers:<br>
+Jonas Ådahl <<a href="mailto:jadahl@gmail.com" target="_blank">jadahl@gmail.com</a>><br>
diff --git a/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml b/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml<br>
new file mode 100644<br>
index 0000000..c6f5775<br>
--- /dev/null<br>
+++ b/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml<br>
@@ -0,0 +1,186 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<protocol name="xdg_foreign_unstable_v1"><br>
+<br>
+ <copyright><br>
+ Copyright © 2015-2016 Red Hat Inc.<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="Protocol for exporting xdg surface handles"><br>
+ This protocol specifies a way for making it possible to reference a surface<br>
+ of a different client. With such a reference, a client can, by using the<br>
+ interfaces provided by this protocol, manipulate the relationship between<br>
+ its own surfaces and the surface of some other client. For example, stack<br>
+ some of its own surface above the other clients surface.<br>
+<br>
+ In order for a client A to get a reference of a surface of client B, client<br>
+ B must first export its surface using xdg_exporter.export. Upon doing this,<br>
+ client B will receive a handle (a unique string) that it may share with<br>
+ client A in some way (for example D-Bus). After client A has received the<br>
+ handle from client B, it may use xdg_importer.import to create a reference<br>
+ to the surface client B just exported. See the corresponding requests for<br>
+ details.<br>
+<br>
+ A possible use case for this is out-of-process dialogs. For example when a<br>
+ sandboxed client without file system access needs the user to select a file<br>
+ on the file system, given sandbox environment support, it can export its<br>
+ surface, passing the exported surface handle to an unsandboxed process that<br>
+ can show a file browser dialog and stack it above the sandboxed client's<br>
+ surface.<br>
+<br>
+ Warning! The protocol described in this file is experimental and backward<br>
+ incompatible changes may be made. Backward compatible changes may be added<br>
+ together with the corresponding interface version bump. Backward<br>
+ incompatible changes are done by bumping the version number in the protocol<br>
+ and interface names and resetting the interface version. Once the protocol<br>
+ is to be declared stable, the 'z' prefix and the version number in the<br>
+ protocol and interface names are removed and the interface version number is<br>
+ reset.<br>
+ </description><br>
+<br>
+ <interface name="zxdg_exporter_v1" version="1"><br>
+ <description summary="interface for exporting surfaces"><br>
+ A global interface used for exporting surfaces that can later be imported<br>
+ using xdg_importer.<br>
+ </description><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="destroy the xdg_exporter object"><br>
+ Notify the compositor that the xdg_exporter object will no longer be<br>
+ used.<br>
+ </description><br>
+ </request><br>
+<br>
+ <request name="export"><br>
+ <description summary="export a surface"><br>
+ The export request exports the passed surface so that it can later be<br>
+ imported via xdg_importer. When called, a new xdg_exported object will<br>
+ be created and xdg_exported.handle will be sent immediately. See the<br>
+ corresponding interface and event for details.<br>
+<br>
+ A surface may be exported multiple times, and each exported handle may<br>
+ be used to create a xdg_imported multiple times. Only xdg_surface<br>
+ surfaces may be exported.<br>
+ </description><br>
+<br>
+ <arg name="id" type="new_id" interface="zxdg_exported_v1"<br>
+ summary="the new xdg_exported object"/><br>
+ <arg name="surface" type="object" interface="wl_surface"<br>
+ summary="the surface to export"/><br>
+ </request><br>
+ </interface><br>
+<br>
+ <interface name="zxdg_importer_v1" version="1"><br>
+ <description summary="interface for importing surfaces"><br>
+ A global interface used for importing surfaces exported by xdg_exporter.<br>
+ With this interface, a client can create a reference to a surface of<br>
+ another client.<br>
+ </description><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="destroy the xdg_importer object"><br>
+ Notify the compositor that the xdg_importer object will no longer be<br>
+ used.<br>
+ </description><br>
+ </request><br>
+<br>
+ <request name="import"><br>
+ <description summary="import a surface"><br>
+ The import request imports a surface from any client given a handle<br>
+ retrieved by exporting said surface using xdg_exporter.export. When<br>
+ called, a new xdg_imported object will be created. This new object<br>
+ represents the imported surface, and the importing client can<br>
+ manipulate its relationship using it. See xdg_imported for details.<br>
+ </description><br>
+<br>
+ <arg name="id" type="new_id" interface="zxdg_imported_v1"<br>
+ summary="the new xdg_imported object"/><br>
+ <arg name="handle" type="string"<br>
+ summary="the exported surface handle"/><br>
+ </request><br>
+ </interface><br>
+<br>
+ <interface name="zxdg_exported_v1" version="1"><br>
+ <description summary="an exported surface handle"><br>
+ A xdg_exported object represents an exported reference to a surface. The<br>
+ exported surface may be referenced as long as the xdg_exported object not<br>
+ destroyed. Destroying the xdg_exported invalidates any relationship the<br>
+ importer may have established using xdg_imported.<br>
+ </description><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="unexport the exported surface"><br>
+ Revoke the previously exported surface. This invalidates any<br>
+ relationship the importer may have set up using the xdg_imported created<br>
+ given the handle sent via xdg_exported.handle.<br>
+ </description><br>
+ </request><br>
+<br>
+ <event name="handle"><br>
+ <description summary="the exported surface handle"><br>
+ The handle event contains the unique handle of this exported surface<br>
+ reference. It may be shared with any client, which then can use it to<br>
+ import the surface by calling xdg_importer.import. A handle may be<br>
+ used to import the surface multiple times.<br>
+ </description><br>
+<br>
+ <arg name="handle" type="string" summary="the exported surface handle"/><br>
+ </event><br>
+ </interface><br>
+<br>
+ <interface name="zxdg_imported_v1" version="1"><br>
+ <description summary="an imported surface handle"><br>
+ A xdg_imported object represents an imported reference to surface exported<br>
+ by some client. A client can use this interface to manipulate<br>
+ relationships between its own surfaces and the imported surface.<br>
+ </description><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="destroy the xdg_imported object"><br>
+ Notify the compositor that it will no longer use the xdg_imported<br>
+ object. Any relationship that may have been set up will at this point<br>
+ be invalidated.<br>
+ </description><br>
+ </request><br>
+<br>
+ <request name="set_parent_of"><br>
+ <description summary="set as the parent of some surface"><br>
+ Set the imported surface as the parent of some surface of the client.<br>
+ The passed surface must be a toplevel xdg_surface. Calling this function<br>
+ sets up a surface to surface relation with the same stacking and positioning<br>
+ semantics as xdg_surface.set_parent.<br>
+ </description><br>
+<br>
+ <arg name="surface" type="object" interface="wl_surface"<br>
+ summary="the child surface"/><br>
+ </request><br>
+<br>
+ <event name="destroyed"><br>
+ <description summary="the imported surface handle has been destroyed"><br>
+ The imported surface handle has been destroyed and any relationship set<br>
+ up has been invalidated. This may happen for various reasons, for<br>
+ example if the exported surface or the exported surface handle has been<br>
+ destroyed, if the handle used for importing was invalid.<br>
+ </description><br>
+ </event><br>
+ </interface><br>
+<br>
+</protocol><br>
--<br>
2.7.4<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>