return EINA_FALSE;
}
+static Eina_Bool
+_e_gesture_deactivate_find_client(Eina_List *list, struct wl_client *client)
+{
+ Eina_List *l;
+ struct wl_client *client_data;
+
+ EINA_LIST_FOREACH(list, l, client_data)
+ {
+ if (client_data == client)
+ {
+ return EINA_TRUE;
+ }
+ }
+ return EINA_FALSE;
+}
+
static void
_e_gesture_deactivate_list_unset(struct wl_client *client, struct wl_resource *surface, E_Gesture_Activate_Info *info, unsigned int type)
{
Eina_List *l, *l_next;
struct wl_resource *surface_data;
+ struct wl_client *client_data;
+ Eina_Bool removed = EINA_FALSE;
if (surface)
{
if (surface_data == surface)
{
info->surfaces = eina_list_remove_list(info->surfaces, l);
+ removed = EINA_TRUE;
+ if (info->surface == surface)
+ {
+ info->surface = NULL;
+ if (eina_list_count(info->clients) == 0)
+ {
+ info->active = EINA_TRUE;
+ }
+ }
break;
}
}
}
- else if (info->client && (info->client == client))
- {
- info->client = NULL;
- info->active = EINA_TRUE;
- }
else
{
- GTWRN("Failed to unset %s deactivate. surface: %p, client: %p (already deactivated client: %p)\n", _e_gesture_util_type_to_string(type), surface, client, info->client);
+ EINA_LIST_FOREACH_SAFE(info->clients, l, l_next, client_data)
+ {
+ if (client_data == client)
+ {
+ info->clients = eina_list_remove_list(info->clients, l);
+ removed = EINA_TRUE;
+ break;
+ }
+ }
+ if (removed && (eina_list_count(info->clients) == 0))
+ {
+ if (!info->surface)
+ {
+ info->active = EINA_TRUE;
+ }
+ }
}
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
E_Client *focused_ec = NULL;
+ Eina_Bool added = EINA_FALSE;
if (surface)
{
surface == focused_ec->comp_data->wl_surface)
{
info->active = EINA_FALSE;
+ info->surface = surface;
}
+ added = EINA_TRUE;
}
}
- else if (!info->client)
+ else
{
- info->client = client;
- info->active = EINA_FALSE;
- _e_gesture_deactivate_listener_add(client, surface);
+ if (!_e_gesture_deactivate_find_client(info->clients, client))
+ {
+ info->clients = eina_list_append(info->clients, client);
+ _e_gesture_deactivate_listener_add(client, surface);
+ info->active = EINA_FALSE;
+ added = EINA_TRUE;
+ }
}
- else
+
+ if (!added)
{
- GTWRN("Failed to deactivate %s !(request surface: %p, client: %p), already deactivated client: %p\n",
- _e_gesture_util_type_to_string(type), surface, client, info->client);
+ GTWRN("Failed to deactivate %s !(request surface: %p, client: %p)\n",
+ _e_gesture_util_type_to_string(type), surface, client);
ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
}
{
Eina_Bool res;
+ if (eina_list_count(info->surfaces) == 0) return;
+
res = _e_gesture_deactivate_find_surface(info->surfaces, surface);
- if (res) info->active = EINA_FALSE;
- else info->active = EINA_TRUE;
+ if (res)
+ {
+ info->active = EINA_FALSE;
+ info->surface = surface;
+ }
+ else
+ {
+ if (eina_list_count(info->clients) == 0)
+ {
+ info->active = EINA_TRUE;
+ }
+ info->surface = NULL;
+ }
}
static void
surface = ec->comp_data->wl_surface;
if (!surface) return;
- if (!gesture->gesture_events.edge_swipes.base.activation.client)
- {
- _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.edge_swipes.base.activation);
- }
- if (!gesture->gesture_events.taps.activation.client)
- {
- _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.taps.activation);
- }
- if (!gesture->gesture_events.palm_covers.activation.client)
- {
- _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.palm_covers.activation);
- }
- if (!gesture->gesture_events.pans.activation.client)
- {
- _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.pans.activation);
- }
- if (!gesture->gesture_events.pinchs.activation.client)
- {
- _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.pinchs.activation);
- }
+ _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.edge_swipes.base.activation);
+ _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.taps.activation);
+ _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.palm_covers.activation);
+ _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.pans.activation);
+ _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.pinchs.activation);
}
static void