<div dir="ltr">qq inline<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 22, 2017 at 3:46 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For previous versions, see:<br>
v1: <a href="https://lists.freedesktop.org/archives/wayland-devel/2017-March/033626.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/wayland-devel/2017-<wbr>March/033626.html</a><br>
v2: <a href="https://lists.freedesktop.org/archives/wayland-devel/2017-April/033819.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/wayland-devel/2017-<wbr>April/033819.html</a><br>
<br>
This update is closer to v1 again than v2. Biggest change is: instead of a<br>
get_seat we have a get_seat_evdev request. Anything evdev is then hanging<br>
off that seat, basically in how it was before. The hierarchy of objects is<br>
thus something like this:<br>
<br>
manager<br>
seat_evdev<br>
device_evdev<br>
device_evdev<br>
device_evdev<br>
<br>
and in the future we could have other interfaces like this:<br>
<br>
manager<br>
seat_evdev<br>
device_evdev<br>
device_evdev<br>
device_evdev<br>
device_evdev<br>
seat_hidraw<br>
device_hidraw<br>
device_hidraw<br>
device_hidraw<br>
seat_w3c<br>
device_w3c<br>
device_w3c<br>
<br>
Having it split at the seat level means we don't have to pollute each<br>
interface with the different needs of the other interfaces. evdev is the<br>
easiest case, so that's done first. I dropped the extra properties, Bastien<br>
and I discussed this at GUADEC and we agreed it's better to implement the<br>
minimal version first and then see what we need before trying to come up<br>
with a generic solution.<br>
<br>
Cheers,<br>
Peter<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index 5b5ae96..7b0a3b0 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -4,6 +4,7 @@ unstable_protocols = \<br>
unstable/linux-dmabuf/linux-<wbr>dmabuf-unstable-v1.xml \<br>
unstable/text-input/text-<wbr>input-unstable-v1.xml \<br>
unstable/input-method/input-<wbr>method-unstable-v1.xml \<br>
+ unstable/inputfd/inputfd-<wbr>unstable-v1.xml \<br>
unstable/xdg-shell/xdg-shell-<wbr>unstable-v5.xml \<br>
unstable/xdg-shell/xdg-shell-<wbr>unstable-v6.xml \<br>
unstable/relative-pointer/<wbr>relative-pointer-unstable-v1.<wbr>xml \<br>
diff --git a/unstable/inputfd/README b/unstable/inputfd/README<br>
new file mode 100644<br>
index 0000000..a24d858<br>
--- /dev/null<br>
+++ b/unstable/inputfd/README<br>
@@ -0,0 +1,4 @@<br>
+Input device fd passing protocol<br>
+<br>
+Maintainers:<br>
+Peter Hutterer <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>><br>
diff --git a/unstable/inputfd/inputfd-<wbr>unstable-v1.xml b/unstable/inputfd/inputfd-<wbr>unstable-v1.xml<br>
new file mode 100644<br>
index 0000000..c8a0380<br>
--- /dev/null<br>
+++ b/unstable/inputfd/inputfd-<wbr>unstable-v1.xml<br>
@@ -0,0 +1,268 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<protocol name="inputfd_unstable_v1"><br>
+ <copyright><br>
+ Copyright 2017 © Red Hat, Inc.<br>
+<br>
+ Permission is hereby granted, free of charge, to any person<br>
+ obtaining a copy of this software and associated documentation files<br>
+ (the "Software"), to deal in the Software without restriction,<br>
+ including without limitation the rights to use, copy, modify, merge,<br>
+ publish, distribute, sublicense, and/or sell copies of the Software,<br>
+ and to permit persons to whom the Software is furnished to do so,<br>
+ subject to the following conditions:<br>
+<br>
+ The above copyright notice and this permission notice (including the<br>
+ next paragraph) shall be included in all copies or substantial<br>
+ portions of the Software.<br>
+<br>
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br>
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br>
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS<br>
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br>
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br>
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br>
+ SOFTWARE.<br>
+ </copyright><br>
+<br>
+ <description summary="Wayland protocol for direct fd access to input devices"><br>
+ This description provides a high-level overview of the interfaces<br>
+ in this protocol. For details, see the protocol specification.<br>
+<br>
+ Some input devices do not interact with the windowing system. Examples<br>
+ of such input devices are gaming controllers or 3D mice. In many cases,<br>
+ a client requires direct access to the device to access or interpret<br>
+ device-specific functionality.<br>
+<br>
+ This interface provides client access to input devices via a file<br>
+ descriptor (fd). The compositor may restrict the type of device<br>
+ accessible and it may restrict specific events from being sent to the<br>
+ client (e.g. by masking the Home button on a gamepad). Otherwise, a<br>
+ client should treat the device as if opened manually.<br>
+<br>
+ Multiple input devices may exists and be assigned to different seats.<br>
+ The top-level object of this protocol is a wp_inputfd_manager. A client<br>
+ must request the desired interface for a given seat. This object then<br>
+ provides the list of devices for that category that match the fd type of<br>
+ that interface. At the moment, only the evdev fd type is supported but in<br>
+ the future, a device may be accessible via multiple fd interfaces.<br>
+<br>
+ Once a compositor deems a device to be focused on the client or on a<br>
+ client's surface it sends a focus_in event with a file descriptor for<br>
+ this device. A compositor may arbitrarily revoke access<br>
+ to the device by sending a wp_inputfd.focus_out. Additionally, a<br>
+ compositor may invoke system functionality to restrict access to the<br>
+ file descriptor, e.g. by using EVIOCREVOKE on an evdev fd.<br>
+<br>
+ Otherwise, a client should treat the file descriptor as direct access to<br>
+ the device for the duration of it having access.<br>
+<br>
+ Warning! The protocol described in this file is experimental and<br>
+ backward incompatible changes may be made. Backward compatible changes<br>
+ may be added together with the corresponding interface version bump.<br>
+ Backward incompatible changes are done by bumping the version number in<br>
+ the protocol and interface names and resetting the interface version.<br>
+ Once the protocol is to be declared stable, the 'z' prefix and the<br>
+ version number in the protocol and interface names are removed and the<br>
+ interface version number is reset.<br>
+ </description><br>
+<br>
+ <interface name="zwp_inputfd_manager_v1" version="1"><br>
+ <description summary="controller object for direct fd access input devices"><br>
+ An object that provides access to the input devices available for<br>
+ direct fd access on this system. All input devices are associated with<br>
+ a seat, to get access to the actual devices use<br>
+ wp_inputfd_manager.get_seat_<wbr>evdev.<br>
+ </description><br>
+<br>
+ <request name="get_seat_evdev"><br>
+ <description summary="get the evdev seat for receiving device notifications"><br>
+ Get the wp_inputfd_seat_evdev object for the given seat. This object<br>
+ provides access to all exposed devices in this seat via<br>
+ evdev-compatible file descriptors.<br>
+<br>
+ The decision which device is available through this interface is<br>
+ made by the compositor. The protocol makes no guarantees whether a<br>
+ specific device is available through this interface.<br>
+ </description><br>
+ <arg name="inputfd_seat" type="new_id" interface="zwp_inputfd_seat_<wbr>evdev_v1"/><br>
+ <arg name="seat" type="object" interface="wl_seat" summary="The wl_seat object to retrieve the input devices for" /><br>
+ </request><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="release the memory for the inputfd manager object"><br>
+ Destroy the wp_inputfd_manager object. Objects created from this<br>
+ object are unaffected and should be destroyed separately.<br>
+ </description><br>
+ </request><br>
+ </interface><br>
+<br>
+ <interface name="zwp_inputfd_seat_evdev_<wbr>v1" version="1"><br>
+ <description summary="controller object for input devices of a seat"><br>
+ An object that provides access to the input devices available on this<br>
+ seat via an evdev-compatible file descriptor. After binding to this<br>
+ interface, the compositor immediately sends a set of<br>
+ wp_inputfd_seat_evdev.device_<wbr>added events for currently available<br>
+ devices and later whenever a new device becomes available.<br>
+ </description><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="release the memory for the inputfd seat object"><br>
+ Destroy the wp_inputfd_seat_evdev object. Objects created from this<br>
+ object are unaffected and should be destroyed separately.<br>
+ </description><br>
+ </request><br>
+<br>
+ <event name="device_added"><br>
+ <description summary="new device notification"><br>
+ This event is sent whenever a new device becomes available on<br>
+ this seat. This event only provides the object id of the devices,<br>
+ any static information about the device (device name,<br>
+ vid/pid, etc.) is sent through the wp_inputfd_device_evdev interface.<br>
+<br>
+ Which devices are compatible input devices for this seat is a<br>
+ decision made by the compositor, the protocol makes no guarantee<br>
+ that any specific device becomes available to a client.<br>
+ </description><br>
+ <arg name="id" type="new_id" interface="zwp_inputfd_device_<wbr>evdev_v1"<br>
+ summary="the newly added device"/><br>
+ </event><br>
+ </interface><br>
+<br>
+ <interface name="zwp_inputfd_device_<wbr>evdev_v1" version="1"><br>
+ <description summary="evdev-compatible inputfd device"><br>
+ The wp_inputfd_device_evdev interface represents one device node<br>
+ in the Linux kernel evdev interface. The fd passed to the client<br>
+ supports the ioctls and read/write commands of that interface. The<br>
+ protocol makes no guarantees which ioctls are available on the fd,<br>
+ this decision is made by the kernel.<br>
+<br>
+ A device has a number of static characteristics, e.g. device<br>
+ name and pid/vid. These capabilities are sent in an event sequence<br>
+ immediately after the wp_inputfd_seat.device_added event. This initial<br>
+ event sequence is terminated by a wp_inputfd_device_evdev.done event. This<br>
+ sequence is sent only once and always before the first<br>
+ wp_inputfd_device.focus_in event.<br>
+<br>
+ A device is the representation of a logical device as exposed by the<br>
+ underlying system and may only represent parts of a single physical<br>
+ input device. It is the client's task to identify the device as part<br>
+ of a physical device and to group the logical devices together as<br>
+ appropriate.<br>
+ </description><br>
+<br>
+ <request name="destroy" type="destructor"><br>
+ <description summary="destroy the inputfd object"><br>
+ This destroys the client's resource for this inputfd object.<br>
+ </description><br>
+ </request><br>
+<br>
+ <event name="name"><br>
+ <description summary="device name"><br>
+ The name is a UTF-8 encoded string with the device's name, intended<br>
+ for presentation to the user.<br>
+<br>
+ This event is sent in the initial burst of events before the<br>
+ wp_inputfd_device_evdev.done event.<br>
+<br>
+ This event is optional, if the required information is not available<br>
+ for this device the event is omitted.<br>
+ </description><br>
+ <arg name="name" type="string" summary="the device name"/><br>
+ </event><br>
+<br>
+ <event name="usb_id"><br>
+ <description summary="device USB vendor/product id"><br>
+ This event is sent in the initial burst of events before the<br>
+ wp_inputfd_device_evdev.done event.<br>
+<br>
+ This event is optional, if the required information is not available<br>
+ for this device the event is omitted.<br>
+ </description><br>
+ <arg name="vid" type="uint" summary="USB vendor id"/><br>
+ <arg name="pid" type="uint" summary="USB product id"/><br>
+ </event><br>
+<br></blockquote><div>Is there a way to pass through device identification here? Something like "ID_INPUT_KEYBOARD"? </div><div>Does "seat_evdev" indicate client interested in all evdev devices? </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ <event name="done"><br>
+ <description summary="device description events sequence complete"><br>
+ This event is sent immediately to signal the end of the initial<br>
+ burst of descriptive events. A client may consider the static<br>
+ description of the device to be complete and finalize<br>
+ initialization of the device.<br>
+ </description><br>
+ </event><br>
+<br>
+ <event name="removed"><br>
+ <description summary="device removed event"><br>
+ Sent when the device has been removed from the system.<br>
+<br>
+ If the client currently has the device focus, a<br>
+ wp_inputfd_device_evdev.focus_<wbr>out event is sent before the removed<br>
+ event. See wp_inputfd_device.focus_in for more details.<br>
+<br>
+ When this event is received, the client must<br>
+ wp_inputfd_device_evdev.<wbr>destroy the object.<br>
+ </description><br>
+ </event><br>
+<br>
+ <event name="focus_in"><br>
+ <description summary="input fd device focus in event"><br>
+ Notification that this client now has the focus and/or access to<br>
+ this device. How focus is set is left to the<br>
+ compositor. For example, a compositor may tie joystick focus to the<br>
+ wl_pointer focus of this seat. The protocol does not guarantee that<br>
+ any specific client ever receives the focus for a device.<br>
+<br>
+ The client is passed a file descriptor with access to this<br>
+ device. This file descriptor is valid until a subsequent<br>
+ wp_inputfd_device_evdev.focus_<wbr>out event. Upon<br>
+ wp_inputfd_device_evdev.focus_<wbr>out, the compositor may revoke the fd<br>
+ and further operations will fail.<br>
+<br>
+ However, due to potential race conditions a client must be able to<br>
+ handle errors as if it opened the fd itself. No guarantee is given<br>
+ that the wp_inputfd_device_evdev.focus_<wbr>out event or<br>
+ wp_inputfd_device_evdev.<wbr>removed event are sent before the client<br>
+ encounters an error on the file descriptor.<br>
+<br>
+ A compositor guarantees the file descriptor for a<br>
+ wp_inputfd_device_evdev refers to the same kernel device after each<br>
+ focus_in event. In other words, any constant information about the<br>
+ device obtained through the fd (e.g. the EVIOCGPROP ioctl) is<br>
+ the same after each focus in event. Thus, a client needs to do so<br>
+ only once at the first focus_in. This guarantee does not extend to<br>
+ information that the kernel may change at runtime (e.g. the<br>
+ EVIOCGABS ioctl).<br>
+<br>
+ If applicable, this event contains the surface that has the focus.<br>
+ In some cases, the focus may not be tied to a specific client surface<br>
+ but is given to the client independent of any surface. In that case,<br>
+ the surface is null.<br>
+<br>
+ The protocol guarantees that focus_in and focus_out always come in<br>
+ pairs. If the client currently has the focus and the device is<br>
+ removed, a focus_out event is sent to the client before the<br>
+ wp_inputfd_device_evdev.<wbr>removed event.<br>
+ </description><br>
+ <arg name="serial" type="uint"/><br>
+ <arg name="fd" type="fd" summary="file descriptor to the device"/><br>
+ <arg name="surface" type="object" interface="wl_surface"<br>
+ summary="The current surface that has the device's focus" allow-null="true"/><br>
+ </event><br>
+<br>
+ <event name="focus_out"><br>
+ <description summary="input fd device focus out event"><br>
+ Notification that this client no longer has focus and/or access to<br>
+ this device. Further reads from this device's file descriptor<br>
+ may fail. The client must close(2) the file descriptor received in<br>
+ the wp_inputfd_device_evdev.focus_<wbr>in event.<br>
+<br>
+ This event does not mean the device was removed, merely that the<br>
+ device is focused elsewhere. For device removal, see<br>
+ wp_inputfd_device_evdev.<wbr>removed.<br>
+<br>
+ See wp_inputfd_device_evdev.focus_<wbr>in for more details.<br>
+ </description><br>
+ </event><br>
+ </interface><br>
+</protocol><br>
</blockquote></div><br></div></div>