static Eina_List *handlers = NULL;
static double _last_event_time = 0.0;
static E_Client *cursor_timer_ec = NULL;
+static Eina_Bool need_send_leave = EINA_TRUE;
/* local functions */
static void
}
static void
+_e_comp_wl_send_mouse_out(E_Client *ec)
+{
+ struct wl_resource *res;
+ struct wl_client *wc;
+ uint32_t serial;
+ Eina_List *l;
+
+ wc = wl_resource_get_client(ec->comp_data->surface);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ {
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+ if (wl_resource_get_client(res) != wc) continue;
+ wl_pointer_send_leave(res, serial, ec->comp_data->surface);
+ }
+}
+
+static void
_e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
{
E_Client *ec = data;
Evas_Event_Mouse_Down *ev = event;
Evas_Device *dev = NULL;
const char *dev_name;
+ E_Client *focused;
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
else
e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
WL_POINTER_BUTTON_STATE_PRESSED);
+
+ focused = e_client_focused_get();
+ if ((focused) && (ec != focused))
+ {
+ if (need_send_leave)
+ {
+ need_send_leave = EINA_FALSE;
+ _e_comp_wl_send_mouse_out(focused);
+ }
+ }
+ else
+ need_send_leave = EINA_TRUE;
}
static void