1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="keyboard_shortcuts_inhibit_unstable_v1">
3
4  <copyright>
5    Copyright © 2017 Red Hat Inc.
6
7    Permission is hereby granted, free of charge, to any person obtaining a
8    copy of this software and associated documentation files (the "Software"),
9    to deal in the Software without restriction, including without limitation
10    the rights to use, copy, modify, merge, publish, distribute, sublicense,
11    and/or sell copies of the Software, and to permit persons to whom the
12    Software is furnished to do so, subject to the following conditions:
13
14    The above copyright notice and this permission notice (including the next
15    paragraph) shall be included in all copies or substantial portions of the
16    Software.
17
18    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24    DEALINGS IN THE SOFTWARE.
25  </copyright>
26
27  <description summary="Protocol for inhibiting the compositor keyboard shortcuts">
28    This protocol specifies a way for a client to request the compositor
29    to ignore its own keyboard shortcuts for a given seat, so that all
30    key events from that seat get forwarded to a surface.
31
32    Warning! The protocol described in this file is experimental and
33    backward incompatible changes may be made. Backward compatible
34    changes may be added together with the corresponding interface
35    version bump.
36    Backward incompatible changes are done by bumping the version
37    number in the protocol and interface names and resetting the
38    interface version. Once the protocol is to be declared stable,
39    the 'z' prefix and the version number in the protocol and
40    interface names are removed and the interface version number is
41    reset.
42  </description>
43
44  <interface name="zwp_keyboard_shortcuts_inhibit_manager_v1" version="1">
45    <description summary="context object for keyboard grab_manager">
46      A global interface used for inhibiting the compositor keyboard shortcuts.
47    </description>
48
49    <request name="destroy" type="destructor">
50      <description summary="destroy the keyboard shortcuts inhibitor object">
51	Destroy the keyboard shortcuts inhibitor manager.
52      </description>
53    </request>
54
55    <request name="inhibit_shortcuts">
56      <description summary="create a new keyboard shortcuts inhibitor object">
57	Create a new keyboard shortcuts inhibitor object associated with
58	the given surface for the given seat.
59
60	If shortcuts are already inhibited for the specified seat and surface,
61	a protocol error "already_inhibited" is raised by the compositor.
62      </description>
63      <arg name="id" type="new_id" interface="zwp_keyboard_shortcuts_inhibitor_v1"/>
64      <arg name="surface" type="object" interface="wl_surface"
65	   summary="the surface that inhibits the keyboard shortcuts behavior"/>
66      <arg name="seat" type="object" interface="wl_seat"
67	   summary="the wl_seat for which keyboard shortcuts should be disabled"/>
68    </request>
69
70    <enum name="error">
71      <entry name="already_inhibited"
72	     value="0"
73	     summary="the shortcuts are already inhibited for this surface"/>
74    </enum>
75  </interface>
76
77  <interface name="zwp_keyboard_shortcuts_inhibitor_v1" version="1">
78    <description summary="context object for keyboard shortcuts inhibitor">
79      A keyboard shortcuts inhibitor instructs the compositor to ignore
80      its own keyboard shortcuts when the associated surface has keyboard
81      focus. As a result, when the surface has keyboard focus on the given
82      seat, it will receive all key events originating from the specified
83      seat, even those which would normally be caught by the compositor for
84      its own shortcuts.
85
86      The Wayland compositor is however under no obligation to disable
87      all of its shortcuts, and may keep some special key combo for its own
88      use, including but not limited to one allowing the user to forcibly
89      restore normal keyboard events routing in the case of an unwilling
90      client. The compositor may also use the same key combo to reactivate
91      an existing shortcut inhibitor that was previously deactivated on
92      user request.
93
94      When the compositor restores its own keyboard shortcuts, an
95      "inactive" event is emitted to notify the client that the keyboard
96      shortcuts inhibitor is not effectively active for the surface and
97      seat any more, and the client should not expect to receive all
98      keyboard events.
99
100      When the keyboard shortcuts inhibitor is inactive, the client has
101      no way to forcibly reactivate the keyboard shortcuts inhibitor.
102
103      The user can chose to re-enable a previously deactivated keyboard
104      shortcuts inhibitor using any mechanism the compositor may offer,
105      in which case the compositor will send an "active" event to notify
106      the client.
107
108      If the surface is destroyed, unmapped, or loses the seat's keyboard
109      focus, the keyboard shortcuts inhibitor becomes irrelevant and the
110      compositor will restore its own keyboard shortcuts but no "inactive"
111      event is emitted in this case.
112    </description>
113
114    <request name="destroy" type="destructor">
115      <description summary="destroy the keyboard shortcuts inhibitor object">
116	Remove the keyboard shortcuts inhibitor from the associated wl_surface.
117      </description>
118    </request>
119
120    <event name="active">
121      <description summary="shortcuts are inhibited">
122	This event indicates that the shortcut inhibitor is active.
123
124	The compositor sends this event every time compositor shortcuts
125	are inhibited on behalf of the surface. When active, the client
126	may receive input events normally reserved by the compositor
127	(see zwp_keyboard_shortcuts_inhibitor_v1).
128
129	This occurs typically when the initial request "inhibit_shortcuts"
130	first becomes active or when the user instructs the compositor to
131	re-enable and existing shortcuts inhibitor using any mechanism
132	offered by the compositor.
133      </description>
134    </event>
135
136    <event name="inactive">
137      <description summary="shortcuts are restored">
138	This event indicates that the shortcuts inhibitor is inactive,
139	normal shortcuts processing is restored by the compositor.
140       </description>
141    </event>
142  </interface>
143</protocol>
144