Clarify surface-layers, remove input-injection

This commit is contained in:
Drew DeVault 2017-09-28 16:27:26 -04:00
parent 8548b3a177
commit 4a8b28346b
3 changed files with 16 additions and 110 deletions

View file

@ -30,16 +30,3 @@ specific z depth. This protocol should support use-cases like:
[Protocol](https://github.com/SirCmpwn/sway-protocols/blob/master/unstable/surface-layers.xml)
[Discussion](https://github.com/SirCmpwn/sway-protocols/issues/1)
## input-injection
Allows clients to simulate fake inputs that the compositor will treat like real
ones and send to other clients and such. Should support use-cases like:
- on screen keyboards
- input scripting
- xcape-style stuff
[Protocol](https://github.com/SirCmpwn/sway-protocols/blob/master/unstable/input-injection.xml)
[Discussion](https://github.com/SirCmpwn/sway-protocols/issues/2)

View file

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- vim: set ts=2 sw=2 et tw=80 formatoptions+=t : -->
<protocol name="input_simulation">
<copyright>
Copyright © 2017 Drew DeVault
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
</copyright>
<interface name="input_simulation" version="1">
<description summary="simulates global input events">
This protocol allows clients to simulate input events, which the
compositor will process normally. These events could be passed to other
clients, trigger keybindings in the compositor, etc. Note that real input
events will continue to be processed while simulators are in use.
</description>
<request name="get_keyboard_simulator">
<descripton summary="create an input_simulator for a wl_keyboard">
Creates an interface that can be used to simulate keyboard input events.
</description>
<arg name="id" type="new_id" interface="keyboard_simulator"/>
<arg name="keyboard" type="object" interface="wl_keyboard"/>
</request>
</interface>
<interface name="keyboard_simulator" version="1">
<description summary="layer metadata interface">
An interface that may be implemented by a wl_keyboard, which allows
clients to simulate input events from them.
</description>
<request name="destroy" type="destructor" />
<request name="key">
<description summary="simulates a key event">
Raises a wl_keyboard.key event on the focused client(s), or processes
the key for the compositor's internal use. The compositor will assign a
serial and time appropriately when the event is emitted.
</description>
<arg name="key" type="uint"/>
<arg name="state" type="uint"/>
</request>
<request name="modifiers">
<description summary="simulates a modifiers event">
Raises a wl_keyboard.modifiers event on the focused client(s), or
processes the key for the compositor's internal use. The compositor will
assign a serial appropriately when the event is emitted.
</description>
<arg name="mods_depressed" type="uint"/>
<arg name="mods_latched" type="uint"/>
<arg name="mods_locked" type="uint"/>
<arg name="group" type="uint"/>
</request>
</interface>
</protocol>

View file

@ -41,8 +41,10 @@
<description summary="available layers for surfaces">
These values indicate which layers a surface can be rendered in. They
are ordered by z depth, bottom-most first. Traditional shell surfaces
will typically be rendered between the bottom and top layers. Multiple
surfaces can share a single layer.
will typically be rendered between the bottom and top layers.
Fullscreen shell surfaces are typically rendered at the top layer.
Multiple surfaces can share a single layer, and ordering within a
single layer is undefined.
</description>
<entry name="background" value="0"/>
@ -76,28 +78,23 @@
These flags are a bitfield and are used by set_interactive to specify
what sorts of input the surface should interact with.
</description>
<arg name="none" value="0x0" />
<arg name="pointer" value="0x1" />
<arg name="keyboard" value="0x2" />
<arg name="touch" value="0x4" />
<arg name="none" value="0" />
<arg name="pointer" value="1" />
<arg name="keyboard" value="2" />
<arg name="touch" value="4" />
</enum>
<request name="set_interactivity">
<description summary="indicates that this surface is interactive">
This request indicates to the compositor what kind of interactivity this
surface requires. This may be changed at runtime. Note that whether or
not the compositor chooses to send the surface input events at any given
time is implementation-dependent. Any events from input devices you do not
ask for will be passed along to other clients, also in an
implementation-dependent way.
By convention, conventional compositors will send input events to
surfaces below the shell surface layer when there are no shell surfaces
or when the surface is clicked (and thus receives focus). Above the
shell surface layer, the topmost surface receives all input of the types
it requests.
This request indicates to the compositor what kind of interactivity
this surface requires. This may be changed at runtime. Any inputs
included in exclusive_types will not be given to other clients at lower
depths. The compositor may choose under which circumstances to send
inputs. By convention, the compositor will send input events to
the top-most surface of the top-most layer.
</description>
<arg name="types" type="uint" summary="mask of input devices to use"/>
<arg name="input_types" type="uint" summary="mask of input devices to use"/>
<arg name="exclusive_types" type="uint" summary="mask of input devices to use exclusively"/>
</request>
<enum name="anchor" bitfield="true">