mirror of
https://github.com/labwc/labwc.git
synced 2026-04-13 08:21:15 -04:00
config: check for available click method and remove default
This commit is contained in:
parent
72851f27e0
commit
91f73e7f60
3 changed files with 14 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ struct libinput_category {
|
||||||
int accel_profile; /* -1 or libinput_config_accel_profile */
|
int accel_profile; /* -1 or libinput_config_accel_profile */
|
||||||
int middle_emu; /* -1 or libinput_config_middle_emulation_state */
|
int middle_emu; /* -1 or libinput_config_middle_emulation_state */
|
||||||
int dwt; /* -1 or libinput_config_dwt_state */
|
int dwt; /* -1 or libinput_config_dwt_state */
|
||||||
enum libinput_config_click_method click_method;
|
int click_method; /* -1 or libinput_config_click_method */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum lab_libinput_device_type get_device_type(const char *s);
|
enum lab_libinput_device_type get_device_type(const char *s);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ libinput_category_init(struct libinput_category *l)
|
||||||
l->accel_profile = -1;
|
l->accel_profile = -1;
|
||||||
l->middle_emu = -1;
|
l->middle_emu = -1;
|
||||||
l->dwt = -1;
|
l->dwt = -1;
|
||||||
l->click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
l->click_method = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum lab_libinput_device_type
|
enum lab_libinput_device_type
|
||||||
|
|
|
||||||
14
src/seat.c
14
src/seat.c
|
|
@ -189,11 +189,21 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
||||||
wlr_log(WLR_INFO, "dwt configured");
|
wlr_log(WLR_INFO, "dwt configured");
|
||||||
libinput_device_config_dwt_set_enabled(libinput_dev, dc->dwt);
|
libinput_device_config_dwt_set_enabled(libinput_dev, dc->dwt);
|
||||||
}
|
}
|
||||||
if (libinput_device_config_click_set_method(libinput_dev,
|
if (dc->click_method < 0
|
||||||
dc->click_method) > 0) {
|
||
|
||||||
|
(libinput_device_config_click_get_methods(libinput_dev)
|
||||||
|
& dc->click_method) == 0) {
|
||||||
wlr_log(WLR_INFO, "click method not configured");
|
wlr_log(WLR_INFO, "click method not configured");
|
||||||
} else {
|
} else {
|
||||||
wlr_log(WLR_INFO, "click method configured");
|
wlr_log(WLR_INFO, "click method configured");
|
||||||
|
|
||||||
|
// Note, the documentation claims that:
|
||||||
|
// > @note [...] The device may require changing to a neutral
|
||||||
|
// > state first before activating the new method.
|
||||||
|
//
|
||||||
|
// However, just setting the method worked without issues.
|
||||||
|
|
||||||
|
libinput_device_config_click_set_method(libinput_dev, dc->click_method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue