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>
This commit is contained in:
Eric Toombs 2019-01-31 18:24:04 -05:00 committed by Pekka Paalanen
parent b6dae6caa3
commit 9d2220380a
3 changed files with 17 additions and 11 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -60,7 +60,7 @@ path=@libexecdir@/weston-keyboard
#transform=flipped-90
#[libinput]
#enable_tap=true
#enable-tap=true
#[touchpad]
#constant_accel_factor = 50