summaryrefslogtreecommitdiff
path: root/src/modules/conf_keybindings
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-06-08 11:00:20 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-06-08 11:00:20 +0000
commit69dc5013aab6cf3bfcb848a369e3f0863bdf2ea8 (patch)
tree2b4ca703f0b0ad72e8cb37b74d2c1c5d80b08722 /src/modules/conf_keybindings
parent98b7a46e8b8b025e12d45d7fa9dd72a1a59977fb (diff)
prevent users from setting mouse wheel bindings that conflict with internal edje bindings: this prevents the case where a user can set a bind for the mouse wheel to eg. cause shade left to toggle when activated on a window, and then be unable to unshade it because it keeps trying to shade vertically
SVN revision: 71844
Diffstat (limited to 'src/modules/conf_keybindings')
-rw-r--r--src/modules/conf_keybindings/e_int_config_mousebindings.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/modules/conf_keybindings/e_int_config_mousebindings.c b/src/modules/conf_keybindings/e_int_config_mousebindings.c
index c267a26c2..02d2f99ed 100644
--- a/src/modules/conf_keybindings/e_int_config_mousebindings.c
+++ b/src/modules/conf_keybindings/e_int_config_mousebindings.c
@@ -204,7 +204,7 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
204static int 204static int
205_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) 205_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
206{ 206{
207 Eina_List *l; 207 Eina_List *l, *l2;
208 E_Config_Binding_Mouse *eb, *eb2; 208 E_Config_Binding_Mouse *eb, *eb2;
209 E_Config_Binding_Wheel *bw, *bw2; 209 E_Config_Binding_Wheel *bw, *bw2;
210 210
@@ -244,8 +244,21 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
244 E_FREE(bw); 244 E_FREE(bw);
245 } 245 }
246 246
247 EINA_LIST_FOREACH(cfdata->binding.wheel, l, bw) 247 EINA_LIST_FOREACH_SAFE(cfdata->binding.wheel, l, l2, bw)
248 { 248 {
249 if ((!bw->modifiers) && ((bw->context == E_BINDING_CONTEXT_WINDOW) || (bw->context == E_BINDING_CONTEXT_ANY)))
250 {
251 const char *msg = _("Unable to set a mouse wheel binding without modifiers<br>"
252 "on a window: conflict with existing edje signal bindings.<br>"
253 "FIXME!!!");
254 e_util_dialog_internal(_("Mouse Binding Error"), msg);
255 cfdata->binding.wheel = eina_list_remove_list(cfdata->binding.wheel, l);
256 eina_stringshare_del(bw->action);
257 eina_stringshare_del(bw->params);
258 E_FREE(bw);
259 _update_mouse_binding_list(cfdata);
260 continue;
261 }
249 bw2 = E_NEW(E_Config_Binding_Wheel, 1); 262 bw2 = E_NEW(E_Config_Binding_Wheel, 1);
250 bw2->context = bw->context; 263 bw2->context = bw->context;
251 bw2->direction = bw->direction; 264 bw2->direction = bw->direction;