aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2016-10-05 10:36:19 -0300
committerBruno Dilly <bdilly@profusion.mobi>2016-11-01 16:06:19 -0200
commit7aab35961fcd4a8cb93126ec38bf7690b2c5c7d8 (patch)
treee8c9789fc05b3f963f8781e6525dd03e296cbb55 /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore_wl2: add ecore event for seat name change (diff)
downloadefl-7aab35961fcd4a8cb93126ec38bf7690b2c5c7d8.tar.gz
ecore_wl2: add ecore event for seat capabilities change
So when mouse / keyboard are present or not it will generate events. ecore_evas/wayland will handle that creating or deleting evas devices for each one (seat device will be used as parent).
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 36013fba05..3ce69e4377 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1130,6 +1130,7 @@ static const struct wl_data_device_listener _data_listener =
static void
_seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps)
{
+ Ecore_Wl2_Event_Seat_Capabilities *ev;
Ecore_Wl2_Input *input;
input = data;
@@ -1185,6 +1186,16 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
wl_touch_destroy(input->wl.touch);
input->wl.touch = NULL;
}
+
+ ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Capabilities));
+ EINA_SAFETY_ON_NULL_RETURN(ev);
+
+ ev->id = input->id;
+ ev->pointer_enabled = !!(caps & WL_SEAT_CAPABILITY_POINTER);
+ ev->keyboard_enabled = !!(caps & WL_SEAT_CAPABILITY_KEYBOARD);
+ ev->touch_enabled = !!(caps & WL_SEAT_CAPABILITY_TOUCH);
+
+ ecore_event_add(ECORE_WL2_EVENT_SEAT_CAPABILITIES_CHANGED, ev, NULL, NULL);
}
static void