summaryrefslogtreecommitdiffstats
path: root/sway/input/input-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r--sway/input/input-manager.c210
1 files changed, 119 insertions, 91 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index d90803f6..8d263e06 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -62,7 +62,7 @@ char *input_device_get_identifier(struct wlr_input_device *device) {
62 int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; 62 int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1;
63 char *identifier = malloc(len); 63 char *identifier = malloc(len);
64 if (!identifier) { 64 if (!identifier) {
65 wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); 65 sway_log(SWAY_ERROR, "Unable to allocate unique input device name");
66 return NULL; 66 return NULL;
67 } 67 }
68 68
@@ -98,7 +98,7 @@ static bool input_has_seat_fallback_configuration(void) {
98void input_manager_verify_fallback_seat(void) { 98void input_manager_verify_fallback_seat(void) {
99 struct sway_seat *seat = NULL; 99 struct sway_seat *seat = NULL;
100 if (!input_has_seat_fallback_configuration()) { 100 if (!input_has_seat_fallback_configuration()) {
101 wlr_log(WLR_DEBUG, "no fallback seat config - creating default"); 101 sway_log(SWAY_DEBUG, "no fallback seat config - creating default");
102 seat = input_manager_get_default_seat(); 102 seat = input_manager_get_default_seat();
103 struct seat_config *sc = new_seat_config(seat->wlr_seat->name); 103 struct seat_config *sc = new_seat_config(seat->wlr_seat->name);
104 sc->fallback = true; 104 sc->fallback = true;
@@ -107,6 +107,13 @@ void input_manager_verify_fallback_seat(void) {
107 } 107 }
108} 108}
109 109
110static void log_libinput_config_status(enum libinput_config_status status) {
111 if (status != LIBINPUT_CONFIG_STATUS_SUCCESS) {
112 sway_log(SWAY_ERROR, "Failed to apply libinput config: %s",
113 libinput_config_status_to_str(status));
114 }
115}
116
110static void input_manager_libinput_config_keyboard( 117static void input_manager_libinput_config_keyboard(
111 struct sway_input_device *input_device) { 118 struct sway_input_device *input_device) {
112 struct wlr_input_device *wlr_device = input_device->wlr_device; 119 struct wlr_input_device *wlr_device = input_device->wlr_device;
@@ -118,14 +125,14 @@ static void input_manager_libinput_config_keyboard(
118 } 125 }
119 126
120 libinput_device = wlr_libinput_get_device_handle(wlr_device); 127 libinput_device = wlr_libinput_get_device_handle(wlr_device);
121 wlr_log(WLR_DEBUG, "input_manager_libinput_config_keyboard(%s)", 128 sway_log(SWAY_DEBUG, "input_manager_libinput_config_keyboard(%s)",
122 ic->identifier); 129 ic->identifier);
123 130
124 if (ic->send_events != INT_MIN) { 131 if (ic->send_events != INT_MIN) {
125 wlr_log(WLR_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)", 132 sway_log(SWAY_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)",
126 ic->identifier, ic->send_events); 133 ic->identifier, ic->send_events);
127 libinput_device_config_send_events_set_mode(libinput_device, 134 log_libinput_config_status(libinput_device_config_send_events_set_mode(
128 ic->send_events); 135 libinput_device, ic->send_events));
129 } 136 }
130} 137}
131 138
@@ -142,9 +149,10 @@ static void input_manager_libinput_reset_keyboard(
142 149
143 uint32_t send_events = 150 uint32_t send_events =
144 libinput_device_config_send_events_get_default_mode(libinput_device); 151 libinput_device_config_send_events_get_default_mode(libinput_device);
145 wlr_log(WLR_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)", 152 sway_log(SWAY_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)",
146 input_device->identifier, send_events); 153 input_device->identifier, send_events);
147 libinput_device_config_send_events_set_mode(libinput_device, send_events); 154 log_libinput_config_status(libinput_device_config_send_events_set_mode(
155 libinput_device, send_events));
148} 156}
149 157
150static void input_manager_libinput_config_touch( 158static void input_manager_libinput_config_touch(
@@ -158,14 +166,14 @@ static void input_manager_libinput_config_touch(
158 } 166 }
159 167
160 libinput_device = wlr_libinput_get_device_handle(wlr_device); 168 libinput_device = wlr_libinput_get_device_handle(wlr_device);
161 wlr_log(WLR_DEBUG, "input_manager_libinput_config_touch(%s)", 169 sway_log(SWAY_DEBUG, "input_manager_libinput_config_touch(%s)",
162 ic->identifier); 170 ic->identifier);
163 171
164 if (ic->send_events != INT_MIN) { 172 if (ic->send_events != INT_MIN) {
165 wlr_log(WLR_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)", 173 sway_log(SWAY_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)",
166 ic->identifier, ic->send_events); 174 ic->identifier, ic->send_events);
167 libinput_device_config_send_events_set_mode(libinput_device, 175 log_libinput_config_status(libinput_device_config_send_events_set_mode(
168 ic->send_events); 176 libinput_device, ic->send_events));
169 } 177 }
170} 178}
171 179
@@ -182,9 +190,10 @@ static void input_manager_libinput_reset_touch(
182 190
183 uint32_t send_events = 191 uint32_t send_events =
184 libinput_device_config_send_events_get_default_mode(libinput_device); 192 libinput_device_config_send_events_get_default_mode(libinput_device);
185 wlr_log(WLR_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)", 193 sway_log(SWAY_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)",
186 input_device->identifier, send_events); 194 input_device->identifier, send_events);
187 libinput_device_config_send_events_set_mode(libinput_device, send_events); 195 log_libinput_config_status(libinput_device_config_send_events_set_mode(
196 libinput_device, send_events));
188} 197}
189 198
190static void input_manager_libinput_config_pointer( 199static void input_manager_libinput_config_pointer(
@@ -198,95 +207,100 @@ static void input_manager_libinput_config_pointer(
198 } 207 }
199 208
200 libinput_device = wlr_libinput_get_device_handle(wlr_device); 209 libinput_device = wlr_libinput_get_device_handle(wlr_device);
201 wlr_log(WLR_DEBUG, "input_manager_libinput_config_pointer(%s)", 210 sway_log(SWAY_DEBUG, "input_manager_libinput_config_pointer(%s)",
202 ic->identifier); 211 ic->identifier);
203 212
204 if (ic->accel_profile != INT_MIN) { 213 if (ic->accel_profile != INT_MIN) {
205 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", 214 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)",
206 ic->identifier, ic->accel_profile); 215 ic->identifier, ic->accel_profile);
207 libinput_device_config_accel_set_profile(libinput_device, 216 log_libinput_config_status(libinput_device_config_accel_set_profile(
208 ic->accel_profile); 217 libinput_device, ic->accel_profile));
209 } 218 }
210 if (ic->click_method != INT_MIN) { 219 if (ic->click_method != INT_MIN) {
211 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", 220 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)",
212 ic->identifier, ic->click_method); 221 ic->identifier, ic->click_method);
213 libinput_device_config_click_set_method(libinput_device, 222 log_libinput_config_status(libinput_device_config_click_set_method(
214 ic->click_method); 223 libinput_device, ic->click_method));
215 } 224 }
216 if (ic->drag != INT_MIN) { 225 if (ic->drag != INT_MIN) {
217 wlr_log(WLR_DEBUG, 226 sway_log(SWAY_DEBUG,
218 "libinput_config_pointer(%s) tap_set_drag_enabled(%d)", 227 "libinput_config_pointer(%s) tap_set_drag_enabled(%d)",
219 ic->identifier, ic->drag); 228 ic->identifier, ic->drag);
220 libinput_device_config_tap_set_drag_enabled(libinput_device, 229 log_libinput_config_status(libinput_device_config_tap_set_drag_enabled(
221 ic->drag); 230 libinput_device, ic->drag));
222 } 231 }
223 if (ic->drag_lock != INT_MIN) { 232 if (ic->drag_lock != INT_MIN) {
224 wlr_log(WLR_DEBUG, 233 sway_log(SWAY_DEBUG,
225 "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", 234 "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)",
226 ic->identifier, ic->drag_lock); 235 ic->identifier, ic->drag_lock);
227 libinput_device_config_tap_set_drag_lock_enabled(libinput_device, 236 log_libinput_config_status(
228 ic->drag_lock); 237 libinput_device_config_tap_set_drag_lock_enabled(
238 libinput_device, ic->drag_lock));
229 } 239 }
230 if (ic->dwt != INT_MIN) { 240 if (ic->dwt != INT_MIN) {
231 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", 241 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)",
232 ic->identifier, ic->dwt); 242 ic->identifier, ic->dwt);
233 libinput_device_config_dwt_set_enabled(libinput_device, ic->dwt); 243 log_libinput_config_status(libinput_device_config_dwt_set_enabled(
244 libinput_device, ic->dwt));
234 } 245 }
235 if (ic->left_handed != INT_MIN) { 246 if (ic->left_handed != INT_MIN) {
236 wlr_log(WLR_DEBUG, 247 sway_log(SWAY_DEBUG,
237 "libinput_config_pointer(%s) left_handed_set_enabled(%d)", 248 "libinput_config_pointer(%s) left_handed_set_enabled(%d)",
238 ic->identifier, ic->left_handed); 249 ic->identifier, ic->left_handed);
239 libinput_device_config_left_handed_set(libinput_device, 250 log_libinput_config_status(libinput_device_config_left_handed_set(
240 ic->left_handed); 251 libinput_device, ic->left_handed));
241 } 252 }
242 if (ic->middle_emulation != INT_MIN) { 253 if (ic->middle_emulation != INT_MIN) {
243 wlr_log(WLR_DEBUG, 254 sway_log(SWAY_DEBUG,
244 "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", 255 "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)",
245 ic->identifier, ic->middle_emulation); 256 ic->identifier, ic->middle_emulation);
246 libinput_device_config_middle_emulation_set_enabled(libinput_device, 257 log_libinput_config_status(
247 ic->middle_emulation); 258 libinput_device_config_middle_emulation_set_enabled(
259 libinput_device, ic->middle_emulation));
248 } 260 }
249 if (ic->natural_scroll != INT_MIN) { 261 if (ic->natural_scroll != INT_MIN) {
250 wlr_log(WLR_DEBUG, 262 sway_log(SWAY_DEBUG,
251 "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", 263 "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)",
252 ic->identifier, ic->natural_scroll); 264 ic->identifier, ic->natural_scroll);
253 libinput_device_config_scroll_set_natural_scroll_enabled( 265 log_libinput_config_status(
254 libinput_device, ic->natural_scroll); 266 libinput_device_config_scroll_set_natural_scroll_enabled(
267 libinput_device, ic->natural_scroll));
255 } 268 }
256 if (ic->pointer_accel != FLT_MIN) { 269 if (ic->pointer_accel != FLT_MIN) {
257 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", 270 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)",
258 ic->identifier, ic->pointer_accel); 271 ic->identifier, ic->pointer_accel);
259 libinput_device_config_accel_set_speed(libinput_device, 272 log_libinput_config_status(libinput_device_config_accel_set_speed(
260 ic->pointer_accel); 273 libinput_device, ic->pointer_accel));
261 } 274 }
262 if (ic->scroll_button != INT_MIN) { 275 if (ic->scroll_button != INT_MIN) {
263 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_button(%d)", 276 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) scroll_set_button(%d)",
264 ic->identifier, ic->scroll_button); 277 ic->identifier, ic->scroll_button);
265 libinput_device_config_scroll_set_button(libinput_device, 278 log_libinput_config_status(libinput_device_config_scroll_set_button(
266 ic->scroll_button); 279 libinput_device, ic->scroll_button));
267 } 280 }
268 if (ic->scroll_method != INT_MIN) { 281 if (ic->scroll_method != INT_MIN) {
269 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", 282 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)",
270 ic->identifier, ic->scroll_method); 283 ic->identifier, ic->scroll_method);
271 libinput_device_config_scroll_set_method(libinput_device, 284 log_libinput_config_status(libinput_device_config_scroll_set_method(
272 ic->scroll_method); 285 libinput_device, ic->scroll_method));
273 } 286 }
274 if (ic->send_events != INT_MIN) { 287 if (ic->send_events != INT_MIN) {
275 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", 288 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)",
276 ic->identifier, ic->send_events); 289 ic->identifier, ic->send_events);
277 libinput_device_config_send_events_set_mode(libinput_device, 290 log_libinput_config_status(libinput_device_config_send_events_set_mode(
278 ic->send_events); 291 libinput_device, ic->send_events));
279 } 292 }
280 if (ic->tap != INT_MIN) { 293 if (ic->tap != INT_MIN) {
281 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", 294 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)",
282 ic->identifier, ic->tap); 295 ic->identifier, ic->tap);
283 libinput_device_config_tap_set_enabled(libinput_device, ic->tap); 296 log_libinput_config_status(libinput_device_config_tap_set_enabled(
297 libinput_device, ic->tap));
284 } 298 }
285 if (ic->tap_button_map != INT_MIN) { 299 if (ic->tap_button_map != INT_MIN) {
286 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)", 300 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)",
287 ic->identifier, ic->tap_button_map); 301 ic->identifier, ic->tap_button_map);
288 libinput_device_config_tap_set_button_map(libinput_device, 302 log_libinput_config_status(libinput_device_config_tap_set_button_map(
289 ic->tap_button_map); 303 libinput_device, ic->tap_button_map));
290 } 304 }
291} 305}
292 306
@@ -303,97 +317,111 @@ static void input_manager_libinput_reset_pointer(
303 317
304 enum libinput_config_accel_profile accel_profile = 318 enum libinput_config_accel_profile accel_profile =
305 libinput_device_config_accel_get_default_profile(libinput_device); 319 libinput_device_config_accel_get_default_profile(libinput_device);
306 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)", 320 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)",
307 input_device->identifier, accel_profile); 321 input_device->identifier, accel_profile);
308 libinput_device_config_accel_set_profile(libinput_device, accel_profile); 322 log_libinput_config_status(libinput_device_config_accel_set_profile(
323 libinput_device, accel_profile));
309 324
310 enum libinput_config_click_method click_method = 325 enum libinput_config_click_method click_method =
311 libinput_device_config_click_get_default_method(libinput_device); 326 libinput_device_config_click_get_default_method(libinput_device);
312 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)", 327 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)",
313 input_device->identifier, click_method); 328 input_device->identifier, click_method);
314 libinput_device_config_click_set_method(libinput_device, click_method); 329 log_libinput_config_status(libinput_device_config_click_set_method(
330 libinput_device, click_method));
315 331
316 enum libinput_config_drag_state drag = 332 enum libinput_config_drag_state drag =
317 libinput_device_config_tap_get_default_drag_enabled(libinput_device); 333 libinput_device_config_tap_get_default_drag_enabled(libinput_device);
318 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)", 334 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)",
319 input_device->identifier, drag); 335 input_device->identifier, drag);
320 libinput_device_config_tap_set_drag_enabled(libinput_device, drag); 336 log_libinput_config_status(libinput_device_config_tap_set_drag_enabled(
337 libinput_device, drag));
321 338
322 enum libinput_config_drag_lock_state drag_lock = 339 enum libinput_config_drag_lock_state drag_lock =
323 libinput_device_config_tap_get_default_drag_lock_enabled( 340 libinput_device_config_tap_get_default_drag_lock_enabled(
324 libinput_device); 341 libinput_device);
325 wlr_log(WLR_DEBUG, 342 sway_log(SWAY_DEBUG,
326 "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)", 343 "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)",
327 input_device->identifier, drag_lock); 344 input_device->identifier, drag_lock);
328 libinput_device_config_tap_set_drag_lock_enabled(libinput_device, 345 log_libinput_config_status(
329 drag_lock); 346 libinput_device_config_tap_set_drag_lock_enabled(
347 libinput_device, drag_lock));
330 348
331 enum libinput_config_dwt_state dwt = 349 enum libinput_config_dwt_state dwt =
332 libinput_device_config_dwt_get_default_enabled(libinput_device); 350 libinput_device_config_dwt_get_default_enabled(libinput_device);
333 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)", 351 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)",
334 input_device->identifier, dwt); 352 input_device->identifier, dwt);
335 libinput_device_config_dwt_set_enabled(libinput_device, dwt); 353 log_libinput_config_status(libinput_device_config_dwt_set_enabled(
354 libinput_device, dwt));
336 355
337 int left_handed = 356 int left_handed =
338 libinput_device_config_left_handed_get_default(libinput_device); 357 libinput_device_config_left_handed_get_default(libinput_device);
339 wlr_log(WLR_DEBUG, 358 sway_log(SWAY_DEBUG,
340 "libinput_reset_pointer(%s) left_handed_set_enabled(%d)", 359 "libinput_reset_pointer(%s) left_handed_set_enabled(%d)",
341 input_device->identifier, left_handed); 360 input_device->identifier, left_handed);
342 libinput_device_config_left_handed_set(libinput_device, left_handed); 361 log_libinput_config_status(libinput_device_config_left_handed_set(
362 libinput_device, left_handed));
343 363
344 enum libinput_config_middle_emulation_state middle_emulation = 364 enum libinput_config_middle_emulation_state middle_emulation =
345 libinput_device_config_middle_emulation_get_default_enabled( 365 libinput_device_config_middle_emulation_get_default_enabled(
346 libinput_device); 366 libinput_device);
347 wlr_log(WLR_DEBUG, 367 sway_log(SWAY_DEBUG,
348 "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)", 368 "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)",
349 input_device->identifier, middle_emulation); 369 input_device->identifier, middle_emulation);
350 libinput_device_config_middle_emulation_set_enabled(libinput_device, 370 log_libinput_config_status(
351 middle_emulation); 371 libinput_device_config_middle_emulation_set_enabled(
372 libinput_device, middle_emulation));
352 373
353 int natural_scroll = 374 int natural_scroll =
354 libinput_device_config_scroll_get_default_natural_scroll_enabled( 375 libinput_device_config_scroll_get_default_natural_scroll_enabled(
355 libinput_device); 376 libinput_device);
356 wlr_log(WLR_DEBUG, 377 sway_log(SWAY_DEBUG,
357 "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)", 378 "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)",
358 input_device->identifier, natural_scroll); 379 input_device->identifier, natural_scroll);
359 libinput_device_config_scroll_set_natural_scroll_enabled( 380 log_libinput_config_status(
360 libinput_device, natural_scroll); 381 libinput_device_config_scroll_set_natural_scroll_enabled(
382 libinput_device, natural_scroll));
361 383
362 double pointer_accel = 384 double pointer_accel =
363 libinput_device_config_accel_get_default_speed(libinput_device); 385 libinput_device_config_accel_get_default_speed(libinput_device);
364 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)", 386 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)",
365 input_device->identifier, pointer_accel); 387 input_device->identifier, pointer_accel);
366 libinput_device_config_accel_set_speed(libinput_device, pointer_accel); 388 log_libinput_config_status(libinput_device_config_accel_set_speed(
389 libinput_device, pointer_accel));
367 390
368 uint32_t scroll_button = 391 uint32_t scroll_button =
369 libinput_device_config_scroll_get_default_button(libinput_device); 392 libinput_device_config_scroll_get_default_button(libinput_device);
370 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)", 393 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)",
371 input_device->identifier, scroll_button); 394 input_device->identifier, scroll_button);
372 libinput_device_config_scroll_set_button(libinput_device, scroll_button); 395 log_libinput_config_status(libinput_device_config_scroll_set_button(
396 libinput_device, scroll_button));
373 397
374 enum libinput_config_scroll_method scroll_method = 398 enum libinput_config_scroll_method scroll_method =
375 libinput_device_config_scroll_get_default_method(libinput_device); 399 libinput_device_config_scroll_get_default_method(libinput_device);
376 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)", 400 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)",
377 input_device->identifier, scroll_method); 401 input_device->identifier, scroll_method);
378 libinput_device_config_scroll_set_method(libinput_device, scroll_method); 402 log_libinput_config_status(libinput_device_config_scroll_set_method(
403 libinput_device, scroll_method));
379 404
380 uint32_t send_events = 405 uint32_t send_events =
381 libinput_device_config_send_events_get_default_mode(libinput_device); 406 libinput_device_config_send_events_get_default_mode(libinput_device);
382 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)", 407 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)",
383 input_device->identifier, send_events); 408 input_device->identifier, send_events);
384 libinput_device_config_send_events_set_mode(libinput_device, send_events); 409 log_libinput_config_status(libinput_device_config_send_events_set_mode(
410 libinput_device, send_events));
385 411
386 enum libinput_config_tap_state tap = 412 enum libinput_config_tap_state tap =
387 libinput_device_config_tap_get_default_enabled(libinput_device); 413 libinput_device_config_tap_get_default_enabled(libinput_device);
388 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)", 414 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)",
389 input_device->identifier, tap); 415 input_device->identifier, tap);
390 libinput_device_config_tap_set_enabled(libinput_device, tap); 416 log_libinput_config_status(libinput_device_config_tap_set_enabled(
417 libinput_device, tap));
391 418
392 enum libinput_config_tap_button_map tap_button_map = 419 enum libinput_config_tap_button_map tap_button_map =
393 libinput_device_config_tap_get_button_map(libinput_device); 420 libinput_device_config_tap_get_button_map(libinput_device);
394 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)", 421 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)",
395 input_device->identifier, tap_button_map); 422 input_device->identifier, tap_button_map);
396 libinput_device_config_tap_set_button_map(libinput_device, tap_button_map); 423 log_libinput_config_status(libinput_device_config_tap_set_button_map(
424 libinput_device, tap_button_map));
397} 425}
398 426
399static void handle_device_destroy(struct wl_listener *listener, void *data) { 427static void handle_device_destroy(struct wl_listener *listener, void *data) {
@@ -405,7 +433,7 @@ static void handle_device_destroy(struct wl_listener *listener, void *data) {
405 return; 433 return;
406 } 434 }
407 435
408 wlr_log(WLR_DEBUG, "removing device: '%s'", 436 sway_log(SWAY_DEBUG, "removing device: '%s'",
409 input_device->identifier); 437 input_device->identifier);
410 438
411 struct sway_seat *seat = NULL; 439 struct sway_seat *seat = NULL;
@@ -435,7 +463,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
435 input_device->identifier = input_device_get_identifier(device); 463 input_device->identifier = input_device_get_identifier(device);
436 wl_list_insert(&input->devices, &input_device->link); 464 wl_list_insert(&input->devices, &input_device->link);
437 465
438 wlr_log(WLR_DEBUG, "adding device: '%s'", 466 sway_log(SWAY_DEBUG, "adding device: '%s'",
439 input_device->identifier); 467 input_device->identifier);
440 468
441 if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER || 469 if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
@@ -477,7 +505,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
477 } 505 }
478 506
479 if (!added) { 507 if (!added) {
480 wlr_log(WLR_DEBUG, 508 sway_log(SWAY_DEBUG,
481 "device '%s' is not configured on any seats", 509 "device '%s' is not configured on any seats",
482 input_device->identifier); 510 input_device->identifier);
483 } 511 }
@@ -527,7 +555,7 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) {
527 input_device->identifier = input_device_get_identifier(device); 555 input_device->identifier = input_device_get_identifier(device);
528 wl_list_insert(&input_manager->devices, &input_device->link); 556 wl_list_insert(&input_manager->devices, &input_device->link);
529 557
530 wlr_log(WLR_DEBUG, "adding virtual keyboard: '%s'", 558 sway_log(SWAY_DEBUG, "adding virtual keyboard: '%s'",
531 input_device->identifier); 559 input_device->identifier);
532 560
533 wl_signal_add(&device->events.destroy, &input_device->device_destroy); 561 wl_signal_add(&device->events.destroy, &input_device->device_destroy);
@@ -633,7 +661,7 @@ void input_manager_reset_all_inputs() {
633 661
634 662
635void input_manager_apply_seat_config(struct seat_config *seat_config) { 663void input_manager_apply_seat_config(struct seat_config *seat_config) {
636 wlr_log(WLR_DEBUG, "applying seat config for seat %s", seat_config->name); 664 sway_log(SWAY_DEBUG, "applying seat config for seat %s", seat_config->name);
637 if (strcmp(seat_config->name, "*") == 0) { 665 if (strcmp(seat_config->name, "*") == 0) {
638 struct sway_seat *seat = NULL; 666 struct sway_seat *seat = NULL;
639 wl_list_for_each(seat, &server.input->seats, link) { 667 wl_list_for_each(seat, &server.input->seats, link) {