and fix other broken mixer behavior - like not handling its own

bindings within its own grab key down handler



SVN revision: 60403
This commit is contained in:
Carsten Haitzler 2011-06-16 17:45:38 +00:00
parent 2b7b0b6082
commit 8001665c3d
1 changed files with 41 additions and 1 deletions

View File

@ -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;
}