aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-03 12:04:34 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-11-28 13:57:55 -0200
commit6b95c4c2eccff5976992b9a4d557e586d90511d1 (patch)
tree16399ca0b81549b70cea955e85e3a8e1630e1ef0 /src/lib/ecore_wl2/ecore_wl2_input.c
parentEvas: Add per seat Evas focus state. (diff)
downloadefl-6b95c4c2eccff5976992b9a4d557e586d90511d1.tar.gz
Ecore Wl2 Input: Canvas focus IN/OUT events should contain the seat.
This provides the information about which seat originated the event.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 3df8f46997..d272dc42f9 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -23,6 +23,7 @@ typedef struct _Ecore_Wl2_Input_Devices
Eo *pointer_dev;
Eo *keyboard_dev;
Eo *touch_dev;
+ Eo *seat_dev;
int window_id;
} Ecore_Wl2_Input_Devices;
@@ -92,6 +93,18 @@ _ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, int window_id)
return NULL;
}
+static Eo *
+_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, int window_id)
+{
+ Ecore_Wl2_Input_Devices *devices;
+
+ devices = _ecore_wl2_devices_get(input, window_id);
+ if (devices)
+ return efl_ref(devices->seat_dev);
+
+ return NULL;
+}
+
static void
_input_event_cb_free(void *data, void *event)
{
@@ -389,7 +402,9 @@ _ecore_wl2_input_focus_in_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
ev->timestamp = input->timestamp;
ev->window = window->id;
- ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, NULL, NULL);
+ ev->dev = _ecore_wl2_seat_dev_get(input, window->id);
+ ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, _input_event_cb_free,
+ ev->dev);
}
static void
@@ -402,7 +417,9 @@ _ecore_wl2_input_focus_out_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window
ev->timestamp = input->timestamp;
ev->window = window->id;
- ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, NULL, NULL);
+ ev->dev = _ecore_wl2_seat_dev_get(input, window->id);
+ ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, _input_event_cb_free,
+ ev->dev);
}
static int
@@ -1331,6 +1348,8 @@ _ecore_wl2_input_cursor_update(void *data)
static void
_ecore_wl2_devices_free(Ecore_Wl2_Input_Devices *devices)
{
+ if (devices->seat_dev)
+ efl_unref(devices->seat_dev);
if (devices->pointer_dev)
efl_unref(devices->pointer_dev);
if (devices->keyboard_dev)
@@ -1378,6 +1397,8 @@ _ecore_evas_wl_common_cb_device_event(void *data, int type, void *event)
devices->keyboard_dev = efl_ref(ev->dev);
else if (ev->type == ECORE_WL2_DEVICE_TYPE_TOUCH)
devices->touch_dev = efl_ref(ev->dev);
+ else if (ev->type == ECORE_WL2_DEVICE_TYPE_SEAT)
+ devices->seat_dev = efl_ref(ev->dev);
return ECORE_CALLBACK_PASS_ON;
}