diff options
author | emersion <contact@emersion.fr> | 2018-07-09 22:54:30 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-09 22:54:30 +0100 |
commit | 63b4bf500020cf35cebfdce2d73f8e359ff495c2 (patch) | |
tree | 76624b3d4820551261e5c15f773c403c1a41264e /sway/input/input-manager.c | |
parent | Merge pull request #2223 from RyanDwyer/floating-move (diff) | |
download | sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.gz sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.zst sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.zip |
Update for swaywm/wlroots#1126
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 98f7d7cf..daaf1fb6 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -61,7 +61,7 @@ static char *get_device_identifier(struct wlr_input_device *device) { | |||
61 | int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; | 61 | int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; |
62 | char *identifier = malloc(len); | 62 | char *identifier = malloc(len); |
63 | if (!identifier) { | 63 | if (!identifier) { |
64 | wlr_log(L_ERROR, "Unable to allocate unique input device name"); | 64 | wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); |
65 | return NULL; | 65 | return NULL; |
66 | } | 66 | } |
67 | 67 | ||
@@ -104,74 +104,74 @@ static void input_manager_libinput_config_pointer( | |||
104 | } | 104 | } |
105 | 105 | ||
106 | libinput_device = wlr_libinput_get_device_handle(wlr_device); | 106 | libinput_device = wlr_libinput_get_device_handle(wlr_device); |
107 | wlr_log(L_DEBUG, "input_manager_libinput_config_pointer(%s)", | 107 | wlr_log(WLR_DEBUG, "input_manager_libinput_config_pointer(%s)", |
108 | ic->identifier); | 108 | ic->identifier); |
109 | 109 | ||
110 | if (ic->accel_profile != INT_MIN) { | 110 | if (ic->accel_profile != INT_MIN) { |
111 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", | 111 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", |
112 | ic->identifier, ic->accel_profile); | 112 | ic->identifier, ic->accel_profile); |
113 | libinput_device_config_accel_set_profile(libinput_device, | 113 | libinput_device_config_accel_set_profile(libinput_device, |
114 | ic->accel_profile); | 114 | ic->accel_profile); |
115 | } | 115 | } |
116 | if (ic->click_method != INT_MIN) { | 116 | if (ic->click_method != INT_MIN) { |
117 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", | 117 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", |
118 | ic->identifier, ic->click_method); | 118 | ic->identifier, ic->click_method); |
119 | libinput_device_config_click_set_method(libinput_device, | 119 | libinput_device_config_click_set_method(libinput_device, |
120 | ic->click_method); | 120 | ic->click_method); |
121 | } | 121 | } |
122 | if (ic->drag_lock != INT_MIN) { | 122 | if (ic->drag_lock != INT_MIN) { |
123 | wlr_log(L_DEBUG, | 123 | wlr_log(WLR_DEBUG, |
124 | "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", | 124 | "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", |
125 | ic->identifier, ic->click_method); | 125 | ic->identifier, ic->click_method); |
126 | libinput_device_config_tap_set_drag_lock_enabled(libinput_device, | 126 | libinput_device_config_tap_set_drag_lock_enabled(libinput_device, |
127 | ic->drag_lock); | 127 | ic->drag_lock); |
128 | } | 128 | } |
129 | if (ic->dwt != INT_MIN) { | 129 | if (ic->dwt != INT_MIN) { |
130 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", | 130 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", |
131 | ic->identifier, ic->dwt); | 131 | ic->identifier, ic->dwt); |
132 | libinput_device_config_dwt_set_enabled(libinput_device, ic->dwt); | 132 | libinput_device_config_dwt_set_enabled(libinput_device, ic->dwt); |
133 | } | 133 | } |
134 | if (ic->left_handed != INT_MIN) { | 134 | if (ic->left_handed != INT_MIN) { |
135 | wlr_log(L_DEBUG, | 135 | wlr_log(WLR_DEBUG, |
136 | "libinput_config_pointer(%s) left_handed_set_enabled(%d)", | 136 | "libinput_config_pointer(%s) left_handed_set_enabled(%d)", |
137 | ic->identifier, ic->left_handed); | 137 | ic->identifier, ic->left_handed); |
138 | libinput_device_config_left_handed_set(libinput_device, | 138 | libinput_device_config_left_handed_set(libinput_device, |
139 | ic->left_handed); | 139 | ic->left_handed); |
140 | } | 140 | } |
141 | if (ic->middle_emulation != INT_MIN) { | 141 | if (ic->middle_emulation != INT_MIN) { |
142 | wlr_log(L_DEBUG, | 142 | wlr_log(WLR_DEBUG, |
143 | "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", | 143 | "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", |
144 | ic->identifier, ic->middle_emulation); | 144 | ic->identifier, ic->middle_emulation); |
145 | libinput_device_config_middle_emulation_set_enabled(libinput_device, | 145 | libinput_device_config_middle_emulation_set_enabled(libinput_device, |
146 | ic->middle_emulation); | 146 | ic->middle_emulation); |
147 | } | 147 | } |
148 | if (ic->natural_scroll != INT_MIN) { | 148 | if (ic->natural_scroll != INT_MIN) { |
149 | wlr_log(L_DEBUG, | 149 | wlr_log(WLR_DEBUG, |
150 | "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", | 150 | "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", |
151 | ic->identifier, ic->natural_scroll); | 151 | ic->identifier, ic->natural_scroll); |
152 | libinput_device_config_scroll_set_natural_scroll_enabled( | 152 | libinput_device_config_scroll_set_natural_scroll_enabled( |
153 | libinput_device, ic->natural_scroll); | 153 | libinput_device, ic->natural_scroll); |
154 | } | 154 | } |
155 | if (ic->pointer_accel != FLT_MIN) { | 155 | if (ic->pointer_accel != FLT_MIN) { |
156 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", | 156 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", |
157 | ic->identifier, ic->pointer_accel); | 157 | ic->identifier, ic->pointer_accel); |
158 | libinput_device_config_accel_set_speed(libinput_device, | 158 | libinput_device_config_accel_set_speed(libinput_device, |
159 | ic->pointer_accel); | 159 | ic->pointer_accel); |
160 | } | 160 | } |
161 | if (ic->scroll_method != INT_MIN) { | 161 | if (ic->scroll_method != INT_MIN) { |
162 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", | 162 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", |
163 | ic->identifier, ic->scroll_method); | 163 | ic->identifier, ic->scroll_method); |
164 | libinput_device_config_scroll_set_method(libinput_device, | 164 | libinput_device_config_scroll_set_method(libinput_device, |
165 | ic->scroll_method); | 165 | ic->scroll_method); |
166 | } | 166 | } |
167 | if (ic->send_events != INT_MIN) { | 167 | if (ic->send_events != INT_MIN) { |
168 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", | 168 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", |
169 | ic->identifier, ic->send_events); | 169 | ic->identifier, ic->send_events); |
170 | libinput_device_config_send_events_set_mode(libinput_device, | 170 | libinput_device_config_send_events_set_mode(libinput_device, |
171 | ic->send_events); | 171 | ic->send_events); |
172 | } | 172 | } |
173 | if (ic->tap != INT_MIN) { | 173 | if (ic->tap != INT_MIN) { |
174 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", | 174 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", |
175 | ic->identifier, ic->tap); | 175 | ic->identifier, ic->tap); |
176 | libinput_device_config_tap_set_enabled(libinput_device, ic->tap); | 176 | libinput_device_config_tap_set_enabled(libinput_device, ic->tap); |
177 | } | 177 | } |
@@ -187,7 +187,7 @@ static void handle_device_destroy(struct wl_listener *listener, void *data) { | |||
187 | return; | 187 | return; |
188 | } | 188 | } |
189 | 189 | ||
190 | wlr_log(L_DEBUG, "removing device: '%s'", | 190 | wlr_log(WLR_DEBUG, "removing device: '%s'", |
191 | input_device->identifier); | 191 | input_device->identifier); |
192 | 192 | ||
193 | struct sway_seat *seat = NULL; | 193 | struct sway_seat *seat = NULL; |
@@ -217,7 +217,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
217 | input_device->identifier = get_device_identifier(device); | 217 | input_device->identifier = get_device_identifier(device); |
218 | wl_list_insert(&input->devices, &input_device->link); | 218 | wl_list_insert(&input->devices, &input_device->link); |
219 | 219 | ||
220 | wlr_log(L_DEBUG, "adding device: '%s'", | 220 | wlr_log(WLR_DEBUG, "adding device: '%s'", |
221 | input_device->identifier); | 221 | input_device->identifier); |
222 | 222 | ||
223 | if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) { | 223 | if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) { |
@@ -229,7 +229,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
229 | 229 | ||
230 | struct sway_seat *seat = NULL; | 230 | struct sway_seat *seat = NULL; |
231 | if (!input_has_seat_configuration(input)) { | 231 | if (!input_has_seat_configuration(input)) { |
232 | wlr_log(L_DEBUG, "no seat configuration, using default seat"); | 232 | wlr_log(WLR_DEBUG, "no seat configuration, using default seat"); |
233 | seat = input_manager_get_seat(input, default_seat); | 233 | seat = input_manager_get_seat(input, default_seat); |
234 | seat_add_device(seat, input_device); | 234 | seat_add_device(seat, input_device); |
235 | return; | 235 | return; |
@@ -259,7 +259,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
259 | } | 259 | } |
260 | 260 | ||
261 | if (!added) { | 261 | if (!added) { |
262 | wlr_log(L_DEBUG, | 262 | wlr_log(WLR_DEBUG, |
263 | "device '%s' is not configured on any seats", | 263 | "device '%s' is not configured on any seats", |
264 | input_device->identifier); | 264 | input_device->identifier); |
265 | } | 265 | } |
@@ -282,7 +282,7 @@ static void handle_inhibit_deactivate(struct wl_listener *listener, void *data) | |||
282 | seat_set_exclusive_client(seat, NULL); | 282 | seat_set_exclusive_client(seat, NULL); |
283 | struct sway_container *previous = seat_get_focus(seat); | 283 | struct sway_container *previous = seat_get_focus(seat); |
284 | if (previous) { | 284 | if (previous) { |
285 | wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", previous, | 285 | wlr_log(WLR_DEBUG, "Returning focus to %p %s '%s'", previous, |
286 | container_type_to_str(previous->type), previous->name); | 286 | container_type_to_str(previous->type), previous->name); |
287 | // Hack to get seat to re-focus the return value of get_focus | 287 | // Hack to get seat to re-focus the return value of get_focus |
288 | seat_set_focus(seat, previous->parent); | 288 | seat_set_focus(seat, previous->parent); |
@@ -359,7 +359,7 @@ void input_manager_apply_input_config(struct sway_input_manager *input, | |||
359 | 359 | ||
360 | void input_manager_apply_seat_config(struct sway_input_manager *input, | 360 | void input_manager_apply_seat_config(struct sway_input_manager *input, |
361 | struct seat_config *seat_config) { | 361 | struct seat_config *seat_config) { |
362 | wlr_log(L_DEBUG, "applying new seat config for seat %s", | 362 | wlr_log(WLR_DEBUG, "applying new seat config for seat %s", |
363 | seat_config->name); | 363 | seat_config->name); |
364 | struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); | 364 | struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); |
365 | if (!seat) { | 365 | if (!seat) { |