#include "e.h"
/* local subsystem functions */
+static Eina_Bool _e_bindings_mapping_change_event_cb(void *data, int type, void *event);
static void _e_bindings_mouse_free(E_Binding_Mouse *bind);
static void _e_bindings_key_free(E_Binding_Key *bind);
/* local subsystem globals */
+static Ecore_Event_Handler *mapping_handler = NULL;
+
static Eina_List *mouse_bindings = NULL;
static Eina_List *key_bindings = NULL;
static Eina_List *edge_bindings = NULL;
E_Config_Binding_Acpi *eba;
Eina_List *l;
+ mapping_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_WINDOW_MAPPING, _e_bindings_mapping_change_event_cb, NULL);
+
EINA_LIST_FOREACH(e_config->mouse_bindings, l, ebm)
e_bindings_mouse_add(ebm->context, ebm->button, ebm->modifiers,
ebm->any_mod, ebm->action, ebm->params);
E_FREE_LIST(signal_bindings, _e_bindings_signal_free);
E_FREE_LIST(wheel_bindings, _e_bindings_wheel_free);
E_FREE_LIST(acpi_bindings, _e_bindings_acpi_free);
-
+
+ if (mapping_handler)
+ {
+ ecore_event_handler_del(mapping_handler);
+ mapping_handler = NULL;
+ }
+
return 1;
}
}
/* local subsystem functions */
+static Eina_Bool
+_e_bindings_mapping_change_event_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
+{
+// Ecore_X_Event_Mapping_Change *ev = event;
+
+ e_managers_keys_ungrab();
+ e_border_button_bindings_ungrab_all();
+ e_border_button_bindings_grab_all();
+ e_managers_keys_grab();
+ return ECORE_CALLBACK_PASS_ON;
+}
static void
_e_bindings_mouse_free(E_Binding_Mouse *bind)