mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
config: remove duplication in libinput-category parsing
Related-to: #1382
This commit is contained in:
parent
aff673bee4
commit
5337eda242
3 changed files with 21 additions and 8 deletions
|
|
@ -460,12 +460,19 @@ fill_libinput_category(char *nodename, char *content)
|
|||
string_truncate_at_pattern(nodename, ".device.libinput");
|
||||
|
||||
if (!strcmp(nodename, "category")) {
|
||||
if (!strcmp(content, "touch")
|
||||
|| !strcmp(content, "touchpad")
|
||||
|| !strcmp(content, "non-touch")
|
||||
|| !strcmp(content, "default")) {
|
||||
current_libinput_category->type = get_device_type(content);
|
||||
} else {
|
||||
/*
|
||||
* First we try to get a type based on a number of pre-defined
|
||||
* terms, for example: 'default', 'touch', 'touchpad' and
|
||||
* 'non-touch'
|
||||
*/
|
||||
current_libinput_category->type = get_device_type(content);
|
||||
|
||||
/*
|
||||
* If we couldn't match against any of those terms, we use the
|
||||
* provided value to define the device name that the settings
|
||||
* should be applicable to.
|
||||
*/
|
||||
if (current_libinput_category->type == LAB_LIBINPUT_DEVICE_NONE) {
|
||||
current_libinput_category->name = xstrdup(content);
|
||||
}
|
||||
} else if (!strcasecmp(nodename, "naturalScroll")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue