return ECORE_CALLBACK_PASS_ON;
}
+static void
+_e_comp_screen_pointer_renew(E_Input_Event_Input_Device_Del *ev)
+{
+ if ((e_comp_wl->ptr.num_devices == 0) && e_comp_wl->ptr.ec && e_comp_wl->ptr.ec->pointer_enter_sent)
+ {
+ if (e_comp_wl->input_device_manager.last_device_ptr)
+ {
+ Evas_Device *last_ptr = NULL, *dev;
+ Eina_List *list, *l;
+
+ list = (Eina_List *)evas_device_list(evas_object_evas_get(e_comp_wl->ptr.ec->frame), NULL);
+ EINA_LIST_FOREACH(list, l, dev)
+ {
+ if ((!strncmp(evas_device_name_get(dev), e_comp_wl->input_device_manager.last_device_ptr->name, strlen(e_comp_wl->input_device_manager.last_device_ptr->name))) &&
+ (!strncmp(evas_device_description_get(dev), e_comp_wl->input_device_manager.last_device_ptr->identifier, strlen(e_comp_wl->input_device_manager.last_device_ptr->identifier))) &&
+ (evas_device_class_get(dev) == (Evas_Device_Class)e_comp_wl->input_device_manager.last_device_ptr->clas))
+ {
+ last_ptr = dev;
+ break;
+ }
+ }
+ if (last_ptr)
+ e_comp_wl_mouse_out_renew(e_comp_wl->ptr.ec, 0, wl_fixed_to_int(e_comp_wl->ptr.x), wl_fixed_to_int(e_comp_wl->ptr.y), NULL, NULL, NULL, ecore_time_get(), EVAS_EVENT_FLAG_NONE, last_ptr, NULL);
+ }
+ }
+}
+
static Eina_Bool
_e_comp_screen_cb_input_device_del(void *data, int type, void *event)
{
e_comp_wl_input_pointer_enabled_set(EINA_FALSE);
e_pointer_object_set(comp->pointer, NULL, 0, 0);
e_pointer_hide(e_comp->pointer);
+
+ _e_comp_screen_pointer_renew(e);
}
}
if (e->caps & E_INPUT_SEAT_KEYBOARD)
}
else
{
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
- _e_comp_wl_send_mouse_move(ec, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
- e_pointer_mouse_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
-
if (e_config->use_cursor_timer)
{
if (e_pointer_is_hidden(e_comp->pointer))
_e_comp_wl_cursor_reload(ec);
}
+ _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ _e_comp_wl_send_mouse_move(ec, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
+ e_pointer_mouse_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
+
_e_comp_wl_cursor_move_timer_control(ec);
}
}
return EINA_TRUE;
}
+EINTERN void
+e_comp_wl_mouse_in_renew(E_Client *ec, int buttons, int x, int y, void *data, Evas_Modifier *modifiers, Evas_Lock *locks, unsigned int timestamp, Evas_Event_Flags event_flags, Evas_Device *dev, Evas_Object *event_src)
+{
+ Evas_Event_Mouse_In ev_in;
+
+ if (!ec) return;
+ if (ec->pointer_enter_sent) return;
+
+ ev_in.buttons = buttons;
+
+ ev_in.output.x = x;
+ ev_in.output.y = y;
+ ev_in.canvas.x = x;
+ ev_in.canvas.y = y;
+
+ ev_in.data = data;
+ ev_in.modifiers = modifiers;
+ ev_in.locks = locks;
+ ev_in.timestamp = timestamp;
+ ev_in.event_flags = event_flags;
+
+ ev_in.dev = dev;
+ ev_in.event_src = event_src;
+
+ _e_comp_wl_evas_cb_mouse_in((void *)ec, NULL, NULL, &ev_in);
+}
+
+EINTERN void
+e_comp_wl_mouse_out_renew(E_Client *ec, int buttons, int x, int y, void *data, Evas_Modifier *modifiers, Evas_Lock *locks, unsigned int timestamp, Evas_Event_Flags event_flags, Evas_Device *dev, Evas_Object *event_src)
+{
+ Evas_Event_Mouse_Out ev_out;
+
+ if (!ec) return;
+ if (!ec->pointer_enter_sent) return;
+
+ ev_out.buttons = buttons;
+
+ ev_out.output.x = x;
+ ev_out.output.y = y;
+ ev_out.canvas.x = x;
+ ev_out.canvas.y = y;
+
+ ev_out.data = data;
+ ev_out.modifiers = modifiers;
+ ev_out.locks = locks;
+ ev_out.timestamp = timestamp;
+ ev_out.event_flags = event_flags;
+
+ ev_out.dev = dev;
+ ev_out.event_src = event_src;
+
+ _e_comp_wl_evas_cb_mouse_out((void *)ec, NULL, NULL, &ev_out);
+}
+
EINTERN Eina_Bool
e_comp_wl_cursor_hide(E_Client *ec)
{
EINTERN Eina_Bool e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, uint32_t time);
EINTERN Eina_Bool e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t time);
EINTERN Eina_Bool e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time);
+EINTERN void e_comp_wl_mouse_in_renew(E_Client *ec, int buttons, int x, int y, void *data, Evas_Modifier *modifiers, Evas_Lock *locks, unsigned int timestamp, Evas_Event_Flags event_flags, Evas_Device *dev, Evas_Object *event_src);
+EINTERN void e_comp_wl_mouse_out_renew(E_Client *ec, int buttons, int x, int y, void *data, Evas_Modifier *modifiers, Evas_Lock *locks, unsigned int timestamp, Evas_Event_Flags event_flags, Evas_Device *dev, Evas_Object *event_src);
EINTERN Eina_Bool e_comp_wl_cursor_hide(E_Client *ec);
_e_comp_wl_input_cb_pointer_get(struct wl_client *client, struct wl_resource *resource, uint32_t id)
{
struct wl_resource *res;
+ struct wl_client *ptr_client = NULL;
+ E_Comp_Wl_Client_Data *cdata = NULL;
/* 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);
+
+ if ((e_comp_wl->ptr.num_devices == 1) && e_comp_wl->ptr.ec && !e_comp_wl->ptr.ec->pointer_enter_sent && !e_config->use_cursor_timer)
+ {
+ cdata = (E_Comp_Wl_Client_Data*)e_comp_wl->ptr.ec->comp_data;
+ if (cdata && cdata->wl_surface)
+ ptr_client = wl_resource_get_client(cdata->wl_surface);
+
+ if (ptr_client == client)
+ {
+ Evas_Device *last_ptr = NULL, *dev;
+ Eina_List *list, *l;
+
+ list = (Eina_List *)evas_device_list(evas_object_evas_get(e_comp_wl->ptr.ec->frame), NULL);
+ EINA_LIST_FOREACH(list, l, dev)
+ {
+ if ((!strncmp(evas_device_name_get(dev), e_comp_wl->input_device_manager.last_device_ptr->name, strlen(e_comp_wl->input_device_manager.last_device_ptr->name))) &&
+ (!strncmp(evas_device_description_get(dev), e_comp_wl->input_device_manager.last_device_ptr->identifier, strlen(e_comp_wl->input_device_manager.last_device_ptr->identifier))) &&
+ (evas_device_class_get(dev) == (Evas_Device_Class)e_comp_wl->input_device_manager.last_device_ptr->clas))
+ {
+ last_ptr = dev;
+ break;
+ }
+ }
+ if (last_ptr)
+ e_comp_wl_mouse_in_renew(e_comp_wl->ptr.ec, 0, wl_fixed_to_int(e_comp_wl->ptr.x), wl_fixed_to_int(e_comp_wl->ptr.y), NULL, NULL, NULL, ecore_time_get(), EVAS_EVENT_FLAG_NONE, last_ptr, NULL);
+ }
+ }
}
static void