mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
Remove access to wlr_input_device union
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3626 Closes: https://github.com/swaywm/sway/issues/7077
This commit is contained in:
parent
49cef51e6e
commit
122d8ce954
10 changed files with 76 additions and 92 deletions
|
|
@ -979,10 +979,11 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
|
|||
input_device_get_type(device)));
|
||||
|
||||
if (device->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD) {
|
||||
struct wlr_keyboard *keyboard = device->wlr_device->keyboard;
|
||||
struct wlr_keyboard *keyboard =
|
||||
wlr_keyboard_from_input_device(device->wlr_device);
|
||||
struct xkb_keymap *keymap = keyboard->keymap;
|
||||
struct xkb_state *state = keyboard->xkb_state;
|
||||
|
||||
|
||||
json_object_object_add(object, "repeat_delay",
|
||||
json_object_new_int(keyboard->repeat_info.delay));
|
||||
json_object_object_add(object, "repeat_rate",
|
||||
|
|
@ -1012,11 +1013,11 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
|
|||
if (device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) {
|
||||
struct input_config *ic = input_device_get_config(device);
|
||||
float scroll_factor = 1.0f;
|
||||
if (ic != NULL && !isnan(ic->scroll_factor) &&
|
||||
if (ic != NULL && !isnan(ic->scroll_factor) &&
|
||||
ic->scroll_factor != FLT_MIN) {
|
||||
scroll_factor = ic->scroll_factor;
|
||||
}
|
||||
json_object_object_add(object, "scroll_factor",
|
||||
json_object_object_add(object, "scroll_factor",
|
||||
json_object_new_double(scroll_factor));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue