From 8001665c3dc813bc498906b1462f77c723c0539f Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 16 Jun 2011 17:45:38 +0000 Subject: [PATCH] and fix other broken mixer behavior - like not handling its own bindings within its own grab key down handler SVN revision: 60403 --- src/modules/mixer/e_mod_main.c | 42 +++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c index c90a8441d..419e0e17a 100644 --- a/src/modules/mixer/e_mod_main.c +++ b/src/modules/mixer/e_mod_main.c @@ -432,7 +432,47 @@ _mixer_popup_input_window_key_down_cb(void *data, int type __UNUSED__, void *eve (strcmp(keysym, "KP_Enter") == 0)) _mixer_toggle_mute(inst); else - _mixer_popup_del(inst); /* XXX really? */ + { + E_Action *act; + Eina_List *l; + E_Config_Binding_Key *bind; + E_Binding_Modifier mod; + Eina_Bool handled = EINA_FALSE; + + for (l = e_config->key_bindings; l; l = l->next) + { + bind = l->data; + + if (bind->action && + (strcmp(bind->action, "volume_increase") && + strcmp(bind->action, "volume_decrease") && + strcmp(bind->action, "volume_mute"))) + continue; + + mod = 0; + + if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) + mod |= E_BINDING_MODIFIER_SHIFT; + if (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) + mod |= E_BINDING_MODIFIER_CTRL; + if (ev->modifiers & ECORE_EVENT_MODIFIER_ALT) + mod |= E_BINDING_MODIFIER_ALT; + if (ev->modifiers & ECORE_EVENT_MODIFIER_WIN) + mod |= E_BINDING_MODIFIER_WIN; + + if (bind->key && (!strcmp(bind->key, ev->keyname)) && + ((bind->modifiers == (int)mod) || (bind->any_mod))) + { + if (!(act = e_action_find(bind->action))) continue; + if (act->func.go_key) + act->func.go_key(E_OBJECT(inst->gcc->gadcon->zone), bind->params, ev); + else if (act->func.go) + act->func.go(E_OBJECT(inst->gcc->gadcon->zone), bind->params); + handled = EINA_TRUE; + } + } + if (!handled) _mixer_popup_del(inst); + } return ECORE_CALLBACK_PASS_ON; }