diff options
author | M Stoeckl <code@mstoeckl.com> | 2019-01-20 13:51:12 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-21 12:59:42 +0100 |
commit | 1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch) | |
tree | 5c3f60e0219cb8b4a1b7cafb760a871661866e32 /sway/input/seat.c | |
parent | Log libinput_config_status errors (diff) | |
download | sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip |
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index a66a8198..82e0e754 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -62,7 +62,7 @@ static void seat_node_destroy(struct sway_seat_node *seat_node) { | |||
62 | static void seat_send_activate(struct sway_node *node, struct sway_seat *seat) { | 62 | static void seat_send_activate(struct sway_node *node, struct sway_seat *seat) { |
63 | if (node_is_view(node)) { | 63 | if (node_is_view(node)) { |
64 | if (!seat_is_input_allowed(seat, node->sway_container->view->surface)) { | 64 | if (!seat_is_input_allowed(seat, node->sway_container->view->surface)) { |
65 | wlr_log(WLR_DEBUG, "Refusing to set focus, input is inhibited"); | 65 | sway_log(SWAY_DEBUG, "Refusing to set focus, input is inhibited"); |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | view_set_activated(node->sway_container->view, true); | 68 | view_set_activated(node->sway_container->view, true); |
@@ -208,7 +208,7 @@ static struct sway_seat_node *seat_node_from_node( | |||
208 | 208 | ||
209 | seat_node = calloc(1, sizeof(struct sway_seat_node)); | 209 | seat_node = calloc(1, sizeof(struct sway_seat_node)); |
210 | if (seat_node == NULL) { | 210 | if (seat_node == NULL) { |
211 | wlr_log(WLR_ERROR, "could not allocate seat node"); | 211 | sway_log(SWAY_ERROR, "could not allocate seat node"); |
212 | return NULL; | 212 | return NULL; |
213 | } | 213 | } |
214 | 214 | ||
@@ -289,7 +289,7 @@ static void handle_new_drag_icon(struct wl_listener *listener, void *data) { | |||
289 | 289 | ||
290 | struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon)); | 290 | struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon)); |
291 | if (icon == NULL) { | 291 | if (icon == NULL) { |
292 | wlr_log(WLR_ERROR, "Allocation failed"); | 292 | sway_log(SWAY_ERROR, "Allocation failed"); |
293 | return; | 293 | return; |
294 | } | 294 | } |
295 | icon->seat = seat; | 295 | icon->seat = seat; |
@@ -407,7 +407,7 @@ static void seat_update_capabilities(struct sway_seat *seat) { | |||
407 | 407 | ||
408 | static void seat_reset_input_config(struct sway_seat *seat, | 408 | static void seat_reset_input_config(struct sway_seat *seat, |
409 | struct sway_seat_device *sway_device) { | 409 | struct sway_seat_device *sway_device) { |
410 | wlr_log(WLR_DEBUG, "Resetting output mapping for input device %s", | 410 | sway_log(SWAY_DEBUG, "Resetting output mapping for input device %s", |
411 | sway_device->input_device->identifier); | 411 | sway_device->input_device->identifier); |
412 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 412 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |
413 | sway_device->input_device->wlr_device, NULL); | 413 | sway_device->input_device->wlr_device, NULL); |
@@ -420,7 +420,7 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
420 | struct input_config *ic = input_device_get_config( | 420 | struct input_config *ic = input_device_get_config( |
421 | sway_device->input_device); | 421 | sway_device->input_device); |
422 | if (ic != NULL) { | 422 | if (ic != NULL) { |
423 | wlr_log(WLR_DEBUG, "Applying input config to %s", | 423 | sway_log(SWAY_DEBUG, "Applying input config to %s", |
424 | sway_device->input_device->identifier); | 424 | sway_device->input_device->identifier); |
425 | 425 | ||
426 | mapped_to_output = ic->mapped_to_output; | 426 | mapped_to_output = ic->mapped_to_output; |
@@ -430,19 +430,19 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
430 | mapped_to_output = sway_device->input_device->wlr_device->output_name; | 430 | mapped_to_output = sway_device->input_device->wlr_device->output_name; |
431 | } | 431 | } |
432 | if (mapped_to_output != NULL) { | 432 | if (mapped_to_output != NULL) { |
433 | wlr_log(WLR_DEBUG, "Mapping input device %s to output %s", | 433 | sway_log(SWAY_DEBUG, "Mapping input device %s to output %s", |
434 | sway_device->input_device->identifier, mapped_to_output); | 434 | sway_device->input_device->identifier, mapped_to_output); |
435 | if (strcmp("*", mapped_to_output) == 0) { | 435 | if (strcmp("*", mapped_to_output) == 0) { |
436 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 436 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |
437 | sway_device->input_device->wlr_device, NULL); | 437 | sway_device->input_device->wlr_device, NULL); |
438 | wlr_log(WLR_DEBUG, "Reset output mapping"); | 438 | sway_log(SWAY_DEBUG, "Reset output mapping"); |
439 | return; | 439 | return; |
440 | } | 440 | } |
441 | struct sway_output *output = output_by_name_or_id(mapped_to_output); | 441 | struct sway_output *output = output_by_name_or_id(mapped_to_output); |
442 | if (output) { | 442 | if (output) { |
443 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 443 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |
444 | sway_device->input_device->wlr_device, output->wlr_output); | 444 | sway_device->input_device->wlr_device, output->wlr_output); |
445 | wlr_log(WLR_DEBUG, "Mapped to output %s", output->wlr_output->name); | 445 | sway_log(SWAY_DEBUG, "Mapped to output %s", output->wlr_output->name); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | } | 448 | } |
@@ -522,10 +522,10 @@ void seat_configure_device(struct sway_seat *seat, | |||
522 | seat_configure_tablet_tool(seat, seat_device); | 522 | seat_configure_tablet_tool(seat, seat_device); |
523 | break; | 523 | break; |
524 | case WLR_INPUT_DEVICE_TABLET_PAD: | 524 | case WLR_INPUT_DEVICE_TABLET_PAD: |
525 | wlr_log(WLR_DEBUG, "TODO: configure tablet pad"); | 525 | sway_log(SWAY_DEBUG, "TODO: configure tablet pad"); |
526 | break; | 526 | break; |
527 | case WLR_INPUT_DEVICE_SWITCH: | 527 | case WLR_INPUT_DEVICE_SWITCH: |
528 | wlr_log(WLR_DEBUG, "TODO: configure switch device"); | 528 | sway_log(SWAY_DEBUG, "TODO: configure switch device"); |
529 | break; | 529 | break; |
530 | } | 530 | } |
531 | } | 531 | } |
@@ -552,10 +552,10 @@ void seat_reset_device(struct sway_seat *seat, | |||
552 | seat_reset_input_config(seat, seat_device); | 552 | seat_reset_input_config(seat, seat_device); |
553 | break; | 553 | break; |
554 | case WLR_INPUT_DEVICE_TABLET_PAD: | 554 | case WLR_INPUT_DEVICE_TABLET_PAD: |
555 | wlr_log(WLR_DEBUG, "TODO: reset tablet pad"); | 555 | sway_log(SWAY_DEBUG, "TODO: reset tablet pad"); |
556 | break; | 556 | break; |
557 | case WLR_INPUT_DEVICE_SWITCH: | 557 | case WLR_INPUT_DEVICE_SWITCH: |
558 | wlr_log(WLR_DEBUG, "TODO: reset switch device"); | 558 | sway_log(SWAY_DEBUG, "TODO: reset switch device"); |
559 | break; | 559 | break; |
560 | } | 560 | } |
561 | } | 561 | } |
@@ -570,11 +570,11 @@ void seat_add_device(struct sway_seat *seat, | |||
570 | struct sway_seat_device *seat_device = | 570 | struct sway_seat_device *seat_device = |
571 | calloc(1, sizeof(struct sway_seat_device)); | 571 | calloc(1, sizeof(struct sway_seat_device)); |
572 | if (!seat_device) { | 572 | if (!seat_device) { |
573 | wlr_log(WLR_DEBUG, "could not allocate seat device"); | 573 | sway_log(SWAY_DEBUG, "could not allocate seat device"); |
574 | return; | 574 | return; |
575 | } | 575 | } |
576 | 576 | ||
577 | wlr_log(WLR_DEBUG, "adding device %s to seat %s", | 577 | sway_log(SWAY_DEBUG, "adding device %s to seat %s", |
578 | input_device->identifier, seat->wlr_seat->name); | 578 | input_device->identifier, seat->wlr_seat->name); |
579 | 579 | ||
580 | seat_device->sway_seat = seat; | 580 | seat_device->sway_seat = seat; |
@@ -594,7 +594,7 @@ void seat_remove_device(struct sway_seat *seat, | |||
594 | return; | 594 | return; |
595 | } | 595 | } |
596 | 596 | ||
597 | wlr_log(WLR_DEBUG, "removing device %s from seat %s", | 597 | sway_log(SWAY_DEBUG, "removing device %s from seat %s", |
598 | input_device->identifier, seat->wlr_seat->name); | 598 | input_device->identifier, seat->wlr_seat->name); |
599 | 599 | ||
600 | seat_device_destroy(seat_device); | 600 | seat_device_destroy(seat_device); |
@@ -790,7 +790,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { | |||
790 | wl_event_source_timer_update(view->urgent_timer, | 790 | wl_event_source_timer_update(view->urgent_timer, |
791 | config->urgent_timeout); | 791 | config->urgent_timeout); |
792 | } else { | 792 | } else { |
793 | wlr_log(WLR_ERROR, "Unable to create urgency timer (%s)", | 793 | sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)", |
794 | strerror(errno)); | 794 | strerror(errno)); |
795 | handle_urgent_timeout(view); | 795 | handle_urgent_timeout(view); |
796 | } | 796 | } |