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>
dev
Eric Toombs 6 years ago committed by Pekka Paalanen
parent b6dae6caa3
commit 9d2220380a
  1. 24
      compositor/main.c
  2. 2
      man/weston.ini.man
  3. 2
      weston.ini.in

@ -1464,21 +1464,27 @@ configure_input_device(struct weston_compositor *compositor,
{ {
struct weston_config_section *s; struct weston_config_section *s;
struct weston_config *config = wet_get_config(compositor); struct weston_config *config = wet_get_config(compositor);
int has_enable_tap = 0;
int enable_tap; int enable_tap;
int enable_tap_default;
s = weston_config_get_section(config, s = weston_config_get_section(config,
"libinput", NULL, NULL); "libinput", NULL, NULL);
if (libinput_device_config_tap_get_finger_count(device) > 0) { if (libinput_device_config_tap_get_finger_count(device) > 0) {
enable_tap_default = if (weston_config_section_get_bool(s, "enable_tap",
libinput_device_config_tap_get_default_enabled( &enable_tap, 0) == 0) {
device); weston_log("!!DEPRECATION WARNING!!: In weston.ini, "
weston_config_section_get_bool(s, "enable_tap", "enable_tap is deprecated in favour of "
&enable_tap, "enable-tap. Support for it may be removed "
enable_tap_default); "at any time!");
libinput_device_config_tap_set_enabled(device, has_enable_tap = 1;
enable_tap); }
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);
} }
} }

@ -216,7 +216,7 @@ backend.
.PP .PP
Available configuration are: Available configuration are:
.TP 7 .TP 7
.BI "enable_tap=" true .BI "enable-tap=" true
enables tap to click on touchpad devices enables tap to click on touchpad devices
.TP 7 .TP 7
.BI "touchscreen_calibrator=" true .BI "touchscreen_calibrator=" true

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

Loading…
Cancel
Save