e_input: use recursive mutex 41/300441/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 24 Oct 2023 11:47:32 +0000 (20:47 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 25 Oct 2023 05:20:05 +0000 (14:20 +0900)
It is possible to lock a GRecMutex multiple times in the same thread without deadlock

Change-Id: I960b0c2a465255b6ba142a62aa781445f414dc45
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
17 files changed:
src/bin/e_client.c
src/bin/e_comp.c
src/bin/e_comp.h
src/bin/e_comp_object.c
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_compositor.c
src/bin/e_devicemgr.c
src/bin/e_devicemgr.h
src/bin/e_devicemgr_input.c
src/bin/e_focus_policy_history.c
src/bin/e_focus_policy_topmost.c
src/bin/e_input.h
src/bin/e_input_device.c
src/bin/e_input_evdev.c
src/bin/e_input_private.h
src/bin/e_keyrouter_wl.c

index f948815..8fe284f 100644 (file)
@@ -5012,7 +5012,7 @@ e_client_above_get(const E_Client *ec)
    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);
+   g_rec_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++)
      {
@@ -5027,12 +5027,12 @@ e_client_above_get(const E_Client *ec)
                }
              if (!e_object_is_del(E_OBJECT(ec2)))
                {
-                  g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+                  g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                   return ec2;
                }
           }
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    return NULL;
 }
@@ -5088,7 +5088,7 @@ e_client_below_get(const E_Client *ec)
    x = e_comp_canvas_layer_map(ec_layer);
    if (x > 0) x--;
 
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_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;
@@ -5102,12 +5102,12 @@ e_client_below_get(const E_Client *ec)
                }
              if (!e_object_is_del(E_OBJECT(ec2)))
                {
-                  g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+                  g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                   return ec2;
                }
           }
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    return NULL;
 }
@@ -5116,7 +5116,7 @@ E_API E_Client *
 e_client_bottom_get(void)
 {
    unsigned int x;
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_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;
@@ -5125,11 +5125,11 @@ e_client_bottom_get(void)
         EINA_INLIST_FOREACH(e_comp->layers[x].clients, ec2)
           if (!e_object_is_del(E_OBJECT(ec2)))
             {
-               g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+               g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                return ec2;
             }
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    return NULL;
 }
@@ -5138,7 +5138,7 @@ E_API E_Client *
 e_client_top_get(void)
 {
    unsigned int x;
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_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;
@@ -5147,11 +5147,11 @@ e_client_top_get(void)
         EINA_INLIST_REVERSE_FOREACH(e_comp->layers[x].clients, ec2)
           if (!e_object_is_del(E_OBJECT(ec2)))
             {
-               g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+               g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                return ec2;
             }
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    return NULL;
 }
@@ -5354,13 +5354,13 @@ e_client_refocus(void)
         if (!desk) continue;
         if (desk->visible && (!ec->iconic))
           {
-             g_mutex_lock(&e_comp->input_key_grabs_mutex);
+             g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
              if (e_comp->input_key_grabs || e_comp->input_mouse_grabs)
                {
-                  g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+                  g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                   break;
                }
-             g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+             g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
              ELOGF("FOCUS", "focus set   | refocus", ec);
              e_client_frame_focus_set(ec, EINA_TRUE);
              break;
index 3db04ef..5bdf536 100644 (file)
@@ -453,7 +453,7 @@ e_comp_init(void)
    E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_SIGNAL_USER, _e_comp_signal_user,     NULL);
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD, _e_comp_object_add,      NULL);
 
-   g_mutex_init(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_init(&e_comp->input_key_grabs_mutex);
 
    return EINA_TRUE;
 }
@@ -510,7 +510,7 @@ e_comp_shutdown(void)
 
    E_FREE_FUNC(ignores, eina_hash_free);
 
-   g_mutex_clear(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_clear(&e_comp->input_key_grabs_mutex);
 
    return 1;
 }
@@ -776,7 +776,7 @@ e_comp_grab_input(Eina_Bool mouse, Eina_Bool kbd)
    if (kbd || e_comp->input_mouse_grabs)
      kwin = e_comp->ee_win;
    //e_comp_override_add(); //nocomp condition
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
    if ((e_comp->input_mouse_grabs && e_comp->input_key_grabs) ||
        e_grabinput_get(mwin, 0, kwin))
      {
@@ -784,7 +784,7 @@ e_comp_grab_input(Eina_Bool mouse, Eina_Bool kbd)
         e_comp->input_mouse_grabs += mouse;
         e_comp->input_key_grabs += kbd;
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    return ret;
 }
@@ -799,18 +799,18 @@ e_comp_ungrab_input(Eina_Bool mouse, Eina_Bool kbd)
    if (e_comp->input_mouse_grabs)
      e_comp->input_mouse_grabs -= mouse;
 
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
    if (e_comp->input_key_grabs)
      e_comp->input_key_grabs -= kbd;
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    if (mouse && (!e_comp->input_mouse_grabs))
      mwin = e_comp->ee_win;
 
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
    if (kbd && (!e_comp->input_key_grabs))
      kwin = e_comp->ee_win;
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    //e_comp_override_timed_pop(); //nocomp condition
    if ((!mwin) && (!kwin)) return;
index 11af5af..0b96ced 100644 (file)
@@ -191,7 +191,7 @@ struct _E_Comp
       double interval; // time value the interval of commit_handler after tdm_commit in second (default : 0)
    } commit_handler_timer;
 
-   GMutex          input_key_grabs_mutex;
+   GRecMutex          input_key_grabs_mutex;
 };
 
 struct _E_Comp_Connected_Client_Info
index 19765da..d116026 100644 (file)
@@ -600,7 +600,7 @@ _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object
    /* 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);
+   g_rec_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))
@@ -621,17 +621,17 @@ _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object
           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);
+   g_rec_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);
+             g_rec_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);
+             g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
           }
      }
 #endif
@@ -640,13 +640,13 @@ _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object
 static void
 _e_comp_object_layers_remove(E_Comp_Object *cw)
 {
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_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);
+   g_rec_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--;
index 1a0a046..65e9387 100644 (file)
@@ -792,9 +792,9 @@ _e_comp_wl_device_last_device_get(Ecore_Device_Class dev_class)
       case ECORE_DEVICE_CLASS_MOUSE:
          return e_devicemgr->last_device_ptr;
       case ECORE_DEVICE_CLASS_KEYBOARD:
-         g_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
+         g_rec_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
          last_kbd = e_devicemgr->last_device_kbd;
-         g_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
+         g_rec_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
          return last_kbd;
       case ECORE_DEVICE_CLASS_TOUCH:
          return e_devicemgr->last_device_touch;
@@ -813,9 +813,9 @@ _e_comp_wl_device_last_device_set(Ecore_Device_Class dev_class, E_Devicemgr_Inpu
          e_devicemgr->last_device_ptr = device;
          break;
       case ECORE_DEVICE_CLASS_KEYBOARD:
-         g_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
+         g_rec_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
          e_devicemgr->last_device_kbd = device;
-         g_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
+         g_rec_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
          break;
       case ECORE_DEVICE_CLASS_TOUCH:
          e_devicemgr->last_device_touch = device;
@@ -835,9 +835,9 @@ _e_comp_wl_device_client_last_device_get(E_Client *ec, Ecore_Device_Class dev_cl
       case ECORE_DEVICE_CLASS_MOUSE:
          return ec->comp_data->last_device_ptr;
       case ECORE_DEVICE_CLASS_KEYBOARD:
-         g_mutex_lock(&ec->comp_data->last_device_kbd_mutex);
+         g_rec_mutex_lock(&ec->comp_data->last_device_kbd_mutex);
          last_kbd = ec->comp_data->last_device_kbd;
-         g_mutex_unlock(&ec->comp_data->last_device_kbd_mutex);
+         g_rec_mutex_unlock(&ec->comp_data->last_device_kbd_mutex);
          return last_kbd;
       case ECORE_DEVICE_CLASS_TOUCH:
          return ec->comp_data->last_device_touch;
@@ -856,9 +856,9 @@ _e_comp_wl_device_client_last_device_set(E_Client *ec, Ecore_Device_Class dev_cl
          ec->comp_data->last_device_ptr = device;
          break;
       case ECORE_DEVICE_CLASS_KEYBOARD:
-         g_mutex_lock(&ec->comp_data->last_device_kbd_mutex);
+         g_rec_mutex_lock(&ec->comp_data->last_device_kbd_mutex);
          ec->comp_data->last_device_kbd = device;
-         g_mutex_unlock(&ec->comp_data->last_device_kbd_mutex);
+         g_rec_mutex_unlock(&ec->comp_data->last_device_kbd_mutex);
          break;
       case ECORE_DEVICE_CLASS_TOUCH:
          ec->comp_data->last_device_touch = device;
@@ -896,7 +896,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim
 
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
    wc = wl_resource_get_client(surface);
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
      {
         if (!eina_streq(input_dev->identifier, dev_name) || (input_dev->clas != dev_class)) continue;
@@ -912,7 +912,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim
                }
           }
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 }
 
 static void
@@ -953,7 +953,7 @@ _e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Ecore_Dev
 
    dev_name = ecore_device_identifier_get(dev);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
      {
         if (!eina_streq(input_dev->identifier, dev_name) ||
@@ -966,7 +966,7 @@ _e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Ecore_Dev
              tizen_input_device_send_event_device(dev_res, serial, input_dev->identifier, timestamp);
           }
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 }
 
 static void
@@ -981,7 +981,7 @@ _e_comp_wl_send_event_e_device(struct wl_client *wc, uint32_t timestamp, E_Devic
 
    dev_name = e_device_identifier_get(dev);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
      {
         if (!eina_streq(input_dev->identifier, dev_name) ||
@@ -994,7 +994,7 @@ _e_comp_wl_send_event_e_device(struct wl_client *wc, uint32_t timestamp, E_Devic
              tizen_input_device_send_event_device(dev_res, serial, input_dev->identifier, timestamp);
           }
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 }
 
 static void
@@ -1074,7 +1074,7 @@ _e_comp_wl_device_send_axis(const char *dev_name, Evas_Device_Class dev_class, E
    f_value = wl_fixed_from_double(value);
    wc = wl_resource_get_client(surface);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
      {
         if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
@@ -1084,7 +1084,7 @@ _e_comp_wl_device_send_axis(const char *dev_name, Evas_Device_Class dev_class, E
              tizen_input_device_send_axis(dev_res, axis_type, f_value);
           }
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 }
 
 static void
@@ -4352,7 +4352,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev, E_Device *dev)
      }
 
    g_mutex_unlock(&e_comp_wl->kbd.keys_mutex);
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
 
    if ((!e_client_action_get()) && (!e_comp->input_key_grabs))
      {
@@ -4374,7 +4374,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev, E_Device *dev)
                        DBG("wl_array_add: Out of memory\n");
                        g_mutex_unlock(&e_comp_wl->kbd.keys_mutex);
                        g_mutex_unlock(&e_comp_wl->kbd.focused_mutex);
-                       g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+                       g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                        return EINA_FALSE;
                     }
                   g_mutex_unlock(&e_comp_wl->kbd.keys_mutex);
@@ -4385,7 +4385,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev, E_Device *dev)
           }
      }
 
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    /* update modifier state */
    e_comp_wl_input_keyboard_state_update(keycode, EINA_TRUE);
@@ -4430,7 +4430,7 @@ e_comp_wl_key_up(Ecore_Event_Key *ev, E_Device *dev)
    g_mutex_unlock(&e_comp_wl->kbd.keys_mutex);
 
    /* If a key down event have been sent to clients, send a key up event to client for garantee key event sequence pair. (down/up) */
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
    if ((delivered_key) ||
        ((!e_client_action_get()) && (!e_comp->input_key_grabs)))
      {
@@ -4443,7 +4443,7 @@ e_comp_wl_key_up(Ecore_Event_Key *ev, E_Device *dev)
           }
         g_mutex_unlock(&e_comp_wl->kbd.focused_mutex);
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
    /* update modifier state */
    e_comp_wl_input_keyboard_state_update(keycode, EINA_FALSE);
index 038db85..085897f 100644 (file)
@@ -531,7 +531,7 @@ struct _E_Comp_Wl_Client_Data
 
    Eina_Bool wtz_surface_assigned;
    struct wl_list pointer_constraints;
-   GMutex last_device_kbd_mutex;
+   GRecMutex last_device_kbd_mutex;
    GMutex surface_mutex;
 
    struct wl_signal state_commit_signal;
index e78c4df..98b4bc7 100644 (file)
@@ -452,7 +452,7 @@ _e_compositor_cb_new_client(void *data EINA_UNUSED, E_Client *ec)
 
    e_pixmap_cdata_set(ec->pixmap, &surface->base);
 
-   g_mutex_init(&ec->comp_data->last_device_kbd_mutex);
+   g_rec_mutex_init(&ec->comp_data->last_device_kbd_mutex);
    g_mutex_init(&ec->comp_data->surface_mutex);
 
 end:
@@ -1009,7 +1009,7 @@ _e_surface_cb_client_del(void *data, E_Client *ec)
 
    TRACE_DS_BEGIN(COMP_WL:CLIENT DEL CB);
 
-   g_mutex_clear(&ec->comp_data->last_device_kbd_mutex);
+   g_rec_mutex_clear(&ec->comp_data->last_device_kbd_mutex);
 
    e_comp_wl_hook_call(E_COMP_WL_HOOK_DEL, ec);
 
index d4148c4..fecc88c 100644 (file)
@@ -130,8 +130,8 @@ e_devicemgr_init(void)
    e_devicemgr_conf_init(dconfig);
    e_devicemgr->dconfig = dconfig;
 
-   g_mutex_init(&e_devicemgr->device_list_mutex);
-   g_mutex_init(&e_devicemgr->last_device_kbd_mutex);
+   g_rec_mutex_init(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_init(&e_devicemgr->last_device_kbd_mutex);
 
    res = e_devicemgr_wl_init();
    EINA_SAFETY_ON_FALSE_GOTO(res, wl_failed);
@@ -169,8 +169,8 @@ failed:
 EINTERN int
 e_devicemgr_shutdown(void)
 {
-   g_mutex_clear(&e_devicemgr->device_list_mutex);
-   g_mutex_clear(&e_devicemgr->last_device_kbd_mutex);
+   g_rec_mutex_clear(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_clear(&e_devicemgr->last_device_kbd_mutex);
 
    eina_log_domain_unregister(_devicemgr_log_dom);
    _devicemgr_log_dom = -1;
index 8806c01..5edbc95 100644 (file)
@@ -86,8 +86,8 @@ struct _E_Devicemgr
    Eina_List *watched_clients;
 
    int max_touch_count;
-   GMutex device_list_mutex;
-   GMutex last_device_kbd_mutex;
+   GRecMutex device_list_mutex;
+   GRecMutex last_device_kbd_mutex;
 
    struct
    {
index 1126570..62512e9 100644 (file)
@@ -205,7 +205,7 @@ _e_devicemgr_input_device_add(const char *name, const char *identifier, const ch
    EINA_SAFETY_ON_NULL_RETURN(identifier);
    EINA_SAFETY_ON_NULL_RETURN(e_devicemgr);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
      {
         if (!dev->name) continue;
@@ -214,11 +214,11 @@ _e_devicemgr_input_device_add(const char *name, const char *identifier, const ch
             (!strcmp(dev->name, name)) &&
             (!strcmp(dev->identifier, identifier)))
           {
-             g_mutex_unlock(&e_devicemgr->device_list_mutex);
+             g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
              return;
           }
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 
    if (!(dev = E_NEW(E_Devicemgr_Input_Device, 1))) return;
    dev->name = eina_stringshare_add(name);
@@ -227,9 +227,9 @@ _e_devicemgr_input_device_add(const char *name, const char *identifier, const ch
    dev->clas = clas;
    dev->subclas = subclas;
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    e_devicemgr->device_list = eina_list_append(e_devicemgr->device_list, dev);
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 
    if (dev->clas == ECORE_DEVICE_CLASS_MOUSE)
      e_devicemgr->last_device_ptr = dev;
@@ -258,11 +258,11 @@ _e_devicemgr_input_device_add(const char *name, const char *identifier, const ch
           }
      }
 
-   g_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
+   g_rec_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
    if (!e_devicemgr->last_device_kbd && dev->clas == ECORE_DEVICE_CLASS_KEYBOARD)
      e_devicemgr->last_device_kbd = dev;
 
-   g_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
 
    e_devicemgr_inputgen_device_ready_send(dev);
    e_devicemgr_wl_device_add(dev);
@@ -279,7 +279,7 @@ _e_devicemgr_input_device_del(const char *name, const char *identifier, const ch
    EINA_SAFETY_ON_NULL_RETURN(name);
    EINA_SAFETY_ON_NULL_RETURN(identifier);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
      {
         if (!dev->name) continue;
@@ -289,7 +289,7 @@ _e_devicemgr_input_device_del(const char *name, const char *identifier, const ch
             (!strcmp(dev->identifier, identifier)))
           break;
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
    if (!dev)
      {
         return;
@@ -302,9 +302,9 @@ _e_devicemgr_input_device_del(const char *name, const char *identifier, const ch
    if (dev->identifier) eina_stringshare_del(dev->identifier);
    if (dev->seat_name) eina_stringshare_del(dev->seat_name);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    e_devicemgr->device_list = eina_list_remove(e_devicemgr->device_list, dev);
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 
    if (e_devicemgr->last_device_ptr == dev)
      e_devicemgr->last_device_ptr = NULL;
@@ -314,9 +314,9 @@ _e_devicemgr_input_device_del(const char *name, const char *identifier, const ch
 
    if (e_devicemgr->last_device_kbd == dev)
      {
-        g_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
+        g_rec_mutex_lock(&e_devicemgr->last_device_kbd_mutex);
         e_devicemgr->last_device_kbd = NULL;
-        g_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
+        g_rec_mutex_unlock(&e_devicemgr->last_device_kbd_mutex);
      }
 
    E_FREE(dev);
@@ -334,7 +334,7 @@ _e_devicemgr_input_device_update(Ecore_Device *dev)
    dev_identifier = (char *)ecore_device_identifier_get(dev);
    EINA_SAFETY_ON_NULL_RETURN(dev_identifier);
 
-   g_mutex_lock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, data)
      {
         if (data->clas == ecore_device_class_get(dev) && data->identifier)
@@ -344,12 +344,12 @@ _e_devicemgr_input_device_update(Ecore_Device *dev)
                   data->subclas = ecore_device_subclass_get(dev);
 
                   e_devicemgr_wl_device_update(data);
-                  g_mutex_unlock(&e_devicemgr->device_list_mutex);
+                  g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
                   return;
                }
           }
      }
-   g_mutex_unlock(&e_devicemgr->device_list_mutex);
+   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
 }
 
 static Eina_Bool
index 4b5e814..3c1ff17 100644 (file)
@@ -13,7 +13,7 @@ struct _E_Focus_Policy_History_Impl
    E_Zone   *zone;
    E_Client *focused_ec;
 
-   GMutex focused_ec_mutex;
+   GRecMutex focused_ec_mutex;
 
    Eina_List *focus_stack;
    Eina_List *defer_focus_stack;
@@ -579,9 +579,9 @@ _focus_policy_history_cb_client_focus_set(struct wl_listener *listener, void *da
    _focus_policy_history_focus_stack_latest_set(history_policy, ec);
 
    // assign the focused_ec
-   g_mutex_lock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&history_policy->focused_ec_mutex);
    history_policy->focused_ec = ec;
-   g_mutex_unlock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&history_policy->focused_ec_mutex);
 
    ELOGF("FOCUS_HISTORY", "focus_set | focused_ec SET", ec);
 }
@@ -639,9 +639,9 @@ _focus_policy_history_cb_client_focus_unset(struct wl_listener *listener, void *
    _e_focus_policy_history_focus_defer_unset(history_policy, ec);
 
    // assign the focused_ec
-   g_mutex_lock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&history_policy->focused_ec_mutex);
    history_policy->focused_ec = NULL;
-   g_mutex_unlock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&history_policy->focused_ec_mutex);
 
    ELOGF("FOCUS_HISTORY", "focus_set | focused_ec UNSET", ec);
 }
@@ -1087,9 +1087,9 @@ _focus_policy_history_cb_zone_client_remove(struct wl_listener *listener, void *
           {
              ELOGF("FOCUS_HISTORY", "CRITICAL. focused is deleted ec.", ec);
              ELOGF("FOCUS_HISTORY", "CLIENT FOCUS_SET", NULL);
-             g_mutex_lock(&history_policy->focused_ec_mutex);
+             g_rec_mutex_lock(&history_policy->focused_ec_mutex);
              history_policy->focused_ec = NULL;
-             g_mutex_unlock(&history_policy->focused_ec_mutex);
+             g_rec_mutex_unlock(&history_policy->focused_ec_mutex);
          }
      }
 }
@@ -1108,9 +1108,9 @@ _focus_policy_history_cb_zone_focus_clear(struct wl_listener *listener, void *da
    EINA_SAFETY_ON_NULL_RETURN(zone);
 
    // make focused_ec be NULL
-   g_mutex_lock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&history_policy->focused_ec_mutex);
    history_policy->focused_ec = NULL;
-   g_mutex_unlock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&history_policy->focused_ec_mutex);
 
    ELOGF("FOCUS_HISTORY", "focus_clear | focused_ec UNSET", NULL);
 }
@@ -1139,13 +1139,13 @@ _focus_policy_history_cb_zone_focus_reset(struct wl_listener *listener, void *da
         if (!desk) continue;
         if (desk->visible && (!ec->iconic))
           {
-             g_mutex_lock(&e_comp->input_key_grabs_mutex);
+             g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
              if (e_comp->input_key_grabs || e_comp->input_mouse_grabs)
                {
-                  g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+                  g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
                   break;
                }
-             g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+             g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
 
              ELOGF("FOCUS_HISTORY", "focus set   | refocus", ec);
              e_client_frame_focus_set(ec, EINA_TRUE);
@@ -1173,7 +1173,7 @@ _focus_policy_history_del(E_Focus_Policy_Impl *impl)
    wl_list_remove(&history_policy->zone_client_remove.link);
    wl_list_remove(&history_policy->zone_client_add.link);
 
-   g_mutex_clear(&history_policy->focused_ec_mutex);
+   g_rec_mutex_clear(&history_policy->focused_ec_mutex);
 
    E_FREE(history_policy);
 }
@@ -1189,9 +1189,9 @@ _focus_policy_history_focused_ec_get(E_Focus_Policy_Impl *impl)
 
    //E_FOCUS_HISTORY_TRACE(history_policy, NULL);
 
-   g_mutex_lock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&history_policy->focused_ec_mutex);
    focused_ec = history_policy->focused_ec;
-   g_mutex_unlock(&history_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&history_policy->focused_ec_mutex);
 
    return focused_ec;
 }
@@ -1280,7 +1280,7 @@ e_focus_policy_iface_history_new(E_Zone* zone)
    EINA_SAFETY_ON_NULL_GOTO(history_policy, fail);
 
    history_policy->zone = zone;
-   g_mutex_init(&history_policy->focused_ec_mutex);
+   g_rec_mutex_init(&history_policy->focused_ec_mutex);
 
    E_FOCUS_HISTORY_TRACE(history_policy, NULL);
 
index 75edc33..4c12a0e 100644 (file)
@@ -12,7 +12,7 @@ struct _E_Focus_Policy_Topmost_Impl
    E_Zone   *zone;
    E_Client *focused_ec;
 
-   GMutex focused_ec_mutex;
+   GRecMutex focused_ec_mutex;
 
    struct wl_listener zone_client_add;
    struct wl_listener zone_client_remove;
@@ -316,9 +316,9 @@ _focus_policy_topmost_cb_client_focus_set(struct wl_listener *listener, void *da
      }
 
    // assign the focused_ec
-   g_mutex_lock(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&topmost_policy->focused_ec_mutex);
    topmost_policy->focused_ec = ec;
-   g_mutex_unlock(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&topmost_policy->focused_ec_mutex);
 
    ELOGF("FOCUS_TOPMOST", "focus_set | focused_ec SET", ec);
 }
@@ -374,9 +374,9 @@ _focus_policy_topmost_cb_client_focus_unset(struct wl_listener *listener, void *
       }
 
    // assign the focused_ec
-   g_mutex_lock(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&topmost_policy->focused_ec_mutex);
    topmost_policy->focused_ec = NULL;
-   g_mutex_unlock(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&topmost_policy->focused_ec_mutex);
 
    ELOGF("FOCUS_TOPMOST", "focus_unset | focused_ec UNSET", NULL);
 }
@@ -531,9 +531,9 @@ _focus_policy_topmost_cb_zone_client_remove(struct wl_listener *listener, void *
           {
              ELOGF("FOCUS_TOPMOST", "CRITICAL. focused is deleted ec.", ec);
              ELOGF("FOCUS_TOPMOST", "CLIENT FOCUS_SET", NULL);
-             g_mutex_lock(&topmost_policy->focused_ec_mutex);
+             g_rec_mutex_lock(&topmost_policy->focused_ec_mutex);
              topmost_policy->focused_ec = NULL;
-             g_mutex_unlock(&topmost_policy->focused_ec_mutex);
+             g_rec_mutex_unlock(&topmost_policy->focused_ec_mutex);
           }
      }
 }
@@ -550,9 +550,9 @@ _focus_policy_topmost_cb_zone_focus_clear(struct wl_listener *listener, void *da
    if (topmost_policy->zone != zone) return;
 
    // make focused_ec be NULL
-   g_mutex_lock(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_lock(&topmost_policy->focused_ec_mutex);
    topmost_policy->focused_ec = NULL;
-   g_mutex_unlock(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_unlock(&topmost_policy->focused_ec_mutex);
 
    ELOGF("FOCUS_TOPMOST", "focus_clear | focused_ec UNSET", NULL);
 }
@@ -568,7 +568,7 @@ _focus_policy_topmost_del(E_Focus_Policy_Impl *impl)
    wl_list_remove(&topmost_policy->zone_client_remove.link);
    wl_list_remove(&topmost_policy->zone_client_add.link);
 
-   g_mutex_clear(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_clear(&topmost_policy->focused_ec_mutex);
 
    E_FREE(topmost_policy);
 }
@@ -637,7 +637,7 @@ e_focus_policy_iface_topmost_new(E_Zone* zone)
    EINA_SAFETY_ON_NULL_GOTO(topmost_policy, fail);
 
    topmost_policy->zone = zone;
-   g_mutex_init(&topmost_policy->focused_ec_mutex);
+   g_rec_mutex_init(&topmost_policy->focused_ec_mutex);
 
    policy_iface->impl = (E_Focus_Policy_Impl *)topmost_policy;
    policy_iface->del = _focus_policy_topmost_del;
index 9eaaac6..f623a3a 100644 (file)
@@ -90,7 +90,7 @@ struct _E_Input_Device
    unsigned int blocked;
    void *blocked_client;
    unsigned int server_blocked;
-   GMutex blocked_client_mutex;
+   GRecMutex blocked_client_mutex;
 };
 
 EINTERN int e_input_init(Ecore_Evas *ee);
index 0a8a0ac..09d90fe 100644 (file)
@@ -236,7 +236,7 @@ e_input_device_open(void)
    dev->seat = eina_stringshare_add("seat0");
    dev->fd_hash = eina_hash_string_superfast_new(NULL);
 
-   g_mutex_init(&dev->blocked_client_mutex);
+   g_rec_mutex_init(&dev->blocked_client_mutex);
 
    /* try to create xkb context */
    if (!(dev->xkb_ctx = _e_input_device_cached_context_get(0)))
@@ -270,7 +270,7 @@ e_input_device_close(E_Input_Device *dev)
    /* check for valid device */
    EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
 
-   g_mutex_clear(&dev->blocked_client_mutex);
+   g_rec_mutex_clear(&dev->blocked_client_mutex);
 
    _e_input_device_remove_list(dev);
    e_input_device_destroy(dev);
@@ -1307,9 +1307,9 @@ e_input_device_block(E_Input_Device *dev, unsigned int type, void *client)
           }
 
         dev->blocked |= type;
-        g_mutex_lock(&dev->blocked_client_mutex);
+        g_rec_mutex_lock(&dev->blocked_client_mutex);
         dev->blocked_client = client;
-        g_mutex_unlock(&dev->blocked_client_mutex);
+        g_rec_mutex_unlock(&dev->blocked_client_mutex);
      }
    else if (client == E_INPUT_REQUEST_SERVER)
      {
@@ -1322,9 +1322,9 @@ e_input_device_block(E_Input_Device *dev, unsigned int type, void *client)
           {
              EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
                {
-                  g_mutex_lock(&edev->touch.blocked_mutex);
+                  g_rec_mutex_lock(&edev->touch.blocked_mutex);
                   edev->touch.blocked = EINA_TRUE;
-                  g_mutex_unlock(&edev->touch.blocked_mutex);
+                  g_rec_mutex_unlock(&edev->touch.blocked_mutex);
                }
           }
      }
@@ -1354,16 +1354,16 @@ e_input_device_unblock(E_Input_Device *dev, void *client)
           {
              EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
                {
-                  g_mutex_lock(&edev->touch.raw_pressed_mutex);
+                  g_rec_mutex_lock(&edev->touch.raw_pressed_mutex);
 
                   if (edev->touch.raw_pressed == 0x0)
                     {
-                       g_mutex_lock(&edev->touch.blocked_mutex);
+                       g_rec_mutex_lock(&edev->touch.blocked_mutex);
                        edev->touch.blocked = EINA_FALSE;
-                       g_mutex_unlock(&edev->touch.blocked_mutex);
+                       g_rec_mutex_unlock(&edev->touch.blocked_mutex);
                     }
 
-                  g_mutex_unlock(&edev->touch.raw_pressed_mutex);
+                  g_rec_mutex_unlock(&edev->touch.raw_pressed_mutex);
                }
           }
      }
@@ -1375,9 +1375,9 @@ e_input_device_unblock(E_Input_Device *dev, void *client)
    else
      {
         dev->blocked = 0x0;
-        g_mutex_lock(&dev->blocked_client_mutex);
+        g_rec_mutex_lock(&dev->blocked_client_mutex);
         dev->blocked_client = NULL;
-        g_mutex_unlock(&dev->blocked_client_mutex);
+        g_rec_mutex_unlock(&dev->blocked_client_mutex);
      }
 
    return EINA_TRUE;
index 4ffa019..0cca759 100644 (file)
@@ -629,11 +629,11 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
         if ((edev->seat->dev->blocked & E_INPUT_SEAT_KEYBOARD) ||
             (edev->seat->dev->server_blocked & E_INPUT_SEAT_KEYBOARD))
           {
-             g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
              ELOGF("Key", "Press (keycode: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
                    code, device_name, edev->seat->dev->blocked_client,
                    edev->seat->dev->server_blocked);
-             g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
              return;
           }
 
@@ -674,10 +674,10 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
           }
         if (!dup_found)
           {
-             g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
              ELOGF("Key", "Release (keycode: %d, device: %s) is blocked by %p", NULL,
                    code, device_name, edev->seat->dev->blocked_client);
-             g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
              return;
           }
      }
@@ -1176,11 +1176,11 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
         if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
             (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
           {
-             g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
              ELOGF("Mouse", "Button Press (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
                    button, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
                    edev->seat->dev->server_blocked);
-             g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
              goto end;
           }
         else
@@ -1192,11 +1192,11 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
      {
         if (!(edev->mouse.pressed_button & (1 << button)))
           {
-             g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
              ELOGF("Mouse", "Button Release (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
                    button, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
                    edev->seat->dev->server_blocked);
-             g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
              goto end;
           }
         edev->mouse.pressed_button &= ~(1 << button);
@@ -1591,7 +1591,7 @@ _device_handle_axis_v120(struct libinput_device *device, struct libinput_event_p
    if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
        (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
      {
-        g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+        g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
         if (detent_data)
           ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
                 direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
@@ -1599,7 +1599,7 @@ _device_handle_axis_v120(struct libinput_device *device, struct libinput_event_p
           ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
                 direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
 
-        g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+        g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
         goto end;
      }
 
@@ -2012,23 +2012,23 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_
    if (comp_conf && comp_conf->input_log_enable)
      ELOGF("Touch", "Down (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
 
-   g_mutex_lock(&edev->touch.raw_pressed_mutex);
+   g_rec_mutex_lock(&edev->touch.raw_pressed_mutex);
    edev->touch.raw_pressed |= (1 << edev->mt_slot);
-   g_mutex_unlock(&edev->touch.raw_pressed_mutex);
+   g_rec_mutex_unlock(&edev->touch.raw_pressed_mutex);
 
-   g_mutex_lock(&edev->touch.blocked_mutex);
+   g_rec_mutex_lock(&edev->touch.blocked_mutex);
    if (edev->touch.blocked)
      {
-        g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+        g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
         ELOGF("Touch", "Down (id: %d, x: %d, y: %d) is blocked by %p, server: 0x%x", NULL,
               edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, edev->seat->dev->blocked_client,
               edev->seat->dev->server_blocked);
-        g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
-        g_mutex_unlock(&edev->touch.blocked_mutex);
+        g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+        g_rec_mutex_unlock(&edev->touch.blocked_mutex);
         return;
      }
 
-   g_mutex_unlock(&edev->touch.blocked_mutex);
+   g_rec_mutex_unlock(&edev->touch.blocked_mutex);
 
    _device_handle_touch_motion_send(edev, event);
    _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
@@ -2086,13 +2086,13 @@ _device_handle_touch_motion(struct libinput_device *device, struct libinput_even
 
    if (!(edev->touch.pressed & (1 << edev->mt_slot)))
      {
-        g_mutex_lock(&edev->touch.blocked_mutex);
+        g_rec_mutex_lock(&edev->touch.blocked_mutex);
         if (edev->touch.blocked)
           {
-             g_mutex_unlock(&edev->touch.blocked_mutex);
+             g_rec_mutex_unlock(&edev->touch.blocked_mutex);
              return;
           }
-        g_mutex_unlock(&edev->touch.blocked_mutex);
+        g_rec_mutex_unlock(&edev->touch.blocked_mutex);
      }
 
    _device_handle_touch_motion_send(edev, event);
@@ -2138,33 +2138,33 @@ _device_handle_touch_up(struct libinput_device *device, struct libinput_event_to
    if (comp_conf && comp_conf->input_log_enable)
      ELOGF("Touch", "Up (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
 
-   g_mutex_lock(&edev->touch.raw_pressed_mutex);
+   g_rec_mutex_lock(&edev->touch.raw_pressed_mutex);
    edev->touch.raw_pressed &= ~(1 << edev->mt_slot);
-   g_mutex_unlock(&edev->touch.raw_pressed_mutex);
+   g_rec_mutex_unlock(&edev->touch.raw_pressed_mutex);
 
-   g_mutex_lock(&edev->touch.blocked_mutex);
+   g_rec_mutex_lock(&edev->touch.blocked_mutex);
    if (edev->touch.blocked)
      {
         if (!(edev->touch.pressed & (1 << edev->mt_slot)))
           {
-             g_mutex_lock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_lock(&edev->seat->dev->blocked_client_mutex);
              ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked by %p, server(0x%x)", NULL,
                    edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, edev->seat->dev->blocked_client,
                    edev->seat->dev->server_blocked);
-             g_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
+             g_rec_mutex_unlock(&edev->seat->dev->blocked_client_mutex);
 
-             g_mutex_lock(&edev->touch.raw_pressed_mutex);
+             g_rec_mutex_lock(&edev->touch.raw_pressed_mutex);
              if (edev->touch.raw_pressed == 0x0)
                {
                   edev->touch.blocked = EINA_FALSE;
                }
-             g_mutex_unlock(&edev->touch.raw_pressed_mutex);
-             g_mutex_unlock(&edev->touch.blocked_mutex);
+             g_rec_mutex_unlock(&edev->touch.raw_pressed_mutex);
+             g_rec_mutex_unlock(&edev->touch.blocked_mutex);
              return;
           }
      }
 
-   g_mutex_unlock(&edev->touch.blocked_mutex);
+   g_rec_mutex_unlock(&edev->touch.blocked_mutex);
    _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP);
 }
 
@@ -2309,8 +2309,8 @@ _e_input_evdev_device_create(E_Input_Seat *seat, struct libinput_device *device)
    edev->device = device;
    edev->path = eina_stringshare_printf("%s/%s", e_input_base_dir_get(), libinput_device_get_sysname(device));
 
-   g_mutex_init(&edev->touch.raw_pressed_mutex);
-   g_mutex_init(&edev->touch.blocked_mutex);
+   g_rec_mutex_init(&edev->touch.raw_pressed_mutex);
+   g_rec_mutex_init(&edev->touch.blocked_mutex);
 
    if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
      {
@@ -2419,8 +2419,8 @@ _e_input_evdev_device_destroy(E_Input_Evdev *edev)
         free(edev->touch.coords);
         edev->touch.coords = NULL;
      }
-   g_mutex_clear(&edev->touch.raw_pressed_mutex);
-   g_mutex_clear(&edev->touch.blocked_mutex);
+   g_rec_mutex_clear(&edev->touch.raw_pressed_mutex);
+   g_rec_mutex_clear(&edev->touch.blocked_mutex);
    eina_stringshare_del(edev->output_name);
 
    ecore_thread_main_loop_end();
index f6fb890..be413a1 100644 (file)
@@ -157,8 +157,8 @@ struct _E_Input_Evdev
         unsigned int pressed;
         unsigned int raw_pressed;
         Eina_Bool blocked;
-        GMutex raw_pressed_mutex;
-        GMutex blocked_mutex;
+        GRecMutex raw_pressed_mutex;
+        GRecMutex blocked_mutex;
      } touch;
 
    const char *output_name;
index 2897b4b..60bd722 100644 (file)
@@ -106,7 +106,7 @@ e_keyrouter_wl_key_send(Ecore_Event_Key *ev, E_Device *dev, Eina_Bool pressed, s
         return EINA_FALSE;
      }
 
-   g_mutex_lock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_lock(&e_comp->input_key_grabs_mutex);
    if ((!e_client_action_get()) && (!e_comp->input_key_grabs))
      {
         ec = e_client_focused_get();
@@ -129,7 +129,7 @@ e_keyrouter_wl_key_send(Ecore_Event_Key *ev, E_Device *dev, Eina_Bool pressed, s
              e_comp_wl_input_keyboard_state_update(keycode, pressed);
           }
      }
-   g_mutex_unlock(&e_comp->input_key_grabs_mutex);
+   g_rec_mutex_unlock(&e_comp->input_key_grabs_mutex);
    return !!ec;
 }