aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 9af7ef57..c1c8b6bf 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -1082,11 +1082,13 @@ static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) {
1082 } 1082 }
1083} 1083}
1084 1084
1085static void dispatch_cursor_axis(struct sway_cursor *cursor, 1085void dispatch_cursor_axis(struct sway_cursor *cursor,
1086 struct wlr_event_pointer_axis *event) { 1086 struct wlr_event_pointer_axis *event) {
1087 struct sway_seat *seat = cursor->seat; 1087 struct sway_seat *seat = cursor->seat;
1088 struct sway_input_device *input_device = event->device->data; 1088 struct sway_input_device *input_device =
1089 struct input_config *ic = input_device_get_config(input_device); 1089 event->device ? event->device->data : NULL;
1090 struct input_config *ic =
1091 input_device ? input_device_get_config(input_device) : NULL;
1090 1092
1091 // Determine what's under the cursor 1093 // Determine what's under the cursor
1092 struct wlr_surface *surface = NULL; 1094 struct wlr_surface *surface = NULL;
@@ -1109,7 +1111,8 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor,
1109 // Gather information needed for mouse bindings 1111 // Gather information needed for mouse bindings
1110 struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat); 1112 struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat);
1111 uint32_t modifiers = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0; 1113 uint32_t modifiers = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
1112 struct wlr_input_device *device = input_device->wlr_device; 1114 struct wlr_input_device *device =
1115 input_device ? input_device->wlr_device : NULL;
1113 char *dev_id = device ? input_device_get_identifier(device) : strdup("*"); 1116 char *dev_id = device ? input_device_get_identifier(device) : strdup("*");
1114 uint32_t button = wl_axis_to_button(event); 1117 uint32_t button = wl_axis_to_button(event);
1115 1118