aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-10 18:48:20 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-10 18:48:20 +0900
commit9da3c339ba86cf80d3c19507945a019a6c6a99ca (patch)
tree930014377a14feb9b9d058b2a0e37e4d6017e46f /src
parentbacklight - companion backlight fix patch actually changes config level (diff)
downloadenlightenment-9da3c339ba86cf80d3c19507945a019a6c6a99ca.tar.gz
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 https://phab.enlightenment.org/T620 - or should.
Diffstat (limited to 'src')
-rw-r--r--src/modules/mixer/e_mod_main.c10
-rw-r--r--src/modules/mixer/e_mod_main.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c
index 4f1cd05f6..48699585f 100644
--- a/src/modules/mixer/e_mod_main.c
+++ b/src/modules/mixer/e_mod_main.c
@@ -1098,6 +1098,11 @@ _mixer_cb_volume_modify(Eina_Bool up)
if (!ctxt->default_instance)
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)
_mixer_popup_timer_new(ctxt->default_instance);
_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)
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)
_mixer_popup_timer_new(ctxt->default_instance);
_mixer_toggle_mute(ctxt->default_instance, EINA_TRUE);
diff --git a/src/modules/mixer/e_mod_main.h b/src/modules/mixer/e_mod_main.h
index 659468072..d92633caa 100644
--- a/src/modules/mixer/e_mod_main.h
+++ b/src/modules/mixer/e_mod_main.h
@@ -69,6 +69,7 @@ typedef struct E_Mixer_Module_Context
E_Mixer_Instance *default_instance;
Eina_List *instances;
E_Dialog *mixer_dialog;
+ double last_act_time;
struct st_mixer_actions
{
E_Action *incr;