mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
43 stars 48 forks source link

Add suport for customizing togglekeys feedback #331

Closed cwendling closed 4 years ago

cwendling commented 4 years ago

This allows a customizable and possibly different beep sequence when a togglekey is enabled or disabled. This is very useful for the user to know for sure whether the feature got enabled or disabled.

Back in the days of buzzers, XKB was supposed to use different sounds for each of those, but this is no longer the case now in the vast majority of setups the beeps are intercepted and use a single recorded sound.

So instead provide an implementation for togglekeys on our end by listening to the XkbIndicatorStateNotify events, and provide options to control the feedback. The XKB implementation is still available, and used by default for now (see https://github.com/mate-desktop/mate-desktop/pull/451).

This depends on https://github.com/mate-desktop/mate-desktop/pull/451, but I didn't bump the mate-desktop dependency because it's already done in #330, so I'm trying to avoid merge conflicts here. But this means you still need latest mate-desktop to run this PR (not build it).

cwendling commented 4 years ago

BTW, I kept support for XKB implementation mostly to avoid controversy and because I figured they possible could be other backends at some point (Wayland?), but if nobody cares about the XKB backend we could drop it and the related setting.

sc0w commented 4 years ago

new warning in the logs:

msd-a11y-keyboard-manager.c:96:85: warning: comparison of integers of different signs: 'gint' (aka 'int') and 'TogglekeysBackend' [-Wsign-compare]
                g_settings_get_enum (manager->priv->settings, "togglekeys-backend") == backend);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~
cwendling commented 4 years ago

new warning in the logs: […]

Actually there were two related to sign conversion. Neither were problematic, so I simply added the cast to explicit it was OK conversions. So, fixed.

raveit65 commented 4 years ago

@rbuj Any concern left or can this be merged?

rbuj commented 4 years ago

I think it can be improved later.