mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
tablet: stop using wlr_list
This commit is contained in:
parent
e6cb11d882
commit
5888c96da8
9 changed files with 37 additions and 22 deletions
|
|
@ -85,7 +85,8 @@ struct wlr_tablet_pad *create_libinput_tablet_pad(
|
|||
libinput_device_tablet_pad_get_num_strips(libinput_dev);
|
||||
|
||||
struct udev_device *udev = libinput_device_get_udev_device(libinput_dev);
|
||||
wlr_list_push(&wlr_tablet_pad->paths, strdup(udev_device_get_syspath(udev)));
|
||||
char **dst = wl_array_add(&wlr_tablet_pad->paths, sizeof(char *));
|
||||
*dst = strdup(udev_device_get_syspath(udev));
|
||||
|
||||
int groups = libinput_device_tablet_pad_get_num_mode_groups(libinput_dev);
|
||||
for (int i = 0; i < groups; ++i) {
|
||||
|
|
|
|||
|
|
@ -84,15 +84,18 @@ struct wlr_tablet *create_libinput_tablet(
|
|||
wlr_log(WLR_ERROR, "Unable to allocate wlr_tablet_tool");
|
||||
return NULL;
|
||||
}
|
||||
struct wlr_tablet *wlr_tablet = &libinput_tablet->wlr_tablet;
|
||||
|
||||
wlr_list_init(&wlr_tablet->paths);
|
||||
struct wlr_tablet *wlr_tablet = &libinput_tablet->wlr_tablet;
|
||||
wlr_tablet_init(wlr_tablet, &tablet_impl);
|
||||
|
||||
struct udev_device *udev = libinput_device_get_udev_device(libinput_dev);
|
||||
wlr_list_push(&wlr_tablet->paths, strdup(udev_device_get_syspath(udev)));
|
||||
char **dst = wl_array_add(&wlr_tablet->paths, sizeof(char *));
|
||||
*dst = strdup(udev_device_get_syspath(udev));
|
||||
|
||||
wlr_tablet->name = strdup(libinput_device_get_name(libinput_dev));
|
||||
|
||||
wl_list_init(&libinput_tablet->tools);
|
||||
|
||||
wlr_tablet_init(wlr_tablet, &tablet_impl);
|
||||
return wlr_tablet;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,7 +336,8 @@ static void handle_tablet_pad_path(void *data,
|
|||
struct wlr_wl_input_device *dev = data;
|
||||
struct wlr_tablet_pad *tablet_pad = dev->wlr_input_device.tablet_pad;
|
||||
|
||||
wlr_list_push(&tablet_pad->paths, strdup(path));
|
||||
char **dst = wl_array_add(&tablet_pad->paths, sizeof(char *));
|
||||
*dst = strdup(path);
|
||||
}
|
||||
|
||||
static void handle_tablet_pad_buttons(void *data,
|
||||
|
|
@ -854,7 +855,8 @@ static void handle_tablet_path(void *data, struct zwp_tablet_v2 *zwp_tablet_v2,
|
|||
struct wlr_wl_input_device *dev = data;
|
||||
struct wlr_tablet *tablet = dev->wlr_input_device.tablet;
|
||||
|
||||
wlr_list_push(&tablet->paths, strdup(path));
|
||||
char **dst = wl_array_add(&tablet->paths, sizeof(char *));
|
||||
*dst = strdup(path);
|
||||
}
|
||||
|
||||
static void handle_tablet_done(void *data, struct zwp_tablet_v2 *zwp_tablet_v2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue