forked from enlightenment/enlightenment
mixer - address duplicate bindings for the same action with timeout
use time logging to not allow actions within a small window of time from eachother. this fixes T620 - or should.
This commit is contained in:
parent
98e5035957
commit
9da3c339ba
|
@ -1098,6 +1098,11 @@ _mixer_cb_volume_modify(Eina_Bool up)
|
||||||
if (!ctxt->default_instance)
|
if (!ctxt->default_instance)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ((ecore_loop_time_get() - ctxt->last_act_time) < 0.04)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ctxt->last_act_time = ecore_loop_time_get();
|
||||||
|
|
||||||
if (ctxt->default_instance->conf->keybindings_popup)
|
if (ctxt->default_instance->conf->keybindings_popup)
|
||||||
_mixer_popup_timer_new(ctxt->default_instance);
|
_mixer_popup_timer_new(ctxt->default_instance);
|
||||||
_mixer_volume_change(ctxt->default_instance, up, EINA_TRUE);
|
_mixer_volume_change(ctxt->default_instance, up, EINA_TRUE);
|
||||||
|
@ -1130,6 +1135,11 @@ _mixer_cb_volume_mute(E_Object *obj __UNUSED__, const char *params __UNUSED__)
|
||||||
if (!ctxt->default_instance)
|
if (!ctxt->default_instance)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ((ecore_loop_time_get() - ctxt->last_act_time) < 0.1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ctxt->last_act_time = ecore_loop_time_get();
|
||||||
|
|
||||||
if (ctxt->default_instance->conf->keybindings_popup)
|
if (ctxt->default_instance->conf->keybindings_popup)
|
||||||
_mixer_popup_timer_new(ctxt->default_instance);
|
_mixer_popup_timer_new(ctxt->default_instance);
|
||||||
_mixer_toggle_mute(ctxt->default_instance, EINA_TRUE);
|
_mixer_toggle_mute(ctxt->default_instance, EINA_TRUE);
|
||||||
|
|
|
@ -69,6 +69,7 @@ typedef struct E_Mixer_Module_Context
|
||||||
E_Mixer_Instance *default_instance;
|
E_Mixer_Instance *default_instance;
|
||||||
Eina_List *instances;
|
Eina_List *instances;
|
||||||
E_Dialog *mixer_dialog;
|
E_Dialog *mixer_dialog;
|
||||||
|
double last_act_time;
|
||||||
struct st_mixer_actions
|
struct st_mixer_actions
|
||||||
{
|
{
|
||||||
E_Action *incr;
|
E_Action *incr;
|
||||||
|
|
Loading…
Reference in New Issue