Should both calls to e_bindings_mapping_change_enable() be with argument FALSE?
S. On 08/06/2012 12:21 PM, Enlightenment SVN wrote: > Log: > 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 > > > Author: discomfitor > Date: 2012-08-06 03:21:41 -0700 (Mon, 06 Aug 2012) > New Revision: 74919 > Trac: http://trac.enlightenment.org/e/changeset/74919 > > Modified: > trunk/e/src/bin/e_bindings.c trunk/e/src/bin/e_bindings.h > trunk/e/src/bin/e_border.c > > Modified: trunk/e/src/bin/e_bindings.c > =================================================================== > --- trunk/e/src/bin/e_bindings.c 2012-08-06 09:48:34 UTC (rev 74918) > +++ trunk/e/src/bin/e_bindings.c 2012-08-06 10:21:41 UTC (rev 74919) > @@ -24,6 +24,7 @@ > 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 @@ > 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(); > > Modified: trunk/e/src/bin/e_bindings.h > =================================================================== > --- trunk/e/src/bin/e_bindings.h 2012-08-06 09:48:34 UTC (rev 74918) > +++ trunk/e/src/bin/e_bindings.h 2012-08-06 10:21:41 UTC (rev 74919) > @@ -149,6 +149,7 @@ > 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 > > Modified: trunk/e/src/bin/e_border.c > =================================================================== > --- trunk/e/src/bin/e_border.c 2012-08-06 09:48:34 UTC (rev 74918) > +++ trunk/e/src/bin/e_border.c 2012-08-06 10:21:41 UTC (rev 74919) > @@ -4574,7 +4574,11 @@ > 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 @@ > 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); > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
