mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 03:38:01 +02:00
Add LIBEVENT_EVENT_NONE
This event type is needed to notify callers that there is currently no event waiting (in a follow-up patch). Also, it it avoids true/false inconsistencies on event types (LIBINPUT_EVENT_ADDED_SEAT would otherwise be the only FALSE event). While that's not technically necessary, it may prevent the odd bug further down the road. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ab9260c5c7
commit
90fa77908b
2 changed files with 8 additions and 1 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
#include "evdev.h"
|
#include "evdev.h"
|
||||||
|
|
||||||
enum libinput_event_class {
|
enum libinput_event_class {
|
||||||
|
LIBINPUT_EVENT_CLASS_NONE,
|
||||||
LIBINPUT_EVENT_CLASS_BASE,
|
LIBINPUT_EVENT_CLASS_BASE,
|
||||||
LIBINPUT_EVENT_CLASS_SEAT,
|
LIBINPUT_EVENT_CLASS_SEAT,
|
||||||
LIBINPUT_EVENT_CLASS_DEVICE,
|
LIBINPUT_EVENT_CLASS_DEVICE,
|
||||||
|
|
@ -418,6 +419,9 @@ static enum libinput_event_class
|
||||||
libinput_event_get_class(struct libinput_event *event)
|
libinput_event_get_class(struct libinput_event *event)
|
||||||
{
|
{
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
|
case LIBINPUT_EVENT_NONE:
|
||||||
|
return LIBINPUT_EVENT_CLASS_NONE;
|
||||||
|
|
||||||
case LIBINPUT_EVENT_ADDED_SEAT:
|
case LIBINPUT_EVENT_ADDED_SEAT:
|
||||||
case LIBINPUT_EVENT_REMOVED_SEAT:
|
case LIBINPUT_EVENT_REMOVED_SEAT:
|
||||||
case LIBINPUT_EVENT_ADDED_DEVICE:
|
case LIBINPUT_EVENT_ADDED_DEVICE:
|
||||||
|
|
@ -444,6 +448,7 @@ libinput_event_destroy(struct libinput_event *event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (libinput_event_get_class(event)) {
|
switch (libinput_event_get_class(event)) {
|
||||||
|
case LIBINPUT_EVENT_CLASS_NONE:
|
||||||
case LIBINPUT_EVENT_CLASS_BASE:
|
case LIBINPUT_EVENT_CLASS_BASE:
|
||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_CLASS_SEAT:
|
case LIBINPUT_EVENT_CLASS_SEAT:
|
||||||
|
|
@ -873,6 +878,7 @@ libinput_post_event(struct libinput *libinput,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (libinput_event_get_class(event)) {
|
switch (libinput_event_get_class(event)) {
|
||||||
|
case LIBINPUT_EVENT_CLASS_NONE:
|
||||||
case LIBINPUT_EVENT_CLASS_BASE:
|
case LIBINPUT_EVENT_CLASS_BASE:
|
||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_CLASS_SEAT:
|
case LIBINPUT_EVENT_CLASS_SEAT:
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,8 @@ enum libinput_touch_type {
|
||||||
* Event type for events returned by libinput_get_event().
|
* Event type for events returned by libinput_get_event().
|
||||||
*/
|
*/
|
||||||
enum libinput_event_type {
|
enum libinput_event_type {
|
||||||
LIBINPUT_EVENT_ADDED_SEAT = 0,
|
LIBINPUT_EVENT_NONE = 0,
|
||||||
|
LIBINPUT_EVENT_ADDED_SEAT,
|
||||||
LIBINPUT_EVENT_REMOVED_SEAT,
|
LIBINPUT_EVENT_REMOVED_SEAT,
|
||||||
LIBINPUT_EVENT_ADDED_DEVICE,
|
LIBINPUT_EVENT_ADDED_DEVICE,
|
||||||
LIBINPUT_EVENT_REMOVED_DEVICE,
|
LIBINPUT_EVENT_REMOVED_DEVICE,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue