if (ec->layer == E_LAYER_CLIENT_CURSOR) return NULL;
if (e_comp_canvas_client_layer_map(ec->layer) == 9999) return NULL;
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
/* go up the layers until we find one */
for (x = e_comp_canvas_layer_map(ec->layer) + 1; x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
{
continue;
}
if (!e_object_is_del(E_OBJECT(ec2)))
- return ec2;
+ {
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+ return ec2;
+ }
}
}
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+
return NULL;
}
x = e_comp_canvas_layer_map(ec_layer);
if (x > 0) x--;
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
for (; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
{
if (!e_comp->layers[x].clients) continue;
continue;
}
if (!e_object_is_del(E_OBJECT(ec2)))
- return ec2;
+ {
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+ return ec2;
+ }
}
}
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+
return NULL;
}
e_client_bottom_get(void)
{
unsigned int x;
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
for (x = e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
{
E_Client *ec2;
if (!e_comp->layers[x].clients) continue;
EINA_INLIST_FOREACH(e_comp->layers[x].clients, ec2)
if (!e_object_is_del(E_OBJECT(ec2)))
- return ec2;
+ {
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+ return ec2;
+ }
}
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+
return NULL;
}
e_client_top_get(void)
{
unsigned int x;
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
for (x = e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
{
E_Client *ec2;
if (!e_comp->layers[x].clients) continue;
EINA_INLIST_REVERSE_FOREACH(e_comp->layers[x].clients, ec2)
if (!e_object_is_del(E_OBJECT(ec2)))
- return ec2;
+ {
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+ return ec2;
+ }
}
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+
return NULL;
}
/* try to get the internal data for the layer;
* will return NULL for fake layers (eg. wayland)
*/
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
if (e_comp->layers[cw->layer].obj)
{
if (evas_object_smart_smart_get(e_comp->layers[cw->layer].obj))
e_comp->layers[cw->layer].clients = eina_inlist_append(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
}
e_comp->layers[cw->layer].clients_count++;
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
#ifndef E_RELEASE_BUILD
if (layer_cw)
{
E_Client *below_ec = e_client_below_get(cw->ec);
if (below_ec)
{
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
if (e_comp->layers[cw->layer].obj == below_ec->frame)
CRI("ACK! ec:%p", cw->ec);
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
}
}
#endif
static void
_e_comp_object_layers_remove(E_Comp_Object *cw)
{
+ g_mutex_lock(&e_comp->input_key_grabs_mutex);
if (cw->ec && e_comp->layers[cw->layer].clients)
{
e_comp->layers[cw->layer].clients = eina_inlist_remove(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
e_comp->layers[cw->layer].clients_count--;
}
+ g_mutex_unlock(&e_comp->input_key_grabs_mutex);
/*
e_comp->layers[cw->layer].objs = eina_inlist_remove(e_comp->layers[cw->layer].objs, EINA_INLIST_GET(cw));
e_comp->layers[cw->layer].objs_count--;