aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /sway/desktop/layer_shell.c
parentLog libinput_config_status errors (diff)
downloadsway-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/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index ab05778d..a870bb9a 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -6,7 +6,6 @@
6#include <wlr/types/wlr_layer_shell_v1.h> 6#include <wlr/types/wlr_layer_shell_v1.h>
7#include <wlr/types/wlr_output_damage.h> 7#include <wlr/types/wlr_output_damage.h>
8#include <wlr/types/wlr_output.h> 8#include <wlr/types/wlr_output.h>
9#include <wlr/util/log.h>
10#include "sway/desktop/transaction.h" 9#include "sway/desktop/transaction.h"
11#include "sway/input/input-manager.h" 10#include "sway/input/input-manager.h"
12#include "sway/input/seat.h" 11#include "sway/input/seat.h"
@@ -175,7 +174,7 @@ void arrange_layers(struct sway_output *output) {
175 174
176 if (memcmp(&usable_area, &output->usable_area, 175 if (memcmp(&usable_area, &output->usable_area,
177 sizeof(struct wlr_box)) != 0) { 176 sizeof(struct wlr_box)) != 0) {
178 wlr_log(WLR_DEBUG, "Usable area changed, rearranging output"); 177 sway_log(SWAY_DEBUG, "Usable area changed, rearranging output");
179 memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); 178 memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box));
180 arrange_output(output); 179 arrange_output(output);
181 } 180 }
@@ -308,7 +307,7 @@ static void unmap(struct sway_layer_surface *sway_layer) {
308static void handle_destroy(struct wl_listener *listener, void *data) { 307static void handle_destroy(struct wl_listener *listener, void *data) {
309 struct sway_layer_surface *sway_layer = 308 struct sway_layer_surface *sway_layer =
310 wl_container_of(listener, sway_layer, destroy); 309 wl_container_of(listener, sway_layer, destroy);
311 wlr_log(WLR_DEBUG, "Layer surface destroyed (%s)", 310 sway_log(SWAY_DEBUG, "Layer surface destroyed (%s)",
312 sway_layer->layer_surface->namespace); 311 sway_layer->layer_surface->namespace);
313 if (sway_layer->layer_surface->mapped) { 312 if (sway_layer->layer_surface->mapped) {
314 unmap(sway_layer); 313 unmap(sway_layer);
@@ -357,7 +356,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
357 struct wlr_layer_surface_v1 *layer_surface = data; 356 struct wlr_layer_surface_v1 *layer_surface = data;
358 struct sway_server *server = 357 struct sway_server *server =
359 wl_container_of(listener, server, layer_shell_surface); 358 wl_container_of(listener, server, layer_shell_surface);
360 wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d " 359 sway_log(SWAY_DEBUG, "new layer surface: namespace %s layer %d anchor %d "
361 "size %dx%d margin %d,%d,%d,%d", 360 "size %dx%d margin %d,%d,%d,%d",
362 layer_surface->namespace, layer_surface->layer, layer_surface->layer, 361 layer_surface->namespace, layer_surface->layer, layer_surface->layer,
363 layer_surface->client_pending.desired_width, 362 layer_surface->client_pending.desired_width,
@@ -380,7 +379,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
380 } 379 }
381 if (!output) { 380 if (!output) {
382 if (!root->outputs->length) { 381 if (!root->outputs->length) {
383 wlr_log(WLR_ERROR, 382 sway_log(SWAY_ERROR,
384 "no output to auto-assign layer surface '%s' to", 383 "no output to auto-assign layer surface '%s' to",
385 layer_surface->namespace); 384 layer_surface->namespace);
386 wlr_layer_surface_v1_close(layer_surface); 385 wlr_layer_surface_v1_close(layer_surface);