Ecore Wayland: Remove ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT.

Summary:
It's not possible to have an Ecore_Wl2_Input without a seat.

Ecore Evas Wayland: Remove seat existence check.

At this point every seat advertised is considered new, therefore
it will not be in the devices list.

Reviewers: barbieri, jpeg, cedric, bdilly

Reviewed By: bdilly

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4408
This commit is contained in:
Guilherme Iscaro 2016-11-16 17:04:02 -02:00 committed by Bruno Dilly
parent 55ab71bd67
commit 9f8e2e0d9c
3 changed files with 11 additions and 38 deletions

View File

@ -56,11 +56,10 @@ typedef enum
typedef enum
{
ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT = 0,
ECORE_WL2_SEAT_CAPABILITIES_NONE = 1,
ECORE_WL2_SEAT_CAPABILITIES_POINTER = 2,
ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD = 4,
ECORE_WL2_SEAT_CAPABILITIES_TOUCH = 8
ECORE_WL2_SEAT_CAPABILITIES_NONE = 0,
ECORE_WL2_SEAT_CAPABILITIES_POINTER = 1,
ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD = 2,
ECORE_WL2_SEAT_CAPABILITIES_TOUCH = 4
} Ecore_Wl2_Seat_Capabilities;
struct _Ecore_Wl2_Event_Connection

View File

@ -1589,10 +1589,8 @@ ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input *input)
Ecore_Wl2_Seat_Capabilities cap = ECORE_WL2_SEAT_CAPABILITIES_NONE;
EINA_SAFETY_ON_NULL_RETURN_VAL(input, ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT);
EINA_SAFETY_ON_NULL_RETURN_VAL(input, cap);
if (!input->wl.seat)
return ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT;
if (input->wl.keyboard)
cap |= ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD;
if (input->wl.pointer)

View File

@ -518,17 +518,18 @@ _ecore_evas_wl_common_device_event_add(int event_type, Ecore_Wl2_Device_Type dev
static EE_Wl_Device *
_ecore_evas_wl_common_seat_add(Ecore_Evas *ee,
const char *seat_name,
unsigned int id)
{
Ecore_Evas_Engine_Wl_Data *wdata;
EE_Wl_Device *device;
Evas_Device *dev;
char buf[32];
device = calloc(1, sizeof(EE_Wl_Device));
EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
dev = evas_device_add_full(ee->evas, seat_name, "Wayland seat",
snprintf(buf, sizeof(buf), "seat-%u", id);
dev = evas_device_add_full(ee->evas, buf, "Wayland seat",
NULL, NULL,
EVAS_DEVICE_CLASS_SEAT,
EVAS_DEVICE_SUBCLASS_NONE);
@ -555,37 +556,17 @@ _ecore_evas_wl_common_cb_global_added(void *d EINA_UNUSED, int t EINA_UNUSED, vo
Ecore_Wl2_Event_Global *ev = event;
Ecore_Evas *ee;
Eina_List *l;
char buf[32];
if ((!ev->interface) || (strcmp(ev->interface, "wl_seat")))
return ECORE_CALLBACK_PASS_ON;
snprintf(buf, sizeof(buf), "seat-%u", ev->id);
EINA_LIST_FOREACH(ee_list, l, ee)
{
Eina_List *ll;
EE_Wl_Device *device;
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
Eina_Bool already_present = EINA_FALSE;
EINA_LIST_FOREACH(wdata->devices_list, ll, device)
{
if (device->id == ev->id)
{
already_present = EINA_TRUE;
break;
}
}
if (!already_present && !_ecore_evas_wl_common_seat_add(ee, buf, ev->id))
goto err_add;
if (!_ecore_evas_wl_common_seat_add(ee, ev->id))
break;
}
return ECORE_CALLBACK_PASS_ON;
err_add:
return ECORE_CALLBACK_PASS_ON;
}
static void
@ -2043,17 +2024,12 @@ _ecore_wl2_devices_setup(Ecore_Evas *ee, Ecore_Wl2_Display *display)
{
EE_Wl_Device *device;
Ecore_Wl2_Seat_Capabilities cap;
char buf[32];
unsigned int id;
id = ecore_wl2_input_seat_id_get(input);
cap = ecore_wl2_input_seat_capabilities_get(input);
//No seat, ignore...
if (cap == ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT)
continue;
device = _ecore_evas_wl_common_seat_add(ee, id);
snprintf(buf, sizeof(buf), "seat-%u", id);
device = _ecore_evas_wl_common_seat_add(ee, buf, id);
if (!device)
{
r = EINA_FALSE;