mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
Add click method libinput option (#1416)
<libinput>
<device>
<clickMethod>none|buttonAreas|clickfinger</clickMethod>
</device>
</libinput>
This commit is contained in:
parent
17bad48d87
commit
8be9c38460
6 changed files with 53 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ libinput_category_init(struct libinput_category *l)
|
|||
l->accel_profile = -1;
|
||||
l->middle_emu = -1;
|
||||
l->dwt = -1;
|
||||
l->click_method = -1;
|
||||
}
|
||||
|
||||
enum lab_libinput_device_type
|
||||
|
|
|
|||
|
|
@ -563,6 +563,19 @@ fill_libinput_category(char *nodename, char *content)
|
|||
current_libinput_category->dwt = ret
|
||||
? LIBINPUT_CONFIG_DWT_ENABLED
|
||||
: LIBINPUT_CONFIG_DWT_DISABLED;
|
||||
} else if (!strcasecmp(nodename, "clickMethod")) {
|
||||
if (!strcasecmp(content, "none")) {
|
||||
current_libinput_category->click_method =
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_NONE;
|
||||
} else if (!strcasecmp(content, "clickfinger")) {
|
||||
current_libinput_category->click_method =
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
|
||||
} else if (!strcasecmp(content, "buttonAreas")) {
|
||||
current_libinput_category->click_method =
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "invalid clickMethod");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
18
src/seat.c
18
src/seat.c
|
|
@ -189,6 +189,24 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
|||
wlr_log(WLR_INFO, "dwt configured");
|
||||
libinput_device_config_dwt_set_enabled(libinput_dev, dc->dwt);
|
||||
}
|
||||
if ((libinput_device_config_click_get_methods(libinput_dev)
|
||||
& dc->click_method) == 0
|
||||
|| dc->click_method < 0) {
|
||||
wlr_log(WLR_INFO, "click method not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "click method configured");
|
||||
|
||||
/*
|
||||
* Note, the documentation claims that:
|
||||
* > [...] The device may require changing to a neutral state
|
||||
* > first before activating the new method.
|
||||
*
|
||||
* However, just setting the method seems to work without
|
||||
* issues.
|
||||
*/
|
||||
|
||||
libinput_device_config_click_set_method(libinput_dev, dc->click_method);
|
||||
}
|
||||
}
|
||||
|
||||
static struct wlr_output *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue