mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-06 01:20:18 +01:00
protocol: change the context type enum to start at 1
This avoids future bugs for treating this as a boolean field.
This commit is contained in:
parent
30c4b8d528
commit
845f990883
2 changed files with 6 additions and 4 deletions
|
|
@ -143,8 +143,8 @@
|
|||
from the EIS implementation. A context type of sender is a libei context
|
||||
sending events to the EIS implementation.
|
||||
</description>
|
||||
<entry name="receiver" value="0"/>
|
||||
<entry name="sender" value="1"/>
|
||||
<entry name="receiver" value="1"/>
|
||||
<entry name="sender" value="2"/>
|
||||
</enum>
|
||||
|
||||
<request name="context_type" since="1">
|
||||
|
|
|
|||
|
|
@ -137,9 +137,11 @@ client_msg_context_type(struct eis_connection_setup *setup, uint32_t type)
|
|||
{
|
||||
switch(type) {
|
||||
case EIS_CONNECTION_SETUP_CONTEXT_TYPE_SENDER:
|
||||
setup->is_sender = true;
|
||||
return NULL;
|
||||
case EIS_CONNECTION_SETUP_CONTEXT_TYPE_RECEIVER:
|
||||
setup->is_sender = !!type;
|
||||
return 0;
|
||||
setup->is_sender = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return brei_result_new(EIS_CONNECTION_DISCONNECT_REASON_VALUE, "Invalid context type %u", type);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue