diff --git a/src/bin/main.c b/src/bin/main.c index be2951a5..6a4b8f38 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -21,9 +21,32 @@ int terminology_starting_up; int _log_domain = -1; +Eina_Bool multisense_available = EINA_TRUE; static Config *_main_config = NULL; +static void +_check_multisense(void) +{ + int enabled; + Eina_Bool setting = edje_audio_channel_mute_get(EDJE_CHANNEL_EFFECT); + + /* older versions of efl have no capability for determining whether multisense support + * is available + * to check, attempt to set mute on a channel and check the value: if the value has not been + * set then the multisense codepath is disabled + * + * this is a no-op in either case, as the function only sets an internal variable and returns + */ + for (enabled = 0; enabled < 2; enabled++) + { + edje_audio_channel_mute_set(EDJE_CHANNEL_EFFECT, enabled); + if (enabled != edje_audio_channel_mute_get(EDJE_CHANNEL_EFFECT)) + multisense_available = EINA_FALSE; + } + edje_audio_channel_mute_set(EDJE_CHANNEL_EFFECT, setting); +} + Config * main_config_get(void) { @@ -612,6 +635,8 @@ elm_main(int argc, char **argv) } } + _check_multisense(); + if (theme) { char path[PATH_MAX]; diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c index 86fa0481..09aedec7 100644 --- a/src/bin/options_behavior.c +++ b/src/bin/options_behavior.c @@ -17,6 +17,7 @@ typedef struct _Behavior_Ctx { Config *config; } Behavior_Ctx; +extern Eina_Bool multisense_available; #define CB(_cfg_name, _inv) \ static void \ @@ -407,6 +408,17 @@ options_behavior(Evas_Object *opbox, Evas_Object *term) _add_cursors_option(bx, ctx); CX(_("React to key presses"), flicker_on_key, 0); + if (!multisense_available) + { + Evas_Object *lbl; + + lbl = elm_label_add(bx); + evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(lbl, 0.0, 0.5); + elm_box_pack_before(bx, lbl, o); + elm_object_text_set(lbl, _("Audio Support for key presses DISABLED!")); + evas_object_show(lbl); + } CX(_("Visual Bell"), disable_visual_bell, 1); CX(_("Bell rings"), bell_rings, 0); CX(_("Urgent Bell"), urg_bell, 0);