static void _e_comp_wl_subsurface_restack(E_Client *ec);
static void _e_comp_wl_subsurface_restack_bg_rectangle(E_Client *ec);
-static Eina_Bool _e_comp_wl_cursor_timer(void *data);
-static void _e_comp_wl_cursor_reload(E_Client *ec);
-
/* local variables */
typedef struct _E_Comp_Wl_Transform_Context
{
}
}
+static void
+_e_comp_wl_cursor_reload(E_Client *ec)
+{
+ struct wl_resource *res;
+ struct wl_client *wc;
+ Eina_List *l;
+ uint32_t serial;
+ int cx, cy;
+
+ if (e_comp->pointer->o_ptr && (!evas_object_visible_get(e_comp->pointer->o_ptr)))
+ e_pointer_object_set(e_comp->pointer, NULL, 0, 0);
+
+ if (!ec) return;
+ if (e_object_is_del(E_OBJECT(ec))) return;
+ if (!ec->comp_data->surface) return;
+
+ cx = wl_fixed_to_int(e_comp_wl->ptr.x) - ec->client.x;
+ cy = wl_fixed_to_int(e_comp_wl->ptr.y) - ec->client.y;
+
+ 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_enter(res, serial, ec->comp_data->surface,
+ wl_fixed_from_int(cx), wl_fixed_from_int(cy));
+ }
+}
+
+static Eina_Bool
+_e_comp_wl_cursor_timer(void *data)
+{
+ E_Client *ec = data;
+ struct wl_resource *res;
+ struct wl_client *wc;
+ Eina_List *l;
+ uint32_t serial;
+
+ ecore_evas_cursor_unset(e_comp->pointer->ee);
+
+ if (e_comp->pointer->o_ptr)
+ e_pointer_hide(e_comp->pointer);
+
+ e_comp_wl->ptr.hide_tmr = NULL;
+
+ if (!ec) return EINA_FALSE;
+ if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
+
+ if (!ec->comp_data->surface) return EINA_FALSE;
+ 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);
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
static void
_e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
if (e_config->use_cursor_timer)
{
- if (e_comp_wl->ptr.hidden == EINA_TRUE)
+ if (e_pointer_is_hidden(e_comp->pointer))
return;
else
{
ecore_evas_cursor_get(e_comp->ee, &o, NULL, NULL, NULL);
if ((e_comp->pointer->o_ptr != o) && (e_comp->wl_comp_data->ptr.enabled))
{
- if ((!e_config->use_cursor_timer) || (!e_comp->wl_comp_data->ptr.hidden))
+ if ((!e_config->use_cursor_timer) || (!e_pointer_is_hidden(e_comp->pointer)))
e_pointer_object_set(e_comp->pointer, NULL, 0, 0);
}
}
- if (e_config->use_cursor_timer)
- E_FREE_FUNC(e_comp_wl->ptr.hide_tmr, ecore_timer_del);
if (e_object_is_del(E_OBJECT(ec))) return;
}
}
-static void
-_e_comp_wl_cursor_reload(E_Client *ec)
-{
- struct wl_resource *res;
- struct wl_client *wc;
- Eina_List *l;
- uint32_t serial;
- int cx, cy;
-
- if (e_object_is_del(E_OBJECT(ec))) return;
-
- if (e_comp->pointer->o_ptr && (!evas_object_visible_get(e_comp->pointer->o_ptr)))
- e_pointer_object_set(e_comp->pointer, NULL, 0, 0);
-
- e_comp_wl->ptr.hidden = EINA_FALSE;
-
- 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;
-
- if (!ec->comp_data->surface) return;
- 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_enter(res, serial, ec->comp_data->surface,
- wl_fixed_from_int(cx), wl_fixed_from_int(cy));
- }
-}
-
-static Eina_Bool
-_e_comp_wl_cursor_timer(void *data)
-{
- E_Client *ec = data;
- struct wl_resource *res;
- struct wl_client *wc;
- Eina_List *l;
- uint32_t serial;
-
- if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
-
- ecore_evas_cursor_unset(e_comp->pointer->ee);
-
- if (e_comp->pointer->o_ptr)
- e_pointer_hide(e_comp->pointer);
-
- e_comp_wl->ptr.hidden = EINA_TRUE;
- e_comp_wl->ptr.hide_tmr = NULL;
-
- if (!ec->comp_data->surface) return EINA_FALSE;
- 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);
- }
-
- return ECORE_CALLBACK_CANCEL;
-}
-
static void
_e_comp_wl_send_mouse_move(E_Client *ec, int x, int y, unsigned int timestamp)
{
}
if (e_config->use_cursor_timer)
{
- if (e_comp_wl->ptr.hidden == EINA_TRUE)
+ if (e_pointer_is_hidden(e_comp->pointer))
_e_comp_wl_cursor_reload(ec);
if (e_comp_wl->ptr.hide_tmr)
else
e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
WL_POINTER_BUTTON_STATE_PRESSED);
-
- if (e_config->use_cursor_timer)
- {
- if (e_comp_wl->ptr.hidden == EINA_TRUE)
- _e_comp_wl_cursor_reload(ec);
-
- if (e_comp_wl->ptr.hide_tmr)
- {
- ecore_timer_interval_set(e_comp_wl->ptr.hide_tmr, e_config->cursor_timer_interval);
- ecore_timer_reset(e_comp_wl->ptr.hide_tmr);
- }
- else
- e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
- }
}
static void
e_comp_wl->drag_client &&
e_client_has_xwindow(e_comp_wl->drag_client))
_e_comp_wl_send_mouse_move(e_comp_wl->drag_client, ev->x, ev->y, ev->timestamp);
+
+ if (e_config->use_cursor_timer)
+ {
+ if (e_pointer_is_hidden(e_comp->pointer))
+ _e_comp_wl_cursor_reload(NULL);
+
+ if (e_comp_wl->ptr.hide_tmr)
+ {
+ ecore_timer_interval_set(e_comp_wl->ptr.hide_tmr, e_config->cursor_timer_interval);
+ ecore_timer_reset(e_comp_wl->ptr.hide_tmr);
+ }
+ else
+ e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, NULL);
+ }
+
return ECORE_CALLBACK_RENEW;
}