diff options
author | Eric Toombs <3672-ewtoombs@users.noreply.gitlab.freedesktop.org> | 2019-01-31 18:24:04 -0500 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2019-02-06 08:23:02 +0000 |
commit | 9d2220380a3bce0cb19372c94332d8f35969f86c (patch) | |
tree | 3350087e91d7429bf56e8cea01ae60732ac0dafe | |
parent | b6dae6caa3f37b6fd37aaf8d57b79afc6392f17b (diff) | |
download | weston-9d2220380a3bce0cb19372c94332d8f35969f86c.tar.gz |
weston: deprecate enable_tap in favour of enable-tap
This is to increase consistency in config option naming in weston.ini.
(Prefer hyphens over underscores to separate words.)
If enable_tap is present in weston.ini, an obnoxious error message is
logged with weston_log(). In terms of configuration, if enable-tap is
present, enable_tap is ignored.
Signed-off-by: Eric Toombs <3672-ewtoombs@users.noreply.gitlab.freedesktop.org>
-rw-r--r-- | compositor/main.c | 24 | ||||
-rw-r--r-- | man/weston.ini.man | 2 | ||||
-rw-r--r-- | weston.ini.in | 2 |
3 files changed, 17 insertions, 11 deletions
diff --git a/compositor/main.c b/compositor/main.c index b4fdbfe9..6fdb6bae 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -1464,21 +1464,27 @@ configure_input_device(struct weston_compositor *compositor, { struct weston_config_section *s; struct weston_config *config = wet_get_config(compositor); + int has_enable_tap = 0; int enable_tap; - int enable_tap_default; s = weston_config_get_section(config, "libinput", NULL, NULL); if (libinput_device_config_tap_get_finger_count(device) > 0) { - enable_tap_default = - libinput_device_config_tap_get_default_enabled( - device); - weston_config_section_get_bool(s, "enable_tap", - &enable_tap, - enable_tap_default); - libinput_device_config_tap_set_enabled(device, - enable_tap); + if (weston_config_section_get_bool(s, "enable_tap", + &enable_tap, 0) == 0) { + weston_log("!!DEPRECATION WARNING!!: In weston.ini, " + "enable_tap is deprecated in favour of " + "enable-tap. Support for it may be removed " + "at any time!"); + has_enable_tap = 1; + } + if (weston_config_section_get_bool(s, "enable-tap", + &enable_tap, 0) == 0) + has_enable_tap = 1; + if (has_enable_tap) + libinput_device_config_tap_set_enabled(device, + enable_tap); } } diff --git a/man/weston.ini.man b/man/weston.ini.man index c81032ce..dea80ca0 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -216,7 +216,7 @@ backend. .PP Available configuration are: .TP 7 -.BI "enable_tap=" true +.BI "enable-tap=" true enables tap to click on touchpad devices .TP 7 .BI "touchscreen_calibrator=" true diff --git a/weston.ini.in b/weston.ini.in index 257c4ec4..1a9acee4 100644 --- a/weston.ini.in +++ b/weston.ini.in @@ -60,7 +60,7 @@ path=@libexecdir@/weston-keyboard #transform=flipped-90 #[libinput] -#enable_tap=true +#enable-tap=true #[touchpad] #constant_accel_factor = 50 |