add an amazing hack which, when a vmware player window is opened, disables keyboard remapping until the window is closed. this is stupid, but seems to be the only way to keep it from breaking keymaps on some setups

ticket #1057


SVN revision: 74919
This commit is contained in:
Mike Blumenkrantz 2012-08-06 10:21:41 +00:00
parent b54be9093a
commit 21df8f0a2f
3 changed files with 22 additions and 3 deletions

View File

@ -24,6 +24,7 @@ static Eina_List *edge_bindings = NULL;
static Eina_List *signal_bindings = NULL;
static Eina_List *wheel_bindings = NULL;
static Eina_List *acpi_bindings = NULL;
static int _e_bindings_mapping_change_enabled = 1;
typedef struct _E_Binding_Edge_Data E_Binding_Edge_Data;
@ -1077,12 +1078,23 @@ e_bindings_acpi_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi
return act;
}
EAPI void
e_bindings_mapping_change_enable(Eina_Bool enable)
{
if (enable)
_e_bindings_mapping_change_enabled++;
else
_e_bindings_mapping_change_enabled--;
if (_e_bindings_mapping_change_enabled < 0)
_e_bindings_mapping_change_enabled = 0;
}
/* 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;
fprintf(stderr, "MAPPING CHANGE: type: %d || keycode: %d || num: %d\n", ev->type, ev->keycode, ev->num);
if (!_e_bindings_mapping_change_enabled) return ECORE_CALLBACK_RENEW;
e_managers_keys_ungrab();
e_border_button_bindings_ungrab_all();
e_border_button_bindings_grab_all();

View File

@ -149,6 +149,7 @@ EAPI void e_bindings_acpi_add(E_Binding_Context ctxt, int type, int status, cons
EAPI void e_bindings_acpi_del(E_Binding_Context ctxt, int type, int status, const char *action, const char *params);
EAPI E_Action *e_bindings_acpi_find(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi *ev, E_Binding_Acpi **bind_ret);
EAPI E_Action *e_bindings_acpi_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi *ev);
EAPI void e_bindings_mapping_change_enable(Eina_Bool enable);
#endif
#endif

View File

@ -4574,7 +4574,11 @@ _e_border_free(E_Border *bd)
if (bd->client.icccm.name)
eina_stringshare_del(bd->client.icccm.name);
if (bd->client.icccm.class)
eina_stringshare_del(bd->client.icccm.class);
{
if (!strcmp(bd->client.icccm.class, "Vmplayer"))
e_bindings_mapping_change_enable(EINA_FALSE);
eina_stringshare_del(bd->client.icccm.class);
}
if (bd->client.icccm.title)
eina_stringshare_del(bd->client.icccm.title);
if (bd->client.icccm.icon_name)
@ -6650,11 +6654,13 @@ _e_border_eval0(E_Border *bd)
const char *pname, *pclass;
char *nname, *nclass;
ecore_x_icccm_name_class_get(bd->client.win, &nname, &nclass);
ecore_x_icccm_name_class_get(bd->client.win, &nname, &nclass);
pname = bd->client.icccm.name;
pclass = bd->client.icccm.class;
bd->client.icccm.name = eina_stringshare_add(nname);
bd->client.icccm.class = eina_stringshare_add(nclass);
if (bd->client.icccm.class && (!strcmp(bd->client.icccm.class, "Vmplayer")))
e_bindings_mapping_change_enable(EINA_FALSE);
if (nname) free(nname);
if (nclass) free(nclass);