labwc/include/config/libinput.h
John Lindgren 41a4176b17 rcxml: Make sure a default libinput category always exists
Previously, if rc.xml defined only non-default libinput categories,
no default category was created. This meant that configure_libinput()
might totally skip configuring some devices even with default
settings, like tap-to-click.

Fix this by making sure that a default category is always created.
2022-12-22 22:18:27 +00:00

33 lines
838 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LABWC_LIBINPUT_H
#define __LABWC_LIBINPUT_H
#include <libinput.h>
#include <string.h>
#include <wayland-server-core.h>
enum device_type {
DEFAULT_DEVICE,
TOUCH_DEVICE,
NON_TOUCH_DEVICE,
};
struct libinput_category {
enum device_type type;
char *name;
struct wl_list link;
float pointer_speed;
int natural_scroll;
int left_handed;
enum libinput_config_tap_state tap;
enum libinput_config_tap_button_map tap_button_map;
enum libinput_config_accel_profile accel_profile;
enum libinput_config_middle_emulation_state middle_emu;
enum libinput_config_dwt_state dwt;
};
enum device_type get_device_type(const char *s);
struct libinput_category *libinput_category_create(void);
struct libinput_category *libinput_category_get_default(void);
#endif /* __LABWC_LIBINPUT_H */