forked from enlightenment/efl
evas: create dummy seat data for wl/drm outputs, store some pointer data
with async device init, it's possible for mouse in/out/move events to be added by an application before the pointer devices are created. these are independent of devices, so store the state and apply when pointer devices are added fix T5531
This commit is contained in:
parent
7ca2da0f5d
commit
e3126bd23f
|
@ -186,7 +186,8 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
|
|||
e->default_keyboard = dev;
|
||||
else if (_is_pointer(clas))
|
||||
{
|
||||
if (!_evas_pointer_data_add(e, dev))
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_add(e, dev);
|
||||
if (!pdata)
|
||||
{
|
||||
efl_del(dev);
|
||||
return NULL;
|
||||
|
@ -198,7 +199,6 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
|
|||
(parent_dev == e->default_seat) &&
|
||||
(evas_device_class_get(e->default_mouse) != EVAS_DEVICE_CLASS_MOUSE))
|
||||
{
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, e->default_mouse);
|
||||
Eina_Bool inside = pdata->seat->inside;
|
||||
|
||||
if (inside)
|
||||
|
@ -209,7 +209,19 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
|
|||
}
|
||||
}
|
||||
else
|
||||
e->default_mouse = dev;
|
||||
{
|
||||
Evas_Pointer_Seat *pseat;
|
||||
|
||||
EINA_INLIST_FOREACH(e->seats, pseat)
|
||||
if (!pseat->pointers) break;
|
||||
e->default_mouse = dev;
|
||||
if (pseat)
|
||||
{
|
||||
if (pseat->inside)
|
||||
evas_event_feed_mouse_in(eo_e, 0, NULL);
|
||||
evas_event_feed_mouse_move(eo_e, pseat->x, pseat->y, 0, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: All devices are in the same list, while evas only refs the seats
|
||||
|
|
|
@ -2054,8 +2054,26 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da
|
|||
if (e->is_frozen) return;
|
||||
EVAS_EVENT_FEED_SAFETY_CHECK(e);
|
||||
|
||||
pdata = _evas_pointer_data_by_device_get(e, ev->device);
|
||||
if (!pdata) return;
|
||||
if (ev->device)
|
||||
{
|
||||
pdata = _evas_pointer_data_by_device_get(e, ev->device);
|
||||
if (!pdata) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Pointer_Seat *pseat;
|
||||
if (!e->seats) return;
|
||||
pseat = EINA_INLIST_CONTAINER_GET(e->seats, Evas_Pointer_Seat);
|
||||
pseat->inside = 1;
|
||||
e->last_timestamp = ev->timestamp;
|
||||
pseat->prev.x = pseat->x;
|
||||
pseat->prev.y = pseat->y;
|
||||
|
||||
// new pos
|
||||
pseat->x = ev->cur.x;
|
||||
pseat->y = ev->cur.y;
|
||||
return;
|
||||
}
|
||||
|
||||
eo_e = e->evas;
|
||||
e->last_timestamp = ev->timestamp;
|
||||
|
@ -2469,8 +2487,19 @@ _canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev)
|
|||
if (!e || !ev) return;
|
||||
EVAS_EVENT_FEED_SAFETY_CHECK(e);
|
||||
|
||||
pdata = _evas_pointer_data_by_device_get(e, ev->device);
|
||||
if (!pdata) return;
|
||||
if (ev->device)
|
||||
{
|
||||
pdata = _evas_pointer_data_by_device_get(e, ev->device);
|
||||
if (!pdata) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Pointer_Seat *pseat;
|
||||
if (!e->seats) return;
|
||||
pseat = EINA_INLIST_CONTAINER_GET(e->seats, Evas_Pointer_Seat);
|
||||
pseat->inside = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
pdata->seat->inside = 1;
|
||||
if (e->is_frozen) return;
|
||||
|
@ -2549,8 +2578,19 @@ _canvas_event_feed_mouse_out_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev)
|
|||
|
||||
if (!e || !ev) return;
|
||||
EVAS_EVENT_FEED_SAFETY_CHECK(e);
|
||||
pdata = _evas_pointer_data_by_device_get(e, ev->device);
|
||||
if (!pdata) return;
|
||||
if (ev->device)
|
||||
{
|
||||
pdata = _evas_pointer_data_by_device_get(e, ev->device);
|
||||
if (!pdata) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Pointer_Seat *pseat;
|
||||
if (!e->seats) return;
|
||||
pseat = EINA_INLIST_CONTAINER_GET(e->seats, Evas_Pointer_Seat);
|
||||
pseat->inside = 0;
|
||||
return;
|
||||
}
|
||||
pdata->seat->inside = 0;
|
||||
|
||||
if (e->is_frozen) return;
|
||||
|
@ -4126,6 +4166,7 @@ _evas_canvas_event_pointer_in_rect_mouse_move_feed(Evas_Public_Data *edata,
|
|||
|
||||
EINA_INLIST_FOREACH(edata->seats, pseat)
|
||||
{
|
||||
if (!pseat->pointers) continue;
|
||||
if (!evas_object_is_in_output_rect(obj, obj_data, pseat->x,
|
||||
pseat->y, w, h))
|
||||
continue;
|
||||
|
@ -4152,7 +4193,10 @@ _evas_canvas_event_pointer_in_list_mouse_move_feed(Evas_Public_Data *edata,
|
|||
{
|
||||
Evas_Pointer_Data *pdata, *found = NULL;
|
||||
Eina_List *l;
|
||||
int in = evas_object_is_in_output_rect(obj, obj_data, pseat->x,
|
||||
int in;
|
||||
|
||||
if (!pseat->pointers) continue;
|
||||
in = evas_object_is_in_output_rect(obj, obj_data, pseat->x,
|
||||
pseat->y, w, h);
|
||||
EINA_LIST_FOREACH(was, l, pdata)
|
||||
if (pdata->seat == pseat)
|
||||
|
|
|
@ -1025,7 +1025,11 @@ evas_output_method_set(Evas *eo_e, int render_method)
|
|||
eina_streq(em->definition->name, "wayland_egl") ||
|
||||
eina_streq(em->definition->name, "drm") ||
|
||||
eina_streq(em->definition->name, "gl_drm")))
|
||||
return;
|
||||
{
|
||||
Evas_Pointer_Seat *pseat = calloc(1, sizeof(Evas_Pointer_Seat));
|
||||
e->seats = eina_inlist_append(e->seats, EINA_INLIST_GET(pseat));
|
||||
return;
|
||||
}
|
||||
|
||||
e->default_seat = evas_device_add_full(eo_e, "default", "The default seat",
|
||||
NULL, NULL, EVAS_DEVICE_CLASS_SEAT,
|
||||
|
|
Loading…
Reference in New Issue