#include <glib.h>
+static GMutex event_handler_mutex;
+
static int _e_keyrouter_intercept_hooks_delete = 0;
static int _e_keyrouter_intercept_hooks_walking = 0;
input_event_source = e_input_event_source_get();
if (input_event_source)
{
- g_mutex_lock(&krt->event_handler_mutex);
+ g_mutex_lock(&event_handler_mutex);
if (!krt->_key_down_handler)
krt->_key_down_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_DOWN, _e_keyrouter_cb_key_down, NULL);
if (!krt->_key_up_handler)
krt->_key_up_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_UP, _e_keyrouter_cb_key_up, NULL);
- g_mutex_unlock(&krt->event_handler_mutex);
+ g_mutex_unlock(&event_handler_mutex);
}
}
input_event_source = e_input_event_source_get();
if (input_event_source)
{
- g_mutex_clear(&krt->event_handler_mutex);
+ g_mutex_clear(&event_handler_mutex);
if (krt->_key_down_handler)
e_input_event_handler_del(input_event_source, krt->_key_down_handler);
return;
}
- g_mutex_lock(&krt->event_handler_mutex);
+ g_mutex_lock(&event_handler_mutex);
if (!krt->_key_down_handler)
krt->_key_down_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_DOWN, _e_keyrouter_cb_key_down, NULL);
if (!krt->_key_up_handler)
krt->_key_up_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_UP, _e_keyrouter_cb_key_up, NULL);
- g_mutex_unlock(&krt->event_handler_mutex);
+ g_mutex_unlock(&event_handler_mutex);
+}
+
+EINTERN void
+e_keyrouter_mutex_init(void)
+{
+ if (e_input_thread_mode_get())
+ g_mutex_init(&event_handler_mutex);
}
EINTERN int
krt = E_NEW(E_Keyrouter, 1);
EINA_SAFETY_ON_NULL_GOTO(krt, err);
- if (e_input_thread_mode_get())
- g_mutex_init(&krt->event_handler_mutex);
-
g_rec_mutex_init(&krt->grab_key_mutex);
kconfig = E_NEW(E_Keyrouter_Config_Data, 1);
E_Input_Event_Handler *_key_down_handler;
E_Input_Event_Handler *_key_up_handler;
- GMutex event_handler_mutex;
GRecMutex grab_key_mutex;
};
void e_keyrouter_keycancel_send(struct wl_client *client, struct wl_resource *surface, unsigned int key);
void e_keyrouter_wl_event_surface_send(struct wl_resource *surface, int key, int mode);
+void e_keyrouter_mutex_init(void);
\ No newline at end of file