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/tree/view.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/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index e65968c6..bc252521 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -328,7 +328,7 @@ void view_request_activate(struct sway_view *view) { | |||
328 | } | 328 | } |
329 | 329 | ||
330 | void view_set_csd_from_server(struct sway_view *view, bool enabled) { | 330 | void view_set_csd_from_server(struct sway_view *view, bool enabled) { |
331 | wlr_log(WLR_DEBUG, "Telling view %p to set CSD to %i", view, enabled); | 331 | sway_log(SWAY_DEBUG, "Telling view %p to set CSD to %i", view, enabled); |
332 | if (view->xdg_decoration) { | 332 | if (view->xdg_decoration) { |
333 | uint32_t mode = enabled ? | 333 | uint32_t mode = enabled ? |
334 | WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE : | 334 | WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE : |
@@ -340,7 +340,7 @@ void view_set_csd_from_server(struct sway_view *view, bool enabled) { | |||
340 | } | 340 | } |
341 | 341 | ||
342 | void view_update_csd_from_client(struct sway_view *view, bool enabled) { | 342 | void view_update_csd_from_client(struct sway_view *view, bool enabled) { |
343 | wlr_log(WLR_DEBUG, "View %p updated CSD to %i", view, enabled); | 343 | sway_log(SWAY_DEBUG, "View %p updated CSD to %i", view, enabled); |
344 | struct sway_container *con = view->container; | 344 | struct sway_container *con = view->container; |
345 | if (enabled && con && con->border != B_CSD) { | 345 | if (enabled && con && con->border != B_CSD) { |
346 | con->saved_border = con->border; | 346 | con->saved_border = con->border; |
@@ -429,12 +429,12 @@ void view_execute_criteria(struct sway_view *view) { | |||
429 | list_t *criterias = criteria_for_view(view, CT_COMMAND); | 429 | list_t *criterias = criteria_for_view(view, CT_COMMAND); |
430 | for (int i = 0; i < criterias->length; i++) { | 430 | for (int i = 0; i < criterias->length; i++) { |
431 | struct criteria *criteria = criterias->items[i]; | 431 | struct criteria *criteria = criterias->items[i]; |
432 | wlr_log(WLR_DEBUG, "Checking criteria %s", criteria->raw); | 432 | sway_log(SWAY_DEBUG, "Checking criteria %s", criteria->raw); |
433 | if (view_has_executed_criteria(view, criteria)) { | 433 | if (view_has_executed_criteria(view, criteria)) { |
434 | wlr_log(WLR_DEBUG, "Criteria already executed"); | 434 | sway_log(SWAY_DEBUG, "Criteria already executed"); |
435 | continue; | 435 | continue; |
436 | } | 436 | } |
437 | wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", | 437 | sway_log(SWAY_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", |
438 | criteria->raw, view, criteria->cmdlist); | 438 | criteria->raw, view, criteria->cmdlist); |
439 | list_add(view->executed_criteria, criteria); | 439 | list_add(view->executed_criteria, criteria); |
440 | list_t *res_list = execute_command( | 440 | list_t *res_list = execute_command( |
@@ -721,7 +721,7 @@ static void view_subsurface_create(struct sway_view *view, | |||
721 | struct sway_subsurface *subsurface = | 721 | struct sway_subsurface *subsurface = |
722 | calloc(1, sizeof(struct sway_subsurface)); | 722 | calloc(1, sizeof(struct sway_subsurface)); |
723 | if (subsurface == NULL) { | 723 | if (subsurface == NULL) { |
724 | wlr_log(WLR_ERROR, "Allocation failed"); | 724 | sway_log(SWAY_ERROR, "Allocation failed"); |
725 | return; | 725 | return; |
726 | } | 726 | } |
727 | view_child_init(&subsurface->child, &subsurface_impl, view, | 727 | view_child_init(&subsurface->child, &subsurface_impl, view, |
@@ -860,7 +860,7 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) { | |||
860 | } | 860 | } |
861 | 861 | ||
862 | const char *role = wlr_surface->role ? wlr_surface->role->name : NULL; | 862 | const char *role = wlr_surface->role ? wlr_surface->role->name : NULL; |
863 | wlr_log(WLR_DEBUG, "Surface of unknown type (role %s): %p", | 863 | sway_log(SWAY_DEBUG, "Surface of unknown type (role %s): %p", |
864 | role, wlr_surface); | 864 | role, wlr_surface); |
865 | return NULL; | 865 | return NULL; |
866 | } | 866 | } |