wearable: e_config->show_cursor is false.
mobile: e_config->show_cursor is true. By default, we only have a touch device,
then do not show cursor. If pointer device is enabled, cursor should be appeared.
TV: pointer device is enabled, send pointer_enter event to the focused client
to update client's cursor.
Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I0f1c753cd8b7ff9dc85e32b469d58c57eddd46dd
_e_comp_wl_input_cb_pointer_get(struct wl_client *client, struct wl_resource *resource, uint32_t id)
{
struct wl_resource *res;
+ E_Client *ec;
+ uint32_t serial;
+ int cx, cy;
/* try to create pointer resource */
res = wl_resource_create(client, &wl_pointer_interface,
wl_resource_set_implementation(res, &_e_pointer_interface,
e_comp->wl_comp_data,
_e_comp_wl_input_cb_pointer_unbind);
+
+ /* use_cursor_timer is on. Do not send enter to the focused client. */
+ if (e_config->use_cursor_timer) return;
+
+ if (!(ec = e_client_focused_get())) return;
+ if (e_object_is_del(E_OBJECT(ec))) return;
+ if (!ec->comp_data->surface) return;
+ if (client != wl_resource_get_client(ec->comp_data->surface)) return;
+
+ cx = wl_fixed_to_int(e_comp->wl_comp_data->ptr.x) - ec->client.x;
+ cy = wl_fixed_to_int(e_comp->wl_comp_data->ptr.y) - ec->client.y;
+
+ serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ wl_pointer_send_enter(res, serial, ec->comp_data->surface,
+ wl_fixed_from_int(cx), wl_fixed_from_int(cy));
}
static void
eina_stringshare_replace(&ptr->type, type);
/* don't show cursor if in hidden mode */
- if (!e_config->show_cursor)
+ if ((!e_config->show_cursor) || (!e_comp_wl->ptr.enabled))
{
e_pointer_hide(ptr);
return;
Eina_List *l;
E_Pointer *ptr;
- if (!e_config->show_cursor) return;
+ if ((!e_config->show_cursor) || (!e_comp_wl->ptr.enabled)) return;
EINA_LIST_FOREACH(_ptrs, l, ptr)
{
EINA_SAFETY_ON_NULL_RETURN(ptr);
/* don't show cursor if in hidden mode */
- if (!e_config->show_cursor)
+ if ((!e_config->show_cursor) || (!e_comp_wl->ptr.enabled))
{
if (obj) evas_object_hide(obj);
return;
e_pointer_object_set(comp->pointer, NULL, 0, 0);
e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
}
- if (!e_config->show_cursor)
- e_config->show_cursor = EINA_TRUE;
comp->wl_comp_data->ptr.num_devices++;
}
else if (e->caps & EVDEV_SEAT_KEYBOARD)
}
else if (e->caps & EVDEV_SEAT_TOUCH)
{
- if ((e_config->show_cursor) && (comp->wl_comp_data->ptr.num_devices == 0))
- e_config->show_cursor = EINA_FALSE;
e_comp_wl_input_touch_enabled_set(EINA_TRUE);
comp->wl_comp_data->touch.num_devices++;
}
e_comp_wl_input_pointer_enabled_set(EINA_FALSE);
e_pointer_object_set(comp->pointer, NULL, 0, 0);
e_pointer_hide(e_comp->pointer);
- if (e_config->show_cursor)
- e_config->show_cursor = EINA_FALSE;
}
}