mirror of
https://github.com/swaywm/sway.git
synced 2025-02-07 08:30:46 +00:00
Update ipc-json.c
This commit is contained in:
parent
5305ccab0a
commit
62266d5da7
|
@ -1129,12 +1129,16 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
|
||||||
if (device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) {
|
if (device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) {
|
||||||
struct input_config *ic = input_device_get_config(device);
|
struct input_config *ic = input_device_get_config(device);
|
||||||
float scroll_factor = 1.0f;
|
float scroll_factor = 1.0f;
|
||||||
if (ic != NULL && !isnan(ic->scroll_factor) &&
|
float sensitivity = 1.0f;
|
||||||
ic->scroll_factor != FLT_MIN) {
|
if (ic != NULL) {
|
||||||
scroll_factor = ic->scroll_factor;
|
if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) {
|
||||||
|
scroll_factor = ic->scroll_factor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isnan(ic->sensitivity) && ic->sensitivity != FLT_MIN) {
|
||||||
|
sensitivity = ic->sensitivity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
json_object_object_add(object, "scroll_factor",
|
|
||||||
json_object_new_double(scroll_factor));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WLR_HAS_LIBINPUT_BACKEND
|
#if WLR_HAS_LIBINPUT_BACKEND
|
||||||
|
|
Loading…
Reference in a new issue