aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-07-09 22:54:30 +0100
committerLibravatar emersion <contact@emersion.fr>2018-07-09 22:54:30 +0100
commit63b4bf500020cf35cebfdce2d73f8e359ff495c2 (patch)
tree76624b3d4820551261e5c15f773c403c1a41264e
parentMerge pull request #2223 from RyanDwyer/floating-move (diff)
downloadsway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.gz
sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.zst
sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.zip
Update for swaywm/wlroots#1126
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--HACKING.md6
-rw-r--r--common/background-image.c8
-rw-r--r--common/ipc-client.c2
-rw-r--r--common/log.c4
-rw-r--r--common/pango.c2
-rw-r--r--common/readline.c4
-rw-r--r--common/util.c2
-rw-r--r--include/log.h10
-rw-r--r--sway/commands.c14
-rw-r--r--sway/commands/assign.c2
-rw-r--r--sway/commands/bar.c6
-rw-r--r--sway/commands/bar/binding_mode_indicator.c4
-rw-r--r--sway/commands/bar/font.c2
-rw-r--r--sway/commands/bar/height.c2
-rw-r--r--sway/commands/bar/hidden_state.c2
-rw-r--r--sway/commands/bar/id.c2
-rw-r--r--sway/commands/bar/mode.c2
-rw-r--r--sway/commands/bar/modifier.c2
-rw-r--r--sway/commands/bar/output.c2
-rw-r--r--sway/commands/bar/pango_markup.c4
-rw-r--r--sway/commands/bar/position.c2
-rw-r--r--sway/commands/bar/separator_symbol.c2
-rw-r--r--sway/commands/bar/status_command.c2
-rw-r--r--sway/commands/bar/strip_workspace_numbers.c4
-rw-r--r--sway/commands/bar/swaybar_command.c2
-rw-r--r--sway/commands/bar/workspace_buttons.c4
-rw-r--r--sway/commands/bar/wrap_scroll.c4
-rw-r--r--sway/commands/bind.c4
-rw-r--r--sway/commands/exec.c2
-rw-r--r--sway/commands/exec_always.c8
-rw-r--r--sway/commands/for_window.c2
-rw-r--r--sway/commands/input.c2
-rw-r--r--sway/commands/input/events.c2
-rw-r--r--sway/commands/input/tap.c2
-rw-r--r--sway/commands/input/xkb_layout.c2
-rw-r--r--sway/commands/input/xkb_model.c2
-rw-r--r--sway/commands/input/xkb_options.c2
-rw-r--r--sway/commands/input/xkb_rules.c2
-rw-r--r--sway/commands/input/xkb_variant.c2
-rw-r--r--sway/commands/mode.c2
-rw-r--r--sway/commands/output.c6
-rw-r--r--sway/commands/output/background.c6
-rw-r--r--sway/commands/rename.c2
-rw-r--r--sway/commands/resize.c2
-rw-r--r--sway/commands/set.c2
-rw-r--r--sway/commands/swaybg_command.c2
-rw-r--r--sway/commands/workspace.c2
-rw-r--r--sway/config.c52
-rw-r--r--sway/config/bar.c14
-rw-r--r--sway/config/input.c8
-rw-r--r--sway/config/output.c26
-rw-r--r--sway/config/seat.c6
-rw-r--r--sway/criteria.c2
-rw-r--r--sway/desktop/idle_inhibit_v1.c4
-rw-r--r--sway/desktop/layer_shell.c6
-rw-r--r--sway/desktop/output.c2
-rw-r--r--sway/desktop/transaction.c14
-rw-r--r--sway/desktop/xdg_shell.c4
-rw-r--r--sway/desktop/xdg_shell_v6.c4
-rw-r--r--sway/desktop/xwayland.c10
-rw-r--r--sway/input/cursor.c2
-rw-r--r--sway/input/input-manager.c38
-rw-r--r--sway/input/keyboard.c8
-rw-r--r--sway/input/seat.c22
-rw-r--r--sway/ipc-server.c62
-rw-r--r--sway/main.c50
-rw-r--r--sway/server.c12
-rw-r--r--sway/tree/arrange.c24
-rw-r--r--sway/tree/container.c16
-rw-r--r--sway/tree/layout.c56
-rw-r--r--sway/tree/output.c6
-rw-r--r--sway/tree/view.c14
-rw-r--r--sway/tree/workspace.c14
-rw-r--r--swaybar/bar.c2
-rw-r--r--swaybar/i3bar.c4
-rw-r--r--swaybar/ipc.c4
-rw-r--r--swaybar/main.c8
-rw-r--r--swaybar/status_line.c6
-rw-r--r--swaybg/main.c6
-rw-r--r--swayidle/main.c78
-rw-r--r--swaylock/main.c20
-rw-r--r--swaylock/password.c6
-rw-r--r--swaylock/seat.c4
-rw-r--r--swaymsg/main.c2
85 files changed, 391 insertions, 385 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8a6c0208..f450563a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -107,7 +107,7 @@ int main(int argc, const char **argv) {
107 } 107 }
108 108
109 int desired_output = atoi(argv[1]); 109 int desired_output = atoi(argv[1]);
110 sway_log(L_INFO, "Using output %d of %d", desired_output, registry->outputs->length); 110 sway_log(WLR_INFO, "Using output %d of %d", desired_output, registry->outputs->length);
111 int i; 111 int i;
112 struct output_state *output = registry->outputs->items[desired_output]; 112 struct output_state *output = registry->outputs->items[desired_output];
113 struct window *window = window_setup(registry, 100, 100, false); 113 struct window *window = window_setup(registry, 100, 100, false);
diff --git a/HACKING.md b/HACKING.md
index 3600db24..8965d3ec 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -3,9 +3,9 @@
3Use `sway_log(importance, fmt, ...)` to log. The following importances are 3Use `sway_log(importance, fmt, ...)` to log. The following importances are
4available: 4available:
5 5
6* `L_DEBUG`: Debug messages, only shows with `sway -d` 6* `WLR_DEBUG`: Debug messages, only shows with `sway -d`
7* `L_INFO`: Informational messages 7* `WLR_INFO`: Informational messages
8* `L_ERROR`: Error messages 8* `WLR_ERROR`: Error messages
9 9
10`sway_log` is a macro that calls `_sway_log` with the current filename and line 10`sway_log` is a macro that calls `_sway_log` with the current filename and line
11number, which are written into the log with your message. 11number, which are written into the log with your message.
diff --git a/common/background-image.c b/common/background-image.c
index e5fb4433..f3d2551e 100644
--- a/common/background-image.c
+++ b/common/background-image.c
@@ -18,7 +18,7 @@ enum background_mode parse_background_mode(const char *mode) {
18 } else if (strcmp(mode, "solid_color") == 0) { 18 } else if (strcmp(mode, "solid_color") == 0) {
19 return BACKGROUND_MODE_SOLID_COLOR; 19 return BACKGROUND_MODE_SOLID_COLOR;
20 } 20 }
21 wlr_log(L_ERROR, "Unsupported background mode: %s", mode); 21 wlr_log(WLR_ERROR, "Unsupported background mode: %s", mode);
22 return BACKGROUND_MODE_INVALID; 22 return BACKGROUND_MODE_INVALID;
23} 23}
24 24
@@ -28,7 +28,7 @@ cairo_surface_t *load_background_image(const char *path) {
28 GError *err = NULL; 28 GError *err = NULL;
29 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, &err); 29 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, &err);
30 if (!pixbuf) { 30 if (!pixbuf) {
31 wlr_log(L_ERROR, "Failed to load background image (%s).", 31 wlr_log(WLR_ERROR, "Failed to load background image (%s).",
32 err->message); 32 err->message);
33 return false; 33 return false;
34 } 34 }
@@ -38,11 +38,11 @@ cairo_surface_t *load_background_image(const char *path) {
38 image = cairo_image_surface_create_from_png(path); 38 image = cairo_image_surface_create_from_png(path);
39#endif //HAVE_GDK_PIXBUF 39#endif //HAVE_GDK_PIXBUF
40 if (!image) { 40 if (!image) {
41 wlr_log(L_ERROR, "Failed to read background image."); 41 wlr_log(WLR_ERROR, "Failed to read background image.");
42 return NULL; 42 return NULL;
43 } 43 }
44 if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) { 44 if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) {
45 wlr_log(L_ERROR, "Failed to read background image: %s." 45 wlr_log(WLR_ERROR, "Failed to read background image: %s."
46#ifndef HAVE_GDK_PIXBUF 46#ifndef HAVE_GDK_PIXBUF
47 "\nSway was compiled without gdk_pixbuf support, so only" 47 "\nSway was compiled without gdk_pixbuf support, so only"
48 "\nPNG images can be loaded. This is the likely cause." 48 "\nPNG images can be loaded. This is the likely cause."
diff --git a/common/ipc-client.c b/common/ipc-client.c
index a88df080..4d2d88cc 100644
--- a/common/ipc-client.c
+++ b/common/ipc-client.c
@@ -97,7 +97,7 @@ struct ipc_response *ipc_recv_response(int socketfd) {
97error_2: 97error_2:
98 free(response); 98 free(response);
99error_1: 99error_1:
100 wlr_log(L_ERROR, "Unable to allocate memory for IPC response"); 100 wlr_log(WLR_ERROR, "Unable to allocate memory for IPC response");
101 return NULL; 101 return NULL;
102} 102}
103 103
diff --git a/common/log.c b/common/log.c
index 2cc7289c..847f3952 100644
--- a/common/log.c
+++ b/common/log.c
@@ -8,7 +8,7 @@ void sway_terminate(int code);
8void _sway_abort(const char *format, ...) { 8void _sway_abort(const char *format, ...) {
9 va_list args; 9 va_list args;
10 va_start(args, format); 10 va_start(args, format);
11 _wlr_vlog(L_ERROR, format, args); 11 _wlr_vlog(WLR_ERROR, format, args);
12 va_end(args); 12 va_end(args);
13 sway_terminate(EXIT_FAILURE); 13 sway_terminate(EXIT_FAILURE);
14} 14}
@@ -20,7 +20,7 @@ bool _sway_assert(bool condition, const char *format, ...) {
20 20
21 va_list args; 21 va_list args;
22 va_start(args, format); 22 va_start(args, format);
23 _wlr_vlog(L_ERROR, format, args); 23 _wlr_vlog(WLR_ERROR, format, args);
24 va_end(args); 24 va_end(args);
25 25
26#ifndef NDEBUG 26#ifndef NDEBUG
diff --git a/common/pango.c b/common/pango.c
index c88e50ce..92703f80 100644
--- a/common/pango.c
+++ b/common/pango.c
@@ -81,7 +81,7 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
81 pango_layout_set_markup(layout, buf, -1); 81 pango_layout_set_markup(layout, buf, -1);
82 free(buf); 82 free(buf);
83 } else { 83 } else {
84 wlr_log(L_ERROR, "pango_parse_markup '%s' -> error %s", text, 84 wlr_log(WLR_ERROR, "pango_parse_markup '%s' -> error %s", text,
85 error->message); 85 error->message);
86 g_error_free(error); 86 g_error_free(error);
87 markup = false; // fallback to plain text 87 markup = false; // fallback to plain text
diff --git a/common/readline.c b/common/readline.c
index 1c396a90..a2c69018 100644
--- a/common/readline.c
+++ b/common/readline.c
@@ -9,7 +9,7 @@ char *read_line(FILE *file) {
9 char *string = malloc(size); 9 char *string = malloc(size);
10 char lastChar = '\0'; 10 char lastChar = '\0';
11 if (!string) { 11 if (!string) {
12 wlr_log(L_ERROR, "Unable to allocate memory for read_line"); 12 wlr_log(WLR_ERROR, "Unable to allocate memory for read_line");
13 return NULL; 13 return NULL;
14 } 14 }
15 while (1) { 15 while (1) {
@@ -30,7 +30,7 @@ char *read_line(FILE *file) {
30 char *new_string = realloc(string, size *= 2); 30 char *new_string = realloc(string, size *= 2);
31 if (!new_string) { 31 if (!new_string) {
32 free(string); 32 free(string);
33 wlr_log(L_ERROR, "Unable to allocate memory for read_line"); 33 wlr_log(WLR_ERROR, "Unable to allocate memory for read_line");
34 return NULL; 34 return NULL;
35 } 35 }
36 string = new_string; 36 string = new_string;
diff --git a/common/util.c b/common/util.c
index 678926ed..e8a88772 100644
--- a/common/util.c
+++ b/common/util.c
@@ -113,7 +113,7 @@ uint32_t parse_color(const char *color) {
113 113
114 int len = strlen(color); 114 int len = strlen(color);
115 if (len != 6 && len != 8) { 115 if (len != 6 && len != 8) {
116 wlr_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color); 116 wlr_log(WLR_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color);
117 return 0xFFFFFFFF; 117 return 0xFFFFFFFF;
118 } 118 }
119 uint32_t res = (uint32_t)strtoul(color, NULL, 16); 119 uint32_t res = (uint32_t)strtoul(color, NULL, 16);
diff --git a/include/log.h b/include/log.h
index a9748127..dd526143 100644
--- a/include/log.h
+++ b/include/log.h
@@ -3,13 +3,19 @@
3#include <stdbool.h> 3#include <stdbool.h>
4#include <wlr/util/log.h> 4#include <wlr/util/log.h>
5 5
6#ifdef __GNUC__
7#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
8#else
9#define ATTRIB_PRINTF(start, end)
10#endif
11
6void _sway_abort(const char *filename, ...) ATTRIB_PRINTF(1, 2); 12void _sway_abort(const char *filename, ...) ATTRIB_PRINTF(1, 2);
7#define sway_abort(FMT, ...) \ 13#define sway_abort(FMT, ...) \
8 _sway_abort("[%s:%d] " FMT, wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) 14 _sway_abort("[%s:%d] " FMT, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
9 15
10bool _sway_assert(bool condition, const char* format, ...) ATTRIB_PRINTF(2, 3); 16bool _sway_assert(bool condition, const char* format, ...) ATTRIB_PRINTF(2, 3);
11#define sway_assert(COND, FMT, ...) \ 17#define sway_assert(COND, FMT, ...) \
12 _sway_assert(COND, "[%s:%d] %s:" FMT, wlr_strip_path(__FILE__), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__) 18 _sway_assert(COND, "[%s:%d] %s:" FMT, _wlr_strip_path(__FILE__), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__)
13 19
14void error_handler(int sig); 20void error_handler(int sig);
15 21
diff --git a/sway/commands.c b/sway/commands.c
index ef477f38..6c5bea37 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -163,7 +163,7 @@ struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers,
163 int handlers_size) { 163 int handlers_size) {
164 struct cmd_handler d = { .command=line }; 164 struct cmd_handler d = { .command=line };
165 struct cmd_handler *res = NULL; 165 struct cmd_handler *res = NULL;
166 wlr_log(L_DEBUG, "find_handler(%s)", line); 166 wlr_log(WLR_DEBUG, "find_handler(%s)", line);
167 167
168 bool config_loading = config->reading || !config->active; 168 bool config_loading = config->reading || !config->active;
169 169
@@ -248,10 +248,10 @@ struct cmd_results *execute_command(char *_exec, struct sway_seat *seat) {
248 cmd = argsep(&cmdlist, ","); 248 cmd = argsep(&cmdlist, ",");
249 cmd += strspn(cmd, whitespace); 249 cmd += strspn(cmd, whitespace);
250 if (strcmp(cmd, "") == 0) { 250 if (strcmp(cmd, "") == 0) {
251 wlr_log(L_INFO, "Ignoring empty command."); 251 wlr_log(WLR_INFO, "Ignoring empty command.");
252 continue; 252 continue;
253 } 253 }
254 wlr_log(L_INFO, "Handling command '%s'", cmd); 254 wlr_log(WLR_INFO, "Handling command '%s'", cmd);
255 //TODO better handling of argv 255 //TODO better handling of argv
256 int argc; 256 int argc;
257 char **argv = split_args(cmd, &argc); 257 char **argv = split_args(cmd, &argc);
@@ -355,7 +355,7 @@ struct cmd_results *config_command(char *exec) {
355 results = cmd_results_new(CMD_BLOCK_END, NULL, NULL); 355 results = cmd_results_new(CMD_BLOCK_END, NULL, NULL);
356 goto cleanup; 356 goto cleanup;
357 } 357 }
358 wlr_log(L_INFO, "handling config command '%s'", exec); 358 wlr_log(WLR_INFO, "handling config command '%s'", exec);
359 struct cmd_handler *handler = find_handler(argv[0], NULL, 0); 359 struct cmd_handler *handler = find_handler(argv[0], NULL, 0);
360 if (!handler) { 360 if (!handler) {
361 char *input = argv[0] ? argv[0] : "(empty)"; 361 char *input = argv[0] ? argv[0] : "(empty)";
@@ -388,7 +388,7 @@ cleanup:
388struct cmd_results *config_subcommand(char **argv, int argc, 388struct cmd_results *config_subcommand(char **argv, int argc,
389 struct cmd_handler *handlers, size_t handlers_size) { 389 struct cmd_handler *handlers, size_t handlers_size) {
390 char *command = join_args(argv, argc); 390 char *command = join_args(argv, argc);
391 wlr_log(L_DEBUG, "Subcommand: %s", command); 391 wlr_log(WLR_DEBUG, "Subcommand: %s", command);
392 free(command); 392 free(command);
393 393
394 struct cmd_handler *handler = find_handler(argv[0], handlers, 394 struct cmd_handler *handler = find_handler(argv[0], handlers,
@@ -479,7 +479,7 @@ struct cmd_results *config_commands_command(char *exec) {
479 } 479 }
480 policy->context = context; 480 policy->context = context;
481 481
482 wlr_log(L_INFO, "Set command policy for %s to %d", 482 wlr_log(WLR_INFO, "Set command policy for %s to %d",
483 policy->command, policy->context); 483 policy->command, policy->context);
484 484
485 results = cmd_results_new(CMD_SUCCESS, NULL, NULL); 485 results = cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -493,7 +493,7 @@ struct cmd_results *cmd_results_new(enum cmd_status status,
493 const char *input, const char *format, ...) { 493 const char *input, const char *format, ...) {
494 struct cmd_results *results = malloc(sizeof(struct cmd_results)); 494 struct cmd_results *results = malloc(sizeof(struct cmd_results));
495 if (!results) { 495 if (!results) {
496 wlr_log(L_ERROR, "Unable to allocate command results"); 496 wlr_log(WLR_ERROR, "Unable to allocate command results");
497 return NULL; 497 return NULL;
498 } 498 }
499 results->status = status; 499 results->status = status;
diff --git a/sway/commands/assign.c b/sway/commands/assign.c
index a90498ce..0bc0929a 100644
--- a/sway/commands/assign.c
+++ b/sway/commands/assign.c
@@ -45,7 +45,7 @@ struct cmd_results *cmd_assign(int argc, char **argv) {
45 criteria->target = join_args(argv, target_len); 45 criteria->target = join_args(argv, target_len);
46 46
47 list_add(config->criteria, criteria); 47 list_add(config->criteria, criteria);
48 wlr_log(L_DEBUG, "assign: '%s' -> '%s' added", criteria->raw, 48 wlr_log(WLR_DEBUG, "assign: '%s' -> '%s' added", criteria->raw,
49 criteria->target); 49 criteria->target);
50 50
51 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 51 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/bar.c b/sway/commands/bar.c
index d84ce808..f6a70c17 100644
--- a/sway/commands/bar.c
+++ b/sway/commands/bar.c
@@ -63,13 +63,13 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
63 for (int i = 0; i < config->bars->length; ++i) { 63 for (int i = 0; i < config->bars->length; ++i) {
64 struct bar_config *item = config->bars->items[i]; 64 struct bar_config *item = config->bars->items[i];
65 if (strcmp(item->id, argv[0]) == 0) { 65 if (strcmp(item->id, argv[0]) == 0) {
66 wlr_log(L_DEBUG, "Selecting bar: %s", argv[0]); 66 wlr_log(WLR_DEBUG, "Selecting bar: %s", argv[0]);
67 bar = item; 67 bar = item;
68 break; 68 break;
69 } 69 }
70 } 70 }
71 if (!bar) { 71 if (!bar) {
72 wlr_log(L_DEBUG, "Creating bar: %s", argv[0]); 72 wlr_log(WLR_DEBUG, "Creating bar: %s", argv[0]);
73 bar = default_bar_config(); 73 bar = default_bar_config();
74 if (!bar) { 74 if (!bar) {
75 return cmd_results_new(CMD_FAILURE, "bar", 75 return cmd_results_new(CMD_FAILURE, "bar",
@@ -108,7 +108,7 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
108 108
109 // Set current bar 109 // Set current bar
110 config->current_bar = bar; 110 config->current_bar = bar;
111 wlr_log(L_DEBUG, "Creating bar %s", bar->id); 111 wlr_log(WLR_DEBUG, "Creating bar %s", bar->id);
112 } 112 }
113 113
114 return config_subcommand(argv, argc, bar_handlers, sizeof(bar_handlers)); 114 return config_subcommand(argv, argc, bar_handlers, sizeof(bar_handlers));
diff --git a/sway/commands/bar/binding_mode_indicator.c b/sway/commands/bar/binding_mode_indicator.c
index 3ba5f33f..0c48bee9 100644
--- a/sway/commands/bar/binding_mode_indicator.c
+++ b/sway/commands/bar/binding_mode_indicator.c
@@ -15,11 +15,11 @@ struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
15 } 15 }
16 if (strcasecmp("yes", argv[0]) == 0) { 16 if (strcasecmp("yes", argv[0]) == 0) {
17 config->current_bar->binding_mode_indicator = true; 17 config->current_bar->binding_mode_indicator = true;
18 wlr_log(L_DEBUG, "Enabling binding mode indicator on bar: %s", 18 wlr_log(WLR_DEBUG, "Enabling binding mode indicator on bar: %s",
19 config->current_bar->id); 19 config->current_bar->id);
20 } else if (strcasecmp("no", argv[0]) == 0) { 20 } else if (strcasecmp("no", argv[0]) == 0) {
21 config->current_bar->binding_mode_indicator = false; 21 config->current_bar->binding_mode_indicator = false;
22 wlr_log(L_DEBUG, "Disabling binding mode indicator on bar: %s", 22 wlr_log(WLR_DEBUG, "Disabling binding mode indicator on bar: %s",
23 config->current_bar->id); 23 config->current_bar->id);
24 } 24 }
25 return cmd_results_new(CMD_INVALID, "binding_mode_indicator", 25 return cmd_results_new(CMD_INVALID, "binding_mode_indicator",
diff --git a/sway/commands/bar/font.c b/sway/commands/bar/font.c
index f036cbc3..2aa4e895 100644
--- a/sway/commands/bar/font.c
+++ b/sway/commands/bar/font.c
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_font(int argc, char **argv) {
15 char *font = join_args(argv, argc); 15 char *font = join_args(argv, argc);
16 free(config->current_bar->font); 16 free(config->current_bar->font);
17 config->current_bar->font = font; 17 config->current_bar->font = font;
18 wlr_log(L_DEBUG, "Settings font '%s' for bar: %s", 18 wlr_log(WLR_DEBUG, "Settings font '%s' for bar: %s",
19 config->current_bar->font, config->current_bar->id); 19 config->current_bar->font, config->current_bar->id);
20 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 20 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
21} 21}
diff --git a/sway/commands/bar/height.c b/sway/commands/bar/height.c
index 3160caed..18258526 100644
--- a/sway/commands/bar/height.c
+++ b/sway/commands/bar/height.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_height(int argc, char **argv) {
14 "Invalid height value: %s", argv[0]); 14 "Invalid height value: %s", argv[0]);
15 } 15 }
16 config->current_bar->height = height; 16 config->current_bar->height = height;
17 wlr_log(L_DEBUG, "Setting bar height to %d on bar: %s", 17 wlr_log(WLR_DEBUG, "Setting bar height to %d on bar: %s",
18 height, config->current_bar->id); 18 height, config->current_bar->id);
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20} 20}
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c
index 6641f184..502ce2c4 100644
--- a/sway/commands/bar/hidden_state.c
+++ b/sway/commands/bar/hidden_state.c
@@ -27,7 +27,7 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar,
27 if (!config->reading) { 27 if (!config->reading) {
28 ipc_event_barconfig_update(bar); 28 ipc_event_barconfig_update(bar);
29 } 29 }
30 wlr_log(L_DEBUG, "Setting hidden_state: '%s' for bar: %s", 30 wlr_log(WLR_DEBUG, "Setting hidden_state: '%s' for bar: %s",
31 bar->hidden_state, bar->id); 31 bar->hidden_state, bar->id);
32 } 32 }
33 // free old mode 33 // free old mode
diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c
index 6ce86fef..65fa69fd 100644
--- a/sway/commands/bar/id.c
+++ b/sway/commands/bar/id.c
@@ -24,7 +24,7 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
24 } 24 }
25 } 25 }
26 26
27 wlr_log(L_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name); 27 wlr_log(WLR_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name);
28 28
29 // free old bar id 29 // free old bar id
30 free(config->current_bar->id); 30 free(config->current_bar->id);
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c
index 34bb0a4f..28e2d77b 100644
--- a/sway/commands/bar/mode.c
+++ b/sway/commands/bar/mode.c
@@ -28,7 +28,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode
28 if (!config->reading) { 28 if (!config->reading) {
29 ipc_event_barconfig_update(bar); 29 ipc_event_barconfig_update(bar);
30 } 30 }
31 wlr_log(L_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); 31 wlr_log(WLR_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id);
32 } 32 }
33 33
34 // free old mode 34 // free old mode
diff --git a/sway/commands/bar/modifier.c b/sway/commands/bar/modifier.c
index 02f845e6..09025fff 100644
--- a/sway/commands/bar/modifier.c
+++ b/sway/commands/bar/modifier.c
@@ -30,7 +30,7 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
30 } 30 }
31 free_flat_list(split); 31 free_flat_list(split);
32 config->current_bar->modifier = mod; 32 config->current_bar->modifier = mod;
33 wlr_log(L_DEBUG, 33 wlr_log(WLR_DEBUG,
34 "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]); 34 "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]);
35 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 35 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
36} 36}
diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c
index f7ca0aa4..72754e05 100644
--- a/sway/commands/bar/output.c
+++ b/sway/commands/bar/output.c
@@ -42,7 +42,7 @@ struct cmd_results *bar_cmd_output(int argc, char **argv) {
42 42
43 if (add_output) { 43 if (add_output) {
44 list_add(outputs, strdup(output)); 44 list_add(outputs, strdup(output));
45 wlr_log(L_DEBUG, "Adding bar: '%s' to output '%s'", 45 wlr_log(WLR_DEBUG, "Adding bar: '%s' to output '%s'",
46 config->current_bar->id, output); 46 config->current_bar->id, output);
47 } 47 }
48 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 48 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/bar/pango_markup.c b/sway/commands/bar/pango_markup.c
index 480af724..857571fb 100644
--- a/sway/commands/bar/pango_markup.c
+++ b/sway/commands/bar/pango_markup.c
@@ -13,11 +13,11 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
13 } 13 }
14 if (strcasecmp("enabled", argv[0]) == 0) { 14 if (strcasecmp("enabled", argv[0]) == 0) {
15 config->current_bar->pango_markup = true; 15 config->current_bar->pango_markup = true;
16 wlr_log(L_DEBUG, "Enabling pango markup for bar: %s", 16 wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s",
17 config->current_bar->id); 17 config->current_bar->id);
18 } else if (strcasecmp("disabled", argv[0]) == 0) { 18 } else if (strcasecmp("disabled", argv[0]) == 0) {
19 config->current_bar->pango_markup = false; 19 config->current_bar->pango_markup = false;
20 wlr_log(L_DEBUG, "Disabling pango markup for bar: %s", 20 wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s",
21 config->current_bar->id); 21 config->current_bar->id);
22 } else { 22 } else {
23 error = cmd_results_new(CMD_INVALID, "pango_markup", 23 error = cmd_results_new(CMD_INVALID, "pango_markup",
diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c
index 9c580483..48e7ddbd 100644
--- a/sway/commands/bar/position.c
+++ b/sway/commands/bar/position.c
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_position(int argc, char **argv) {
15 char *valid[] = { "top", "bottom", "left", "right" }; 15 char *valid[] = { "top", "bottom", "left", "right" };
16 for (size_t i = 0; i < sizeof(valid) / sizeof(valid[0]); ++i) { 16 for (size_t i = 0; i < sizeof(valid) / sizeof(valid[0]); ++i) {
17 if (strcasecmp(valid[i], argv[0]) == 0) { 17 if (strcasecmp(valid[i], argv[0]) == 0) {
18 wlr_log(L_DEBUG, "Setting bar position '%s' for bar: %s", 18 wlr_log(WLR_DEBUG, "Setting bar position '%s' for bar: %s",
19 argv[0], config->current_bar->id); 19 argv[0], config->current_bar->id);
20 config->current_bar->position = strdup(argv[0]); 20 config->current_bar->position = strdup(argv[0]);
21 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/bar/separator_symbol.c b/sway/commands/bar/separator_symbol.c
index 1e08df6d..392ab730 100644
--- a/sway/commands/bar/separator_symbol.c
+++ b/sway/commands/bar/separator_symbol.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) {
14 } 14 }
15 free(config->current_bar->separator_symbol); 15 free(config->current_bar->separator_symbol);
16 config->current_bar->separator_symbol = strdup(argv[0]); 16 config->current_bar->separator_symbol = strdup(argv[0]);
17 wlr_log(L_DEBUG, "Settings separator_symbol '%s' for bar: %s", 17 wlr_log(WLR_DEBUG, "Settings separator_symbol '%s' for bar: %s",
18 config->current_bar->separator_symbol, config->current_bar->id); 18 config->current_bar->separator_symbol, config->current_bar->id);
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20} 20}
diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c
index 5e199cde..6f6f81a3 100644
--- a/sway/commands/bar/status_command.c
+++ b/sway/commands/bar/status_command.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) {
14 } 14 }
15 free(config->current_bar->status_command); 15 free(config->current_bar->status_command);
16 config->current_bar->status_command = join_args(argv, argc); 16 config->current_bar->status_command = join_args(argv, argc);
17 wlr_log(L_DEBUG, "Feeding bar with status command: %s", 17 wlr_log(WLR_DEBUG, "Feeding bar with status command: %s",
18 config->current_bar->status_command); 18 config->current_bar->status_command);
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20} 20}
diff --git a/sway/commands/bar/strip_workspace_numbers.c b/sway/commands/bar/strip_workspace_numbers.c
index 4f24a356..4e47d047 100644
--- a/sway/commands/bar/strip_workspace_numbers.c
+++ b/sway/commands/bar/strip_workspace_numbers.c
@@ -15,11 +15,11 @@ struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) {
15 } 15 }
16 if (strcasecmp("yes", argv[0]) == 0) { 16 if (strcasecmp("yes", argv[0]) == 0) {
17 config->current_bar->strip_workspace_numbers = true; 17 config->current_bar->strip_workspace_numbers = true;
18 wlr_log(L_DEBUG, "Stripping workspace numbers on bar: %s", 18 wlr_log(WLR_DEBUG, "Stripping workspace numbers on bar: %s",
19 config->current_bar->id); 19 config->current_bar->id);
20 } else if (strcasecmp("no", argv[0]) == 0) { 20 } else if (strcasecmp("no", argv[0]) == 0) {
21 config->current_bar->strip_workspace_numbers = false; 21 config->current_bar->strip_workspace_numbers = false;
22 wlr_log(L_DEBUG, "Enabling workspace numbers on bar: %s", 22 wlr_log(WLR_DEBUG, "Enabling workspace numbers on bar: %s",
23 config->current_bar->id); 23 config->current_bar->id);
24 } else { 24 } else {
25 return cmd_results_new(CMD_INVALID, 25 return cmd_results_new(CMD_INVALID,
diff --git a/sway/commands/bar/swaybar_command.c b/sway/commands/bar/swaybar_command.c
index 520cdd11..04e78e77 100644
--- a/sway/commands/bar/swaybar_command.c
+++ b/sway/commands/bar/swaybar_command.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) {
14 } 14 }
15 free(config->current_bar->swaybar_command); 15 free(config->current_bar->swaybar_command);
16 config->current_bar->swaybar_command = join_args(argv, argc); 16 config->current_bar->swaybar_command = join_args(argv, argc);
17 wlr_log(L_DEBUG, "Using custom swaybar command: %s", 17 wlr_log(WLR_DEBUG, "Using custom swaybar command: %s",
18 config->current_bar->swaybar_command); 18 config->current_bar->swaybar_command);
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20} 20}
diff --git a/sway/commands/bar/workspace_buttons.c b/sway/commands/bar/workspace_buttons.c
index 6edc3a0d..a4079b2a 100644
--- a/sway/commands/bar/workspace_buttons.c
+++ b/sway/commands/bar/workspace_buttons.c
@@ -14,11 +14,11 @@ struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) {
14 } 14 }
15 if (strcasecmp("yes", argv[0]) == 0) { 15 if (strcasecmp("yes", argv[0]) == 0) {
16 config->current_bar->workspace_buttons = true; 16 config->current_bar->workspace_buttons = true;
17 wlr_log(L_DEBUG, "Enabling workspace buttons on bar: %s", 17 wlr_log(WLR_DEBUG, "Enabling workspace buttons on bar: %s",
18 config->current_bar->id); 18 config->current_bar->id);
19 } else if (strcasecmp("no", argv[0]) == 0) { 19 } else if (strcasecmp("no", argv[0]) == 0) {
20 config->current_bar->workspace_buttons = false; 20 config->current_bar->workspace_buttons = false;
21 wlr_log(L_DEBUG, "Disabling workspace buttons on bar: %s", 21 wlr_log(WLR_DEBUG, "Disabling workspace buttons on bar: %s",
22 config->current_bar->id); 22 config->current_bar->id);
23 } else { 23 } else {
24 return cmd_results_new(CMD_INVALID, "workspace_buttons", 24 return cmd_results_new(CMD_INVALID, "workspace_buttons",
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c
index 7386f82c..701de00a 100644
--- a/sway/commands/bar/wrap_scroll.c
+++ b/sway/commands/bar/wrap_scroll.c
@@ -13,11 +13,11 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
13 } 13 }
14 if (strcasecmp("yes", argv[0]) == 0) { 14 if (strcasecmp("yes", argv[0]) == 0) {
15 config->current_bar->wrap_scroll = true; 15 config->current_bar->wrap_scroll = true;
16 wlr_log(L_DEBUG, "Enabling wrap scroll on bar: %s", 16 wlr_log(WLR_DEBUG, "Enabling wrap scroll on bar: %s",
17 config->current_bar->id); 17 config->current_bar->id);
18 } else if (strcasecmp("no", argv[0]) == 0) { 18 } else if (strcasecmp("no", argv[0]) == 0) {
19 config->current_bar->wrap_scroll = false; 19 config->current_bar->wrap_scroll = false;
20 wlr_log(L_DEBUG, "Disabling wrap scroll on bar: %s", 20 wlr_log(WLR_DEBUG, "Disabling wrap scroll on bar: %s",
21 config->current_bar->id); 21 config->current_bar->id);
22 } else { 22 } else {
23 return cmd_results_new(CMD_INVALID, 23 return cmd_results_new(CMD_INVALID,
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 821f9cd1..83e9e432 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -184,7 +184,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
184 for (int i = 0; i < mode_bindings->length; ++i) { 184 for (int i = 0; i < mode_bindings->length; ++i) {
185 struct sway_binding *config_binding = mode_bindings->items[i]; 185 struct sway_binding *config_binding = mode_bindings->items[i];
186 if (binding_key_compare(binding, config_binding)) { 186 if (binding_key_compare(binding, config_binding)) {
187 wlr_log(L_DEBUG, "overwriting old binding with command '%s'", 187 wlr_log(WLR_DEBUG, "overwriting old binding with command '%s'",
188 config_binding->command); 188 config_binding->command);
189 free_sway_binding(config_binding); 189 free_sway_binding(config_binding);
190 mode_bindings->items[i] = binding; 190 mode_bindings->items[i] = binding;
@@ -196,7 +196,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
196 list_add(mode_bindings, binding); 196 list_add(mode_bindings, binding);
197 } 197 }
198 198
199 wlr_log(L_DEBUG, "%s - Bound %s to command %s", 199 wlr_log(WLR_DEBUG, "%s - Bound %s to command %s",
200 bindtype, argv[0], binding->command); 200 bindtype, argv[0], binding->command);
201 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 201 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
202 202
diff --git a/sway/commands/exec.c b/sway/commands/exec.c
index 363d5bef..7fc54123 100644
--- a/sway/commands/exec.c
+++ b/sway/commands/exec.c
@@ -8,7 +8,7 @@ struct cmd_results *cmd_exec(int argc, char **argv) {
8 if (!config->active) return cmd_results_new(CMD_DEFER, "exec", NULL); 8 if (!config->active) return cmd_results_new(CMD_DEFER, "exec", NULL);
9 if (config->reloading) { 9 if (config->reloading) {
10 char *args = join_args(argv, argc); 10 char *args = join_args(argv, argc);
11 wlr_log(L_DEBUG, "Ignoring 'exec %s' due to reload", args); 11 wlr_log(WLR_DEBUG, "Ignoring 'exec %s' due to reload", args);
12 free(args); 12 free(args);
13 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 13 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
14 } 14 }
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 1c99de97..c7727857 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -20,7 +20,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
20 20
21 char *tmp = NULL; 21 char *tmp = NULL;
22 if (strcmp((char*)*argv, "--no-startup-id") == 0) { 22 if (strcmp((char*)*argv, "--no-startup-id") == 0) {
23 wlr_log(L_INFO, "exec switch '--no-startup-id' not supported, ignored."); 23 wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored.");
24 if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) { 24 if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) {
25 return error; 25 return error;
26 } 26 }
@@ -35,11 +35,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
35 strncpy(cmd, tmp, sizeof(cmd) - 1); 35 strncpy(cmd, tmp, sizeof(cmd) - 1);
36 cmd[sizeof(cmd) - 1] = 0; 36 cmd[sizeof(cmd) - 1] = 0;
37 free(tmp); 37 free(tmp);
38 wlr_log(L_DEBUG, "Executing %s", cmd); 38 wlr_log(WLR_DEBUG, "Executing %s", cmd);
39 39
40 int fd[2]; 40 int fd[2];
41 if (pipe(fd) != 0) { 41 if (pipe(fd) != 0) {
42 wlr_log(L_ERROR, "Unable to create pipe for fork"); 42 wlr_log(WLR_ERROR, "Unable to create pipe for fork");
43 } 43 }
44 44
45 pid_t pid, child; 45 pid_t pid, child;
@@ -73,7 +73,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
73 // cleanup child process 73 // cleanup child process
74 waitpid(pid, NULL, 0); 74 waitpid(pid, NULL, 0);
75 if (child > 0) { 75 if (child > 0) {
76 wlr_log(L_DEBUG, "Child process created with pid %d", child); 76 wlr_log(WLR_DEBUG, "Child process created with pid %d", child);
77 // TODO: add PID to active workspace 77 // TODO: add PID to active workspace
78 } else { 78 } else {
79 return cmd_results_new(CMD_FAILURE, "exec_always", 79 return cmd_results_new(CMD_FAILURE, "exec_always",
diff --git a/sway/commands/for_window.c b/sway/commands/for_window.c
index 8c425a1d..ac4d6563 100644
--- a/sway/commands/for_window.c
+++ b/sway/commands/for_window.c
@@ -24,7 +24,7 @@ struct cmd_results *cmd_for_window(int argc, char **argv) {
24 criteria->cmdlist = join_args(argv + 1, argc - 1); 24 criteria->cmdlist = join_args(argv + 1, argc - 1);
25 25
26 list_add(config->criteria, criteria); 26 list_add(config->criteria, criteria);
27 wlr_log(L_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist); 27 wlr_log(WLR_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist);
28 28
29 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 29 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
30} 30}
diff --git a/sway/commands/input.c b/sway/commands/input.c
index 678c57c4..574e1f8c 100644
--- a/sway/commands/input.c
+++ b/sway/commands/input.c
@@ -35,7 +35,7 @@ struct cmd_results *cmd_input(int argc, char **argv) {
35 return error; 35 return error;
36 } 36 }
37 37
38 wlr_log(L_DEBUG, "entering input block: %s", argv[0]); 38 wlr_log(WLR_DEBUG, "entering input block: %s", argv[0]);
39 39
40 config->handler_context.input_config = new_input_config(argv[0]); 40 config->handler_context.input_config = new_input_config(argv[0]);
41 if (!config->handler_context.input_config) { 41 if (!config->handler_context.input_config) {
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c
index e2ccdc94..abfe3b12 100644
--- a/sway/commands/input/events.c
+++ b/sway/commands/input/events.c
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_events(int argc, char **argv) {
16 return cmd_results_new(CMD_FAILURE, "events", 16 return cmd_results_new(CMD_FAILURE, "events",
17 "No input device defined."); 17 "No input device defined.");
18 } 18 }
19 wlr_log(L_DEBUG, "events for device: %s", 19 wlr_log(WLR_DEBUG, "events for device: %s",
20 current_input_config->identifier); 20 current_input_config->identifier);
21 struct input_config *new_config = 21 struct input_config *new_config =
22 new_input_config(current_input_config->identifier); 22 new_input_config(current_input_config->identifier);
diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c
index 7d027d5d..a8d1a10c 100644
--- a/sway/commands/input/tap.c
+++ b/sway/commands/input/tap.c
@@ -28,7 +28,7 @@ struct cmd_results *input_cmd_tap(int argc, char **argv) {
28 "Expected 'tap <enabled|disabled>'"); 28 "Expected 'tap <enabled|disabled>'");
29 } 29 }
30 30
31 wlr_log(L_DEBUG, "apply-tap for device: %s", 31 wlr_log(WLR_DEBUG, "apply-tap for device: %s",
32 current_input_config->identifier); 32 current_input_config->identifier);
33 apply_input_config(new_config); 33 apply_input_config(new_config);
34 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 34 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c
index 867e65d3..9fa5a344 100644
--- a/sway/commands/input/xkb_layout.c
+++ b/sway/commands/input/xkb_layout.c
@@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
19 19
20 new_config->xkb_layout = strdup(argv[0]); 20 new_config->xkb_layout = strdup(argv[0]);
21 21
22 wlr_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s", 22 wlr_log(WLR_DEBUG, "apply-xkb_layout for device: %s layout: %s",
23 current_input_config->identifier, new_config->xkb_layout); 23 current_input_config->identifier, new_config->xkb_layout);
24 apply_input_config(new_config); 24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c
index e8c8e04e..0d082625 100644
--- a/sway/commands/input/xkb_model.c
+++ b/sway/commands/input/xkb_model.c
@@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
19 19
20 new_config->xkb_model = strdup(argv[0]); 20 new_config->xkb_model = strdup(argv[0]);
21 21
22 wlr_log(L_DEBUG, "apply-xkb_model for device: %s model: %s", 22 wlr_log(WLR_DEBUG, "apply-xkb_model for device: %s model: %s",
23 current_input_config->identifier, new_config->xkb_model); 23 current_input_config->identifier, new_config->xkb_model);
24 apply_input_config(new_config); 24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
index e9ddd6e3..3059d941 100644
--- a/sway/commands/input/xkb_options.c
+++ b/sway/commands/input/xkb_options.c
@@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
19 19
20 new_config->xkb_options = strdup(argv[0]); 20 new_config->xkb_options = strdup(argv[0]);
21 21
22 wlr_log(L_DEBUG, "apply-xkb_options for device: %s options: %s", 22 wlr_log(WLR_DEBUG, "apply-xkb_options for device: %s options: %s",
23 current_input_config->identifier, new_config->xkb_options); 23 current_input_config->identifier, new_config->xkb_options);
24 apply_input_config(new_config); 24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c
index 926d0ac1..560f088e 100644
--- a/sway/commands/input/xkb_rules.c
+++ b/sway/commands/input/xkb_rules.c
@@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
19 19
20 new_config->xkb_rules = strdup(argv[0]); 20 new_config->xkb_rules = strdup(argv[0]);
21 21
22 wlr_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s", 22 wlr_log(WLR_DEBUG, "apply-xkb_rules for device: %s rules: %s",
23 current_input_config->identifier, new_config->xkb_rules); 23 current_input_config->identifier, new_config->xkb_rules);
24 apply_input_config(new_config); 24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c
index 0e3ffd41..0aa03440 100644
--- a/sway/commands/input/xkb_variant.c
+++ b/sway/commands/input/xkb_variant.c
@@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
19 19
20 new_config->xkb_variant = strdup(argv[0]); 20 new_config->xkb_variant = strdup(argv[0]);
21 21
22 wlr_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s", 22 wlr_log(WLR_DEBUG, "apply-xkb_variant for device: %s variant: %s",
23 current_input_config->identifier, new_config->xkb_variant); 23 current_input_config->identifier, new_config->xkb_variant);
24 apply_input_config(new_config); 24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/mode.c b/sway/commands/mode.c
index d2c14468..b460fcb5 100644
--- a/sway/commands/mode.c
+++ b/sway/commands/mode.c
@@ -65,7 +65,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
65 return error; 65 return error;
66 } 66 }
67 if ((config->reading && argc > 1) || (!config->reading && argc == 1)) { 67 if ((config->reading && argc > 1) || (!config->reading && argc == 1)) {
68 wlr_log(L_DEBUG, "Switching to mode `%s' (pango=%d)", 68 wlr_log(WLR_DEBUG, "Switching to mode `%s' (pango=%d)",
69 mode->name, mode->pango); 69 mode->name, mode->pango);
70 } 70 }
71 // Set current mode 71 // Set current mode
diff --git a/sway/commands/output.c b/sway/commands/output.c
index f955bf90..15bbd687 100644
--- a/sway/commands/output.c
+++ b/sway/commands/output.c
@@ -29,7 +29,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
29 29
30 struct output_config *output = new_output_config(argv[0]); 30 struct output_config *output = new_output_config(argv[0]);
31 if (!output) { 31 if (!output) {
32 wlr_log(L_ERROR, "Failed to allocate output config"); 32 wlr_log(WLR_ERROR, "Failed to allocate output config");
33 return NULL; 33 return NULL;
34 } 34 }
35 argc--; argv++; 35 argc--; argv++;
@@ -71,7 +71,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
71 list_add(config->output_configs, output); 71 list_add(config->output_configs, output);
72 } 72 }
73 73
74 wlr_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " 74 wlr_log(WLR_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz "
75 "position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)", 75 "position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)",
76 output->name, output->enabled, output->width, output->height, 76 output->name, output->enabled, output->width, output->height,
77 output->refresh_rate, output->x, output->y, output->scale, 77 output->refresh_rate, output->x, output->y, output->scale,
@@ -85,7 +85,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
85 struct sway_output *sway_output; 85 struct sway_output *sway_output;
86 wl_list_for_each(sway_output, &root_container.sway_root->outputs, link) { 86 wl_list_for_each(sway_output, &root_container.sway_root->outputs, link) {
87 output_get_identifier(identifier, sizeof(identifier), sway_output); 87 output_get_identifier(identifier, sizeof(identifier), sway_output);
88 wlr_log(L_DEBUG, "Checking identifier %s", identifier); 88 wlr_log(WLR_DEBUG, "Checking identifier %s", identifier);
89 if (all || strcmp(sway_output->wlr_output->name, output->name) == 0 89 if (all || strcmp(sway_output->wlr_output->name, output->name) == 0
90 || strcmp(identifier, output->name) == 0) { 90 || strcmp(identifier, output->name) == 0) {
91 if (!sway_output->swayc) { 91 if (!sway_output->swayc) {
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index 65b5f902..c2c138f8 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -72,7 +72,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
72 src = strdup(p.we_wordv[0]); 72 src = strdup(p.we_wordv[0]);
73 wordfree(&p); 73 wordfree(&p);
74 if (!src) { 74 if (!src) {
75 wlr_log(L_ERROR, "Failed to duplicate string"); 75 wlr_log(WLR_ERROR, "Failed to duplicate string");
76 return cmd_results_new(CMD_FAILURE, "output", 76 return cmd_results_new(CMD_FAILURE, "output",
77 "Unable to allocate resource"); 77 "Unable to allocate resource");
78 } 78 }
@@ -82,7 +82,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
82 82
83 char *conf = strdup(config->current_config); 83 char *conf = strdup(config->current_config);
84 if (!conf) { 84 if (!conf) {
85 wlr_log(L_ERROR, "Failed to duplicate string"); 85 wlr_log(WLR_ERROR, "Failed to duplicate string");
86 free(src); 86 free(src);
87 return cmd_results_new(CMD_FAILURE, "output", 87 return cmd_results_new(CMD_FAILURE, "output",
88 "Unable to allocate resources"); 88 "Unable to allocate resources");
@@ -94,7 +94,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
94 if (!src) { 94 if (!src) {
95 free(rel_path); 95 free(rel_path);
96 free(conf); 96 free(conf);
97 wlr_log(L_ERROR, "Unable to allocate memory"); 97 wlr_log(WLR_ERROR, "Unable to allocate memory");
98 return cmd_results_new(CMD_FAILURE, "output", 98 return cmd_results_new(CMD_FAILURE, "output",
99 "Unable to allocate resources"); 99 "Unable to allocate resources");
100 } 100 }
diff --git a/sway/commands/rename.c b/sway/commands/rename.c
index 104a3392..a380ff9c 100644
--- a/sway/commands/rename.c
+++ b/sway/commands/rename.c
@@ -68,7 +68,7 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
68 "Workspace already exists"); 68 "Workspace already exists");
69 } 69 }
70 70
71 wlr_log(L_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name); 71 wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
72 free(workspace->name); 72 free(workspace->name);
73 workspace->name = new_name; 73 workspace->name = new_name;
74 74
diff --git a/sway/commands/resize.c b/sway/commands/resize.c
index 6357343e..5efbd8b0 100644
--- a/sway/commands/resize.c
+++ b/sway/commands/resize.c
@@ -95,7 +95,7 @@ static void resize_tiled(int amount, enum resize_axis axis) {
95 return; 95 return;
96 } 96 }
97 97
98 wlr_log(L_DEBUG, 98 wlr_log(WLR_DEBUG,
99 "Found the proper parent: %p. It has %d l conts, and %d r conts", 99 "Found the proper parent: %p. It has %d l conts, and %d r conts",
100 parent->parent, minor_weight, major_weight); 100 parent->parent, minor_weight, major_weight);
101 101
diff --git a/sway/commands/set.c b/sway/commands/set.c
index 84e9b792..ea388d3b 100644
--- a/sway/commands/set.c
+++ b/sway/commands/set.c
@@ -32,7 +32,7 @@ struct cmd_results *cmd_set(int argc, char **argv) {
32 } 32 }
33 33
34 if (argv[0][0] != '$') { 34 if (argv[0][0] != '$') {
35 wlr_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]); 35 wlr_log(WLR_INFO, "Warning: variable '%s' doesn't start with $", argv[0]);
36 36
37 size_t size = snprintf(NULL, 0, "$%s", argv[0]); 37 size_t size = snprintf(NULL, 0, "$%s", argv[0]);
38 tmp = malloc(size + 1); 38 tmp = malloc(size + 1);
diff --git a/sway/commands/swaybg_command.c b/sway/commands/swaybg_command.c
index 770d4821..36f7fdcd 100644
--- a/sway/commands/swaybg_command.c
+++ b/sway/commands/swaybg_command.c
@@ -13,7 +13,7 @@ struct cmd_results *cmd_swaybg_command(int argc, char **argv) {
13 free(config->swaybg_command); 13 free(config->swaybg_command);
14 } 14 }
15 config->swaybg_command = join_args(argv, argc); 15 config->swaybg_command = join_args(argv, argc);
16 wlr_log(L_DEBUG, "Using custom swaybg command: %s", 16 wlr_log(WLR_DEBUG, "Using custom swaybg command: %s",
17 config->swaybg_command); 17 config->swaybg_command);
18 18
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index d15be571..e8b37182 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -51,7 +51,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
51 free(old); // workspaces can only be assigned to a single output 51 free(old); // workspaces can only be assigned to a single output
52 list_del(config->workspace_outputs, i); 52 list_del(config->workspace_outputs, i);
53 } 53 }
54 wlr_log(L_DEBUG, "Assigning workspace %s to output %s", wso->workspace, wso->output); 54 wlr_log(WLR_DEBUG, "Assigning workspace %s to output %s", wso->workspace, wso->output);
55 list_add(config->workspace_outputs, wso); 55 list_add(config->workspace_outputs, wso);
56 } else { 56 } else {
57 if (config->reading || !config->active) { 57 if (config->reading || !config->active) {
diff --git a/sway/config.c b/sway/config.c
index 89b7d349..d0e0e432 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -276,12 +276,12 @@ static char *get_config_path(void) {
276 char *home = getenv("HOME"); 276 char *home = getenv("HOME");
277 char *config_home = malloc(strlen(home) + strlen("/.config") + 1); 277 char *config_home = malloc(strlen(home) + strlen("/.config") + 1);
278 if (!config_home) { 278 if (!config_home) {
279 wlr_log(L_ERROR, "Unable to allocate $HOME/.config"); 279 wlr_log(WLR_ERROR, "Unable to allocate $HOME/.config");
280 } else { 280 } else {
281 strcpy(config_home, home); 281 strcpy(config_home, home);
282 strcat(config_home, "/.config"); 282 strcat(config_home, "/.config");
283 setenv("XDG_CONFIG_HOME", config_home, 1); 283 setenv("XDG_CONFIG_HOME", config_home, 1);
284 wlr_log(L_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home); 284 wlr_log(WLR_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home);
285 free(config_home); 285 free(config_home);
286 } 286 }
287 } 287 }
@@ -308,11 +308,11 @@ const char *current_config_path;
308 308
309static bool load_config(const char *path, struct sway_config *config) { 309static bool load_config(const char *path, struct sway_config *config) {
310 if (path == NULL) { 310 if (path == NULL) {
311 wlr_log(L_ERROR, "Unable to find a config file!"); 311 wlr_log(WLR_ERROR, "Unable to find a config file!");
312 return false; 312 return false;
313 } 313 }
314 314
315 wlr_log(L_INFO, "Loading config from %s", path); 315 wlr_log(WLR_INFO, "Loading config from %s", path);
316 current_config_path = path; 316 current_config_path = path;
317 317
318 struct stat sb; 318 struct stat sb;
@@ -322,7 +322,7 @@ static bool load_config(const char *path, struct sway_config *config) {
322 322
323 FILE *f = fopen(path, "r"); 323 FILE *f = fopen(path, "r");
324 if (!f) { 324 if (!f) {
325 wlr_log(L_ERROR, "Unable to open %s for reading", path); 325 wlr_log(WLR_ERROR, "Unable to open %s for reading", path);
326 return false; 326 return false;
327 } 327 }
328 328
@@ -330,7 +330,7 @@ static bool load_config(const char *path, struct sway_config *config) {
330 fclose(f); 330 fclose(f);
331 331
332 if (!config_load_success) { 332 if (!config_load_success) {
333 wlr_log(L_ERROR, "Error(s) loading config!"); 333 wlr_log(WLR_ERROR, "Error(s) loading config!");
334 } 334 }
335 335
336 current_config_path = NULL; 336 current_config_path = NULL;
@@ -353,7 +353,7 @@ bool load_main_config(const char *file, bool is_active) {
353 353
354 config_defaults(config); 354 config_defaults(config);
355 if (is_active) { 355 if (is_active) {
356 wlr_log(L_DEBUG, "Performing configuration file reload"); 356 wlr_log(WLR_DEBUG, "Performing configuration file reload");
357 config->reloading = true; 357 config->reloading = true;
358 config->active = true; 358 config->active = true;
359 } 359 }
@@ -369,7 +369,7 @@ bool load_main_config(const char *file, bool is_active) {
369 /* 369 /*
370 DIR *dir = opendir(SYSCONFDIR "/sway/security.d"); 370 DIR *dir = opendir(SYSCONFDIR "/sway/security.d");
371 if (!dir) { 371 if (!dir) {
372 wlr_log(L_ERROR, 372 wlr_log(WLR_ERROR,
373 "%s does not exist, sway will have no security configuration" 373 "%s does not exist, sway will have no security configuration"
374 " and will probably be broken", SYSCONFDIR "/sway/security.d"); 374 " and will probably be broken", SYSCONFDIR "/sway/security.d");
375 } else { 375 } else {
@@ -398,7 +398,7 @@ bool load_main_config(const char *file, bool is_active) {
398 if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || 398 if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 ||
399 (((s.st_mode & 0777) != 0644) && 399 (((s.st_mode & 0777) != 0644) &&
400 (s.st_mode & 0777) != 0444)) { 400 (s.st_mode & 0777) != 0444)) {
401 wlr_log(L_ERROR, 401 wlr_log(WLR_ERROR,
402 "Refusing to load %s - it must be owned by root " 402 "Refusing to load %s - it must be owned by root "
403 "and mode 644 or 444", _path); 403 "and mode 644 or 444", _path);
404 success = false; 404 success = false;
@@ -436,7 +436,7 @@ static bool load_include_config(const char *path, const char *parent_dir,
436 len = len + strlen(parent_dir) + 2; 436 len = len + strlen(parent_dir) + 2;
437 full_path = malloc(len * sizeof(char)); 437 full_path = malloc(len * sizeof(char));
438 if (!full_path) { 438 if (!full_path) {
439 wlr_log(L_ERROR, 439 wlr_log(WLR_ERROR,
440 "Unable to allocate full path to included config"); 440 "Unable to allocate full path to included config");
441 return false; 441 return false;
442 } 442 }
@@ -449,7 +449,7 @@ static bool load_include_config(const char *path, const char *parent_dir,
449 free(full_path); 449 free(full_path);
450 450
451 if (real_path == NULL) { 451 if (real_path == NULL) {
452 wlr_log(L_DEBUG, "%s not found.", path); 452 wlr_log(WLR_DEBUG, "%s not found.", path);
453 return false; 453 return false;
454 } 454 }
455 455
@@ -458,7 +458,7 @@ static bool load_include_config(const char *path, const char *parent_dir,
458 for (j = 0; j < config->config_chain->length; ++j) { 458 for (j = 0; j < config->config_chain->length; ++j) {
459 char *old_path = config->config_chain->items[j]; 459 char *old_path = config->config_chain->items[j];
460 if (strcmp(real_path, old_path) == 0) { 460 if (strcmp(real_path, old_path) == 0) {
461 wlr_log(L_DEBUG, 461 wlr_log(WLR_DEBUG,
462 "%s already included once, won't be included again.", 462 "%s already included once, won't be included again.",
463 real_path); 463 real_path);
464 free(real_path); 464 free(real_path);
@@ -512,7 +512,7 @@ bool load_include_configs(const char *path, struct sway_config *config) {
512 // restore wd 512 // restore wd
513 if (chdir(wd) < 0) { 513 if (chdir(wd) < 0) {
514 free(wd); 514 free(wd);
515 wlr_log(L_ERROR, "failed to restore working directory"); 515 wlr_log(WLR_ERROR, "failed to restore working directory");
516 return false; 516 return false;
517 } 517 }
518 518
@@ -527,13 +527,13 @@ static int detect_brace_on_following_line(FILE *file, char *line,
527 char *peeked = NULL; 527 char *peeked = NULL;
528 long position = 0; 528 long position = 0;
529 do { 529 do {
530 wlr_log(L_DEBUG, "Peeking line %d", line_number + lines + 1); 530 wlr_log(WLR_DEBUG, "Peeking line %d", line_number + lines + 1);
531 free(peeked); 531 free(peeked);
532 peeked = peek_line(file, lines, &position); 532 peeked = peek_line(file, lines, &position);
533 if (peeked) { 533 if (peeked) {
534 peeked = strip_whitespace(peeked); 534 peeked = strip_whitespace(peeked);
535 } 535 }
536 wlr_log(L_DEBUG, "Peeked line: `%s`", peeked); 536 wlr_log(WLR_DEBUG, "Peeked line: `%s`", peeked);
537 lines++; 537 lines++;
538 } while (peeked && strlen(peeked) == 0); 538 } while (peeked && strlen(peeked) == 0);
539 539
@@ -552,7 +552,7 @@ static char *expand_line(const char *block, const char *line, bool add_brace) {
552 + (add_brace ? 2 : 0) + 1; 552 + (add_brace ? 2 : 0) + 1;
553 char *expanded = calloc(1, size); 553 char *expanded = calloc(1, size);
554 if (!expanded) { 554 if (!expanded) {
555 wlr_log(L_ERROR, "Cannot allocate expanded line buffer"); 555 wlr_log(WLR_ERROR, "Cannot allocate expanded line buffer");
556 return NULL; 556 return NULL;
557 } 557 }
558 snprintf(expanded, size, "%s%s%s%s", block ? block : "", 558 snprintf(expanded, size, "%s%s%s%s", block ? block : "",
@@ -572,7 +572,7 @@ bool read_config(FILE *file, struct sway_config *config) {
572 continue; 572 continue;
573 } 573 }
574 line_number++; 574 line_number++;
575 wlr_log(L_DEBUG, "Read line %d: %s", line_number, line); 575 wlr_log(WLR_DEBUG, "Read line %d: %s", line_number, line);
576 line = strip_whitespace(line); 576 line = strip_whitespace(line);
577 if (line[0] == '#') { 577 if (line[0] == '#') {
578 free(line); 578 free(line);
@@ -586,7 +586,7 @@ bool read_config(FILE *file, struct sway_config *config) {
586 line_number); 586 line_number);
587 if (brace_detected > 0) { 587 if (brace_detected > 0) {
588 line_number += brace_detected; 588 line_number += brace_detected;
589 wlr_log(L_DEBUG, "Detected open brace on line %d", line_number); 589 wlr_log(WLR_DEBUG, "Detected open brace on line %d", line_number);
590 } 590 }
591 char *expanded = expand_line(block, line, brace_detected > 0); 591 char *expanded = expand_line(block, line, brace_detected > 0);
592 if (!expanded) { 592 if (!expanded) {
@@ -594,7 +594,7 @@ bool read_config(FILE *file, struct sway_config *config) {
594 list_free(stack); 594 list_free(stack);
595 return false; 595 return false;
596 } 596 }
597 wlr_log(L_DEBUG, "Expanded line: %s", expanded); 597 wlr_log(WLR_DEBUG, "Expanded line: %s", expanded);
598 struct cmd_results *res; 598 struct cmd_results *res;
599 if (block && strcmp(block, "<commands>") == 0) { 599 if (block && strcmp(block, "<commands>") == 0) {
600 // Special case 600 // Special case
@@ -606,23 +606,23 @@ bool read_config(FILE *file, struct sway_config *config) {
606 switch(res->status) { 606 switch(res->status) {
607 case CMD_FAILURE: 607 case CMD_FAILURE:
608 case CMD_INVALID: 608 case CMD_INVALID:
609 wlr_log(L_ERROR, "Error on line %i '%s': %s (%s)", line_number, 609 wlr_log(WLR_ERROR, "Error on line %i '%s': %s (%s)", line_number,
610 line, res->error, config->current_config); 610 line, res->error, config->current_config);
611 success = false; 611 success = false;
612 break; 612 break;
613 613
614 case CMD_DEFER: 614 case CMD_DEFER:
615 wlr_log(L_DEBUG, "Deferring command `%s'", line); 615 wlr_log(WLR_DEBUG, "Deferring command `%s'", line);
616 list_add(config->cmd_queue, strdup(line)); 616 list_add(config->cmd_queue, strdup(line));
617 break; 617 break;
618 618
619 case CMD_BLOCK_COMMANDS: 619 case CMD_BLOCK_COMMANDS:
620 wlr_log(L_DEBUG, "Entering commands block"); 620 wlr_log(WLR_DEBUG, "Entering commands block");
621 list_insert(stack, 0, "<commands>"); 621 list_insert(stack, 0, "<commands>");
622 break; 622 break;
623 623
624 case CMD_BLOCK: 624 case CMD_BLOCK:
625 wlr_log(L_DEBUG, "Entering block '%s'", res->input); 625 wlr_log(WLR_DEBUG, "Entering block '%s'", res->input);
626 list_insert(stack, 0, strdup(res->input)); 626 list_insert(stack, 0, strdup(res->input));
627 if (strcmp(res->input, "bar") == 0) { 627 if (strcmp(res->input, "bar") == 0) {
628 config->current_bar = NULL; 628 config->current_bar = NULL;
@@ -631,7 +631,7 @@ bool read_config(FILE *file, struct sway_config *config) {
631 631
632 case CMD_BLOCK_END: 632 case CMD_BLOCK_END:
633 if (!block) { 633 if (!block) {
634 wlr_log(L_DEBUG, "Unmatched '}' on line %i", line_number); 634 wlr_log(WLR_DEBUG, "Unmatched '}' on line %i", line_number);
635 success = false; 635 success = false;
636 break; 636 break;
637 } 637 }
@@ -639,7 +639,7 @@ bool read_config(FILE *file, struct sway_config *config) {
639 config->current_bar = NULL; 639 config->current_bar = NULL;
640 } 640 }
641 641
642 wlr_log(L_DEBUG, "Exiting block '%s'", block); 642 wlr_log(WLR_DEBUG, "Exiting block '%s'", block);
643 list_del(stack, 0); 643 list_del(stack, 0);
644 free(block); 644 free(block);
645 memset(&config->handler_context, 0, 645 memset(&config->handler_context, 0,
@@ -682,7 +682,7 @@ char *do_var_replacement(char *str) {
682 int vvlen = strlen(var->value); 682 int vvlen = strlen(var->value);
683 char *newstr = malloc(strlen(str) - vnlen + vvlen + 1); 683 char *newstr = malloc(strlen(str) - vnlen + vvlen + 1);
684 if (!newstr) { 684 if (!newstr) {
685 wlr_log(L_ERROR, 685 wlr_log(WLR_ERROR,
686 "Unable to allocate replacement " 686 "Unable to allocate replacement "
687 "during variable expansion"); 687 "during variable expansion");
688 break; 688 break;
diff --git a/sway/config/bar.c b/sway/config/bar.c
index ee062c6a..3a74331e 100644
--- a/sway/config/bar.c
+++ b/sway/config/bar.c
@@ -16,10 +16,10 @@
16#include "log.h" 16#include "log.h"
17 17
18static void terminate_swaybar(pid_t pid) { 18static void terminate_swaybar(pid_t pid) {
19 wlr_log(L_DEBUG, "Terminating swaybar %d", pid); 19 wlr_log(WLR_DEBUG, "Terminating swaybar %d", pid);
20 int ret = kill(-pid, SIGTERM); 20 int ret = kill(-pid, SIGTERM);
21 if (ret != 0) { 21 if (ret != 0) {
22 wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid); 22 wlr_log_errno(WLR_ERROR, "Unable to terminate swaybar %d", pid);
23 } else { 23 } else {
24 int status; 24 int status;
25 waitpid(pid, &status, 0); 25 waitpid(pid, &status, 0);
@@ -167,7 +167,7 @@ void invoke_swaybar(struct bar_config *bar) {
167 // Pipe to communicate errors 167 // Pipe to communicate errors
168 int filedes[2]; 168 int filedes[2];
169 if (pipe(filedes) == -1) { 169 if (pipe(filedes) == -1) {
170 wlr_log(L_ERROR, "Pipe setup failed! Cannot fork into bar"); 170 wlr_log(WLR_ERROR, "Pipe setup failed! Cannot fork into bar");
171 return; 171 return;
172 } 172 }
173 173
@@ -197,17 +197,17 @@ void invoke_swaybar(struct bar_config *bar) {
197 execvp(cmd[0], cmd); 197 execvp(cmd[0], cmd);
198 exit(1); 198 exit(1);
199 } 199 }
200 wlr_log(L_DEBUG, "Spawned swaybar %d", bar->pid); 200 wlr_log(WLR_DEBUG, "Spawned swaybar %d", bar->pid);
201 close(filedes[0]); 201 close(filedes[0]);
202 size_t len; 202 size_t len;
203 if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { 203 if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) {
204 char *buf = malloc(len); 204 char *buf = malloc(len);
205 if(!buf) { 205 if(!buf) {
206 wlr_log(L_ERROR, "Cannot allocate error string"); 206 wlr_log(WLR_ERROR, "Cannot allocate error string");
207 return; 207 return;
208 } 208 }
209 if (read(filedes[1], buf, len)) { 209 if (read(filedes[1], buf, len)) {
210 wlr_log(L_ERROR, "%s", buf); 210 wlr_log(WLR_ERROR, "%s", buf);
211 } 211 }
212 free(buf); 212 free(buf);
213 } 213 }
@@ -244,7 +244,7 @@ void load_swaybars() {
244 if (bar->pid != 0) { 244 if (bar->pid != 0) {
245 terminate_swaybar(bar->pid); 245 terminate_swaybar(bar->pid);
246 } 246 }
247 wlr_log(L_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); 247 wlr_log(WLR_DEBUG, "Invoking swaybar for bar id '%s'", bar->id);
248 invoke_swaybar(bar); 248 invoke_swaybar(bar);
249 } 249 }
250 } 250 }
diff --git a/sway/config/input.c b/sway/config/input.c
index 17303ccc..9840df18 100644
--- a/sway/config/input.c
+++ b/sway/config/input.c
@@ -8,13 +8,13 @@
8struct input_config *new_input_config(const char* identifier) { 8struct input_config *new_input_config(const char* identifier) {
9 struct input_config *input = calloc(1, sizeof(struct input_config)); 9 struct input_config *input = calloc(1, sizeof(struct input_config));
10 if (!input) { 10 if (!input) {
11 wlr_log(L_DEBUG, "Unable to allocate input config"); 11 wlr_log(WLR_DEBUG, "Unable to allocate input config");
12 return NULL; 12 return NULL;
13 } 13 }
14 wlr_log(L_DEBUG, "new_input_config(%s)", identifier); 14 wlr_log(WLR_DEBUG, "new_input_config(%s)", identifier);
15 if (!(input->identifier = strdup(identifier))) { 15 if (!(input->identifier = strdup(identifier))) {
16 free(input); 16 free(input);
17 wlr_log(L_DEBUG, "Unable to allocate input config"); 17 wlr_log(WLR_DEBUG, "Unable to allocate input config");
18 return NULL; 18 return NULL;
19 } 19 }
20 20
@@ -112,7 +112,7 @@ void merge_input_config(struct input_config *dst, struct input_config *src) {
112struct input_config *copy_input_config(struct input_config *ic) { 112struct input_config *copy_input_config(struct input_config *ic) {
113 struct input_config *copy = calloc(1, sizeof(struct input_config)); 113 struct input_config *copy = calloc(1, sizeof(struct input_config));
114 if (copy == NULL) { 114 if (copy == NULL) {
115 wlr_log(L_ERROR, "could not allocate input config"); 115 wlr_log(WLR_ERROR, "could not allocate input config");
116 return NULL; 116 return NULL;
117 } 117 }
118 merge_input_config(copy, ic); 118 merge_input_config(copy, ic);
diff --git a/sway/config/output.c b/sway/config/output.c
index 648ded27..205e2633 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -90,7 +90,7 @@ static void set_mode(struct wlr_output *output, int width, int height,
90 float refresh_rate) { 90 float refresh_rate) {
91 int mhz = (int)(refresh_rate * 1000); 91 int mhz = (int)(refresh_rate * 1000);
92 if (wl_list_empty(&output->modes)) { 92 if (wl_list_empty(&output->modes)) {
93 wlr_log(L_DEBUG, "Assigning custom mode to %s", output->name); 93 wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name);
94 wlr_output_set_custom_mode(output, width, height, mhz); 94 wlr_output_set_custom_mode(output, width, height, mhz);
95 return; 95 return;
96 } 96 }
@@ -106,9 +106,9 @@ static void set_mode(struct wlr_output *output, int width, int height,
106 } 106 }
107 } 107 }
108 if (!best) { 108 if (!best) {
109 wlr_log(L_ERROR, "Configured mode for %s not available", output->name); 109 wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name);
110 } else { 110 } else {
111 wlr_log(L_DEBUG, "Assigning configured mode to %s", output->name); 111 wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name);
112 wlr_output_set_mode(output, best); 112 wlr_output_set_mode(output, best);
113 } 113 }
114} 114}
@@ -116,7 +116,7 @@ static void set_mode(struct wlr_output *output, int width, int height,
116void terminate_swaybg(pid_t pid) { 116void terminate_swaybg(pid_t pid) {
117 int ret = kill(pid, SIGTERM); 117 int ret = kill(pid, SIGTERM);
118 if (ret != 0) { 118 if (ret != 0) {
119 wlr_log(L_ERROR, "Unable to terminate swaybg [pid: %d]", pid); 119 wlr_log(WLR_ERROR, "Unable to terminate swaybg [pid: %d]", pid);
120 } else { 120 } else {
121 int status; 121 int status;
122 waitpid(pid, &status, 0); 122 waitpid(pid, &status, 0);
@@ -144,22 +144,22 @@ void apply_output_config(struct output_config *oc, struct sway_container *output
144 } 144 }
145 145
146 if (oc && oc->width > 0 && oc->height > 0) { 146 if (oc && oc->width > 0 && oc->height > 0) {
147 wlr_log(L_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, 147 wlr_log(WLR_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width,
148 oc->height, oc->refresh_rate); 148 oc->height, oc->refresh_rate);
149 set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); 149 set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate);
150 } 150 }
151 if (oc && oc->scale > 0) { 151 if (oc && oc->scale > 0) {
152 wlr_log(L_DEBUG, "Set %s scale to %f", oc->name, oc->scale); 152 wlr_log(WLR_DEBUG, "Set %s scale to %f", oc->name, oc->scale);
153 wlr_output_set_scale(wlr_output, oc->scale); 153 wlr_output_set_scale(wlr_output, oc->scale);
154 } 154 }
155 if (oc && oc->transform >= 0) { 155 if (oc && oc->transform >= 0) {
156 wlr_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform); 156 wlr_log(WLR_DEBUG, "Set %s transform to %d", oc->name, oc->transform);
157 wlr_output_set_transform(wlr_output, oc->transform); 157 wlr_output_set_transform(wlr_output, oc->transform);
158 } 158 }
159 159
160 // Find position for it 160 // Find position for it
161 if (oc && (oc->x != -1 || oc->y != -1)) { 161 if (oc && (oc->x != -1 || oc->y != -1)) {
162 wlr_log(L_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); 162 wlr_log(WLR_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y);
163 wlr_output_layout_add(output_layout, wlr_output, oc->x, oc->y); 163 wlr_output_layout_add(output_layout, wlr_output, oc->x, oc->y);
164 } else { 164 } else {
165 wlr_output_layout_add_auto(output_layout, wlr_output); 165 wlr_output_layout_add_auto(output_layout, wlr_output);
@@ -187,7 +187,7 @@ void apply_output_config(struct output_config *oc, struct sway_container *output
187 terminate_swaybg(output->sway_output->bg_pid); 187 terminate_swaybg(output->sway_output->bg_pid);
188 } 188 }
189 189
190 wlr_log(L_DEBUG, "Setting background for output %d to %s", 190 wlr_log(WLR_DEBUG, "Setting background for output %d to %s",
191 output_i, oc->background); 191 output_i, oc->background);
192 192
193 size_t len = snprintf(NULL, 0, "%s %d %s %s", 193 size_t len = snprintf(NULL, 0, "%s %d %s %s",
@@ -195,13 +195,13 @@ void apply_output_config(struct output_config *oc, struct sway_container *output
195 output_i, oc->background, oc->background_option); 195 output_i, oc->background, oc->background_option);
196 char *command = malloc(len + 1); 196 char *command = malloc(len + 1);
197 if (!command) { 197 if (!command) {
198 wlr_log(L_DEBUG, "Unable to allocate swaybg command"); 198 wlr_log(WLR_DEBUG, "Unable to allocate swaybg command");
199 return; 199 return;
200 } 200 }
201 snprintf(command, len + 1, "%s %d %s %s", 201 snprintf(command, len + 1, "%s %d %s %s",
202 config->swaybg_command ? config->swaybg_command : "swaybg", 202 config->swaybg_command ? config->swaybg_command : "swaybg",
203 output_i, oc->background, oc->background_option); 203 output_i, oc->background, oc->background_option);
204 wlr_log(L_DEBUG, "-> %s", command); 204 wlr_log(WLR_DEBUG, "-> %s", command);
205 205
206 char *const cmd[] = { "sh", "-c", command, NULL }; 206 char *const cmd[] = { "sh", "-c", command, NULL };
207 output->sway_output->bg_pid = fork(); 207 output->sway_output->bg_pid = fork();
@@ -212,11 +212,11 @@ void apply_output_config(struct output_config *oc, struct sway_container *output
212 if (oc && oc->dpms_state != DPMS_IGNORE) { 212 if (oc && oc->dpms_state != DPMS_IGNORE) {
213 switch (oc->dpms_state) { 213 switch (oc->dpms_state) {
214 case DPMS_ON: 214 case DPMS_ON:
215 wlr_log(L_DEBUG, "Turning on screen"); 215 wlr_log(WLR_DEBUG, "Turning on screen");
216 wlr_output_enable(wlr_output, true); 216 wlr_output_enable(wlr_output, true);
217 break; 217 break;
218 case DPMS_OFF: 218 case DPMS_OFF:
219 wlr_log(L_DEBUG, "Turning off screen"); 219 wlr_log(WLR_DEBUG, "Turning off screen");
220 wlr_output_enable(wlr_output, false); 220 wlr_output_enable(wlr_output, false);
221 break; 221 break;
222 case DPMS_IGNORE: 222 case DPMS_IGNORE:
diff --git a/sway/config/seat.c b/sway/config/seat.c
index bd8b45c8..83dac4c0 100644
--- a/sway/config/seat.c
+++ b/sway/config/seat.c
@@ -7,11 +7,11 @@
7struct seat_config *new_seat_config(const char* name) { 7struct seat_config *new_seat_config(const char* name) {
8 struct seat_config *seat = calloc(1, sizeof(struct seat_config)); 8 struct seat_config *seat = calloc(1, sizeof(struct seat_config));
9 if (!seat) { 9 if (!seat) {
10 wlr_log(L_DEBUG, "Unable to allocate seat config"); 10 wlr_log(WLR_DEBUG, "Unable to allocate seat config");
11 return NULL; 11 return NULL;
12 } 12 }
13 13
14 wlr_log(L_DEBUG, "new_seat_config(%s)", name); 14 wlr_log(WLR_DEBUG, "new_seat_config(%s)", name);
15 seat->name = strdup(name); 15 seat->name = strdup(name);
16 if (!sway_assert(seat->name, "could not allocate name for seat")) { 16 if (!sway_assert(seat->name, "could not allocate name for seat")) {
17 free(seat); 17 free(seat);
@@ -34,7 +34,7 @@ struct seat_attachment_config *seat_attachment_config_new() {
34 struct seat_attachment_config *attachment = 34 struct seat_attachment_config *attachment =
35 calloc(1, sizeof(struct seat_attachment_config)); 35 calloc(1, sizeof(struct seat_attachment_config));
36 if (!attachment) { 36 if (!attachment) {
37 wlr_log(L_DEBUG, "cannot allocate attachment config"); 37 wlr_log(WLR_DEBUG, "cannot allocate attachment config");
38 return NULL; 38 return NULL;
39 } 39 }
40 return attachment; 40 return attachment;
diff --git a/sway/criteria.c b/sway/criteria.c
index d9f09ecc..29a3668b 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -507,7 +507,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
507 } 507 }
508 unescape(value); 508 unescape(value);
509 } 509 }
510 wlr_log(L_DEBUG, "Found pair: %s=%s", name, value); 510 wlr_log(WLR_DEBUG, "Found pair: %s=%s", name, value);
511 if (!parse_token(criteria, name, value)) { 511 if (!parse_token(criteria, name, value)) {
512 *error_arg = error; 512 *error_arg = error;
513 goto cleanup; 513 goto cleanup;
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c
index c02ca26e..108a8417 100644
--- a/sway/desktop/idle_inhibit_v1.c
+++ b/sway/desktop/idle_inhibit_v1.c
@@ -9,7 +9,7 @@
9static void handle_destroy(struct wl_listener *listener, void *data) { 9static void handle_destroy(struct wl_listener *listener, void *data) {
10 struct sway_idle_inhibitor_v1 *inhibitor = 10 struct sway_idle_inhibitor_v1 *inhibitor =
11 wl_container_of(listener, inhibitor, destroy); 11 wl_container_of(listener, inhibitor, destroy);
12 wlr_log(L_DEBUG, "Sway idle inhibitor destroyed"); 12 wlr_log(WLR_DEBUG, "Sway idle inhibitor destroyed");
13 wl_list_remove(&inhibitor->link); 13 wl_list_remove(&inhibitor->link);
14 wl_list_remove(&inhibitor->destroy.link); 14 wl_list_remove(&inhibitor->destroy.link);
15 idle_inhibit_v1_check_active(inhibitor->manager); 15 idle_inhibit_v1_check_active(inhibitor->manager);
@@ -20,7 +20,7 @@ void handle_idle_inhibitor_v1(struct wl_listener *listener, void *data) {
20 struct wlr_idle_inhibitor_v1 *wlr_inhibitor = data; 20 struct wlr_idle_inhibitor_v1 *wlr_inhibitor = data;
21 struct sway_idle_inhibit_manager_v1 *manager = 21 struct sway_idle_inhibit_manager_v1 *manager =
22 wl_container_of(listener, manager, new_idle_inhibitor_v1); 22 wl_container_of(listener, manager, new_idle_inhibitor_v1);
23 wlr_log(L_DEBUG, "New sway idle inhibitor"); 23 wlr_log(WLR_DEBUG, "New sway idle inhibitor");
24 24
25 struct sway_idle_inhibitor_v1 *inhibitor = 25 struct sway_idle_inhibitor_v1 *inhibitor =
26 calloc(1, sizeof(struct sway_idle_inhibitor_v1)); 26 calloc(1, sizeof(struct sway_idle_inhibitor_v1));
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index de1fe349..16910c7e 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -174,7 +174,7 @@ void arrange_layers(struct sway_output *output) {
174 174
175 if (memcmp(&usable_area, &output->usable_area, 175 if (memcmp(&usable_area, &output->usable_area,
176 sizeof(struct wlr_box)) != 0) { 176 sizeof(struct wlr_box)) != 0) {
177 wlr_log(L_DEBUG, "Usable area changed, rearranging output"); 177 wlr_log(WLR_DEBUG, "Usable area changed, rearranging output");
178 memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); 178 memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box));
179 arrange_and_commit(output->swayc); 179 arrange_and_commit(output->swayc);
180 } 180 }
@@ -269,7 +269,7 @@ static void unmap(struct sway_layer_surface *sway_layer) {
269static void handle_destroy(struct wl_listener *listener, void *data) { 269static void handle_destroy(struct wl_listener *listener, void *data) {
270 struct sway_layer_surface *sway_layer = 270 struct sway_layer_surface *sway_layer =
271 wl_container_of(listener, sway_layer, destroy); 271 wl_container_of(listener, sway_layer, destroy);
272 wlr_log(L_DEBUG, "Layer surface destroyed (%s)", 272 wlr_log(WLR_DEBUG, "Layer surface destroyed (%s)",
273 sway_layer->layer_surface->namespace); 273 sway_layer->layer_surface->namespace);
274 if (sway_layer->layer_surface->mapped) { 274 if (sway_layer->layer_surface->mapped) {
275 unmap(sway_layer); 275 unmap(sway_layer);
@@ -316,7 +316,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
316 struct wlr_layer_surface *layer_surface = data; 316 struct wlr_layer_surface *layer_surface = data;
317 struct sway_server *server = 317 struct sway_server *server =
318 wl_container_of(listener, server, layer_shell_surface); 318 wl_container_of(listener, server, layer_shell_surface);
319 wlr_log(L_DEBUG, "new layer surface: namespace %s layer %d anchor %d " 319 wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d "
320 "size %dx%d margin %d,%d,%d,%d", 320 "size %dx%d margin %d,%d,%d,%d",
321 layer_surface->namespace, layer_surface->layer, layer_surface->layer, 321 layer_surface->namespace, layer_surface->layer, layer_surface->layer,
322 layer_surface->client_pending.desired_width, 322 layer_surface->client_pending.desired_width,
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 8b50bc44..73108450 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -525,7 +525,7 @@ struct sway_output *output_from_wlr_output(struct wlr_output *wlr_output) {
525void handle_new_output(struct wl_listener *listener, void *data) { 525void handle_new_output(struct wl_listener *listener, void *data) {
526 struct sway_server *server = wl_container_of(listener, server, new_output); 526 struct sway_server *server = wl_container_of(listener, server, new_output);
527 struct wlr_output *wlr_output = data; 527 struct wlr_output *wlr_output = data;
528 wlr_log(L_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); 528 wlr_log(WLR_DEBUG, "New output %p: %s", wlr_output, wlr_output->name);
529 529
530 struct sway_output *output = calloc(1, sizeof(struct sway_output)); 530 struct sway_output *output = calloc(1, sizeof(struct sway_output));
531 if (!output) { 531 if (!output) {
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 179af617..2b3f87c3 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -175,7 +175,7 @@ void transaction_add_container(struct sway_transaction *transaction,
175 * Apply a transaction to the "current" state of the tree. 175 * Apply a transaction to the "current" state of the tree.
176 */ 176 */
177static void transaction_apply(struct sway_transaction *transaction) { 177static void transaction_apply(struct sway_transaction *transaction) {
178 wlr_log(L_DEBUG, "Applying transaction %p", transaction); 178 wlr_log(WLR_DEBUG, "Applying transaction %p", transaction);
179 if (server.debug_txn_timings) { 179 if (server.debug_txn_timings) {
180 struct timespec now; 180 struct timespec now;
181 clock_gettime(CLOCK_MONOTONIC, &now); 181 clock_gettime(CLOCK_MONOTONIC, &now);
@@ -186,7 +186,7 @@ static void transaction_apply(struct sway_transaction *transaction) {
186 float ms_waiting = (now.tv_sec - commit->tv_sec) * 1000 + 186 float ms_waiting = (now.tv_sec - commit->tv_sec) * 1000 +
187 (now.tv_nsec - commit->tv_nsec) / 1000000.0; 187 (now.tv_nsec - commit->tv_nsec) / 1000000.0;
188 float ms_total = ms_arranging + ms_waiting; 188 float ms_total = ms_arranging + ms_waiting;
189 wlr_log(L_DEBUG, "Transaction %p: %.1fms arranging, %.1fms waiting, " 189 wlr_log(WLR_DEBUG, "Transaction %p: %.1fms arranging, %.1fms waiting, "
190 "%.1fms total (%.1f frames if 60Hz)", transaction, 190 "%.1fms total (%.1f frames if 60Hz)", transaction,
191 ms_arranging, ms_waiting, ms_total, ms_total / (1000.0f / 60)); 191 ms_arranging, ms_waiting, ms_total, ms_total / (1000.0f / 60));
192 } 192 }
@@ -251,7 +251,7 @@ static void transaction_progress_queue() {
251 251
252static int handle_timeout(void *data) { 252static int handle_timeout(void *data) {
253 struct sway_transaction *transaction = data; 253 struct sway_transaction *transaction = data;
254 wlr_log(L_DEBUG, "Transaction %p timed out (%li waiting)", 254 wlr_log(WLR_DEBUG, "Transaction %p timed out (%li waiting)",
255 transaction, transaction->num_waiting); 255 transaction, transaction->num_waiting);
256 transaction->num_waiting = 0; 256 transaction->num_waiting = 0;
257 transaction_progress_queue(); 257 transaction_progress_queue();
@@ -286,7 +286,7 @@ static bool should_configure(struct sway_container *con,
286} 286}
287 287
288void transaction_commit(struct sway_transaction *transaction) { 288void transaction_commit(struct sway_transaction *transaction) {
289 wlr_log(L_DEBUG, "Transaction %p committing with %i instructions", 289 wlr_log(WLR_DEBUG, "Transaction %p committing with %i instructions",
290 transaction, transaction->instructions->length); 290 transaction, transaction->instructions->length);
291 transaction->num_waiting = 0; 291 transaction->num_waiting = 0;
292 for (int i = 0; i < transaction->instructions->length; ++i) { 292 for (int i = 0; i < transaction->instructions->length; ++i) {
@@ -319,7 +319,7 @@ void transaction_commit(struct sway_transaction *transaction) {
319 } else { 319 } else {
320 // There are no other transactions in progress, and this one has nothing 320 // There are no other transactions in progress, and this one has nothing
321 // to wait for, so we can skip the queue. 321 // to wait for, so we can skip the queue.
322 wlr_log(L_DEBUG, "Transaction %p has nothing to wait for", transaction); 322 wlr_log(WLR_DEBUG, "Transaction %p has nothing to wait for", transaction);
323 transaction_apply(transaction); 323 transaction_apply(transaction);
324 transaction_destroy(transaction); 324 transaction_destroy(transaction);
325 idle_inhibit_v1_check_active(server.idle_inhibit_manager_v1); 325 idle_inhibit_v1_check_active(server.idle_inhibit_manager_v1);
@@ -350,7 +350,7 @@ static void set_instruction_ready(
350 struct timespec *start = &transaction->commit_time; 350 struct timespec *start = &transaction->commit_time;
351 float ms = (now.tv_sec - start->tv_sec) * 1000 + 351 float ms = (now.tv_sec - start->tv_sec) * 1000 +
352 (now.tv_nsec - start->tv_nsec) / 1000000.0; 352 (now.tv_nsec - start->tv_nsec) / 1000000.0;
353 wlr_log(L_DEBUG, "Transaction %p: %li/%li ready in %.1fms (%s)", 353 wlr_log(WLR_DEBUG, "Transaction %p: %li/%li ready in %.1fms (%s)",
354 transaction, 354 transaction,
355 transaction->num_configures - transaction->num_waiting + 1, 355 transaction->num_configures - transaction->num_waiting + 1,
356 transaction->num_configures, ms, 356 transaction->num_configures, ms,
@@ -362,7 +362,7 @@ static void set_instruction_ready(
362 // If the transaction has timed out then its num_waiting will be 0 already. 362 // If the transaction has timed out then its num_waiting will be 0 already.
363 if (transaction->num_waiting > 0 && --transaction->num_waiting == 0) { 363 if (transaction->num_waiting > 0 && --transaction->num_waiting == 0) {
364#if !TRANSACTION_DEBUG 364#if !TRANSACTION_DEBUG
365 wlr_log(L_DEBUG, "Transaction %p is ready", transaction); 365 wlr_log(WLR_DEBUG, "Transaction %p is ready", transaction);
366 wl_event_source_timer_update(transaction->timer, 0); 366 wl_event_source_timer_update(transaction->timer, 0);
367 transaction_progress_queue(); 367 transaction_progress_queue();
368#endif 368#endif
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index ac35a8d1..be14adbe 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -304,11 +304,11 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) {
304 struct wlr_xdg_surface *xdg_surface = data; 304 struct wlr_xdg_surface *xdg_surface = data;
305 305
306 if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { 306 if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
307 wlr_log(L_DEBUG, "New xdg_shell popup"); 307 wlr_log(WLR_DEBUG, "New xdg_shell popup");
308 return; 308 return;
309 } 309 }
310 310
311 wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'", 311 wlr_log(WLR_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'",
312 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); 312 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
313 wlr_xdg_surface_ping(xdg_surface); 313 wlr_xdg_surface_ping(xdg_surface);
314 314
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 56bbb244..f5cf085a 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -295,11 +295,11 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
295 struct wlr_xdg_surface_v6 *xdg_surface = data; 295 struct wlr_xdg_surface_v6 *xdg_surface = data;
296 296
297 if (xdg_surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { 297 if (xdg_surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) {
298 wlr_log(L_DEBUG, "New xdg_shell_v6 popup"); 298 wlr_log(WLR_DEBUG, "New xdg_shell_v6 popup");
299 return; 299 return;
300 } 300 }
301 301
302 wlr_log(L_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'", 302 wlr_log(WLR_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'",
303 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); 303 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
304 wlr_xdg_surface_v6_ping(xdg_surface); 304 wlr_xdg_surface_v6_ping(xdg_surface);
305 305
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index b2874cfe..4e5cea7d 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -119,7 +119,7 @@ static struct sway_xwayland_unmanaged *create_unmanaged(
119 struct sway_xwayland_unmanaged *surface = 119 struct sway_xwayland_unmanaged *surface =
120 calloc(1, sizeof(struct sway_xwayland_unmanaged)); 120 calloc(1, sizeof(struct sway_xwayland_unmanaged));
121 if (surface == NULL) { 121 if (surface == NULL) {
122 wlr_log(L_ERROR, "Allocation failed"); 122 wlr_log(WLR_ERROR, "Allocation failed");
123 return NULL; 123 return NULL;
124 } 124 }
125 125
@@ -432,12 +432,12 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
432 432
433 if (wlr_xwayland_surface_is_unmanaged(xsurface) || 433 if (wlr_xwayland_surface_is_unmanaged(xsurface) ||
434 xsurface->override_redirect) { 434 xsurface->override_redirect) {
435 wlr_log(L_DEBUG, "New xwayland unmanaged surface"); 435 wlr_log(WLR_DEBUG, "New xwayland unmanaged surface");
436 create_unmanaged(xsurface); 436 create_unmanaged(xsurface);
437 return; 437 return;
438 } 438 }
439 439
440 wlr_log(L_DEBUG, "New xwayland surface title='%s' class='%s'", 440 wlr_log(WLR_DEBUG, "New xwayland surface title='%s' class='%s'",
441 xsurface->title, xsurface->class); 441 xsurface->title, xsurface->class);
442 442
443 struct sway_xwayland_view *xwayland_view = 443 struct sway_xwayland_view *xwayland_view =
@@ -490,7 +490,7 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) {
490 xcb_connection_t *xcb_conn = xcb_connect(NULL, NULL); 490 xcb_connection_t *xcb_conn = xcb_connect(NULL, NULL);
491 int err = xcb_connection_has_error(xcb_conn); 491 int err = xcb_connection_has_error(xcb_conn);
492 if (err) { 492 if (err) {
493 wlr_log(L_ERROR, "XCB connect failed: %d", err); 493 wlr_log(WLR_ERROR, "XCB connect failed: %d", err);
494 return; 494 return;
495 } 495 }
496 496
@@ -509,7 +509,7 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) {
509 free(reply); 509 free(reply);
510 510
511 if (error != NULL) { 511 if (error != NULL) {
512 wlr_log(L_ERROR, "could not resolve atom %s, X11 error code %d", 512 wlr_log(WLR_ERROR, "could not resolve atom %s, X11 error code %d",
513 atom_map[i], error->error_code); 513 atom_map[i], error->error_code);
514 free(error); 514 free(error);
515 break; 515 break;
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index a2f11557..307eedd4 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -474,7 +474,7 @@ static void handle_request_set_cursor(struct wl_listener *listener,
474 // TODO: check cursor mode 474 // TODO: check cursor mode
475 if (focused_client == NULL || 475 if (focused_client == NULL ||
476 event->seat_client->client != focused_client) { 476 event->seat_client->client != focused_client) {
477 wlr_log(L_DEBUG, "denying request to set cursor from unfocused client"); 477 wlr_log(WLR_DEBUG, "denying request to set cursor from unfocused client");
478 return; 478 return;
479 } 479 }
480 480
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
360void input_manager_apply_seat_config(struct sway_input_manager *input, 360void 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) {
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 182536de..580c0d4b 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -108,7 +108,7 @@ static void get_active_binding(const struct sway_shortcut_state *state,
108 } 108 }
109 109
110 if (*current_binding && *current_binding != binding) { 110 if (*current_binding && *current_binding != binding) {
111 wlr_log(L_DEBUG, "encountered duplicate bindings %d and %d", 111 wlr_log(WLR_DEBUG, "encountered duplicate bindings %d and %d",
112 (*current_binding)->order, binding->order); 112 (*current_binding)->order, binding->order);
113 } else { 113 } else {
114 *current_binding = binding; 114 *current_binding = binding;
@@ -122,12 +122,12 @@ static void get_active_binding(const struct sway_shortcut_state *state,
122 */ 122 */
123static void keyboard_execute_command(struct sway_keyboard *keyboard, 123static void keyboard_execute_command(struct sway_keyboard *keyboard,
124 struct sway_binding *binding) { 124 struct sway_binding *binding) {
125 wlr_log(L_DEBUG, "running command for binding: %s", 125 wlr_log(WLR_DEBUG, "running command for binding: %s",
126 binding->command); 126 binding->command);
127 config->handler_context.seat = keyboard->seat_device->sway_seat; 127 config->handler_context.seat = keyboard->seat_device->sway_seat;
128 struct cmd_results *results = execute_command(binding->command, NULL); 128 struct cmd_results *results = execute_command(binding->command, NULL);
129 if (results->status != CMD_SUCCESS) { 129 if (results->status != CMD_SUCCESS) {
130 wlr_log(L_DEBUG, "could not run command for binding: %s (%s)", 130 wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)",
131 binding->command, results->error); 131 binding->command, results->error);
132 } 132 }
133 free_cmd_results(results); 133 free_cmd_results(results);
@@ -386,7 +386,7 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
386 xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); 386 xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS);
387 387
388 if (!keymap) { 388 if (!keymap) {
389 wlr_log(L_DEBUG, "cannot configure keyboard: keymap does not exist"); 389 wlr_log(WLR_DEBUG, "cannot configure keyboard: keymap does not exist");
390 xkb_context_unref(context); 390 xkb_context_unref(context);
391 return; 391 return;
392 } 392 }
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 6c5abcd8..5dadb31d 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -75,7 +75,7 @@ static void seat_send_activate(struct sway_container *con,
75 struct sway_seat *seat) { 75 struct sway_seat *seat) {
76 if (con->type == C_VIEW) { 76 if (con->type == C_VIEW) {
77 if (!seat_is_input_allowed(seat, con->sway_view->surface)) { 77 if (!seat_is_input_allowed(seat, con->sway_view->surface)) {
78 wlr_log(L_DEBUG, "Refusing to set focus, input is inhibited"); 78 wlr_log(WLR_DEBUG, "Refusing to set focus, input is inhibited");
79 return; 79 return;
80 } 80 }
81 view_set_activated(con->sway_view, true); 81 view_set_activated(con->sway_view, true);
@@ -219,7 +219,7 @@ static struct sway_seat_container *seat_container_from_container(
219 219
220 seat_con = calloc(1, sizeof(struct sway_seat_container)); 220 seat_con = calloc(1, sizeof(struct sway_seat_container));
221 if (seat_con == NULL) { 221 if (seat_con == NULL) {
222 wlr_log(L_ERROR, "could not allocate seat container"); 222 wlr_log(WLR_ERROR, "could not allocate seat container");
223 return NULL; 223 return NULL;
224 } 224 }
225 225
@@ -301,7 +301,7 @@ static void handle_new_drag_icon(struct wl_listener *listener, void *data) {
301 301
302 struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon)); 302 struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon));
303 if (icon == NULL) { 303 if (icon == NULL) {
304 wlr_log(L_ERROR, "Allocation failed"); 304 wlr_log(WLR_ERROR, "Allocation failed");
305 return; 305 return;
306 } 306 }
307 icon->seat = seat; 307 icon->seat = seat;
@@ -391,7 +391,7 @@ static void seat_apply_input_config(struct sway_seat *seat,
391 struct input_config *ic = input_device_get_config( 391 struct input_config *ic = input_device_get_config(
392 sway_device->input_device); 392 sway_device->input_device);
393 if (ic != NULL) { 393 if (ic != NULL) {
394 wlr_log(L_DEBUG, "Applying input config to %s", 394 wlr_log(WLR_DEBUG, "Applying input config to %s",
395 sway_device->input_device->identifier); 395 sway_device->input_device->identifier);
396 396
397 mapped_to_output = ic->mapped_to_output; 397 mapped_to_output = ic->mapped_to_output;
@@ -401,7 +401,7 @@ static void seat_apply_input_config(struct sway_seat *seat,
401 mapped_to_output = sway_device->input_device->wlr_device->output_name; 401 mapped_to_output = sway_device->input_device->wlr_device->output_name;
402 } 402 }
403 if (mapped_to_output != NULL) { 403 if (mapped_to_output != NULL) {
404 wlr_log(L_DEBUG, "Mapping input device %s to output %s", 404 wlr_log(WLR_DEBUG, "Mapping input device %s to output %s",
405 sway_device->input_device->identifier, mapped_to_output); 405 sway_device->input_device->identifier, mapped_to_output);
406 struct sway_container *output = NULL; 406 struct sway_container *output = NULL;
407 for (int i = 0; i < root_container.children->length; ++i) { 407 for (int i = 0; i < root_container.children->length; ++i) {
@@ -415,7 +415,7 @@ static void seat_apply_input_config(struct sway_seat *seat,
415 wlr_cursor_map_input_to_output(seat->cursor->cursor, 415 wlr_cursor_map_input_to_output(seat->cursor->cursor,
416 sway_device->input_device->wlr_device, 416 sway_device->input_device->wlr_device,
417 output->sway_output->wlr_output); 417 output->sway_output->wlr_output);
418 wlr_log(L_DEBUG, "Mapped to output %s", output->name); 418 wlr_log(WLR_DEBUG, "Mapped to output %s", output->name);
419 } 419 }
420 } 420 }
421} 421}
@@ -495,7 +495,7 @@ void seat_configure_device(struct sway_seat *seat,
495 seat_configure_tablet_tool(seat, seat_device); 495 seat_configure_tablet_tool(seat, seat_device);
496 break; 496 break;
497 case WLR_INPUT_DEVICE_TABLET_PAD: 497 case WLR_INPUT_DEVICE_TABLET_PAD:
498 wlr_log(L_DEBUG, "TODO: configure tablet pad"); 498 wlr_log(WLR_DEBUG, "TODO: configure tablet pad");
499 break; 499 break;
500 } 500 }
501} 501}
@@ -510,11 +510,11 @@ void seat_add_device(struct sway_seat *seat,
510 struct sway_seat_device *seat_device = 510 struct sway_seat_device *seat_device =
511 calloc(1, sizeof(struct sway_seat_device)); 511 calloc(1, sizeof(struct sway_seat_device));
512 if (!seat_device) { 512 if (!seat_device) {
513 wlr_log(L_DEBUG, "could not allocate seat device"); 513 wlr_log(WLR_DEBUG, "could not allocate seat device");
514 return; 514 return;
515 } 515 }
516 516
517 wlr_log(L_DEBUG, "adding device %s to seat %s", 517 wlr_log(WLR_DEBUG, "adding device %s to seat %s",
518 input_device->identifier, seat->wlr_seat->name); 518 input_device->identifier, seat->wlr_seat->name);
519 519
520 seat_device->sway_seat = seat; 520 seat_device->sway_seat = seat;
@@ -533,7 +533,7 @@ void seat_remove_device(struct sway_seat *seat,
533 return; 533 return;
534 } 534 }
535 535
536 wlr_log(L_DEBUG, "removing device %s from seat %s", 536 wlr_log(WLR_DEBUG, "removing device %s from seat %s",
537 input_device->identifier, seat->wlr_seat->name); 537 input_device->identifier, seat->wlr_seat->name);
538 538
539 seat_device_destroy(seat_device); 539 seat_device_destroy(seat_device);
@@ -752,7 +752,7 @@ void seat_set_focus_layer(struct sway_seat *seat,
752 struct sway_container *previous = 752 struct sway_container *previous =
753 seat_get_focus_inactive(seat, &root_container); 753 seat_get_focus_inactive(seat, &root_container);
754 if (previous) { 754 if (previous) {
755 wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", previous, 755 wlr_log(WLR_DEBUG, "Returning focus to %p %s '%s'", previous,
756 container_type_to_str(previous->type), previous->name); 756 container_type_to_str(previous->type), previous->name);
757 // Hack to get seat to re-focus the return value of get_focus 757 // Hack to get seat to re-focus the return value of get_focus
758 seat_set_focus(seat, previous->parent); 758 seat_set_focus(seat, previous->parent);
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index abdaa237..197851cf 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -138,32 +138,32 @@ struct sockaddr_un *ipc_user_sockaddr(void) {
138int ipc_handle_connection(int fd, uint32_t mask, void *data) { 138int ipc_handle_connection(int fd, uint32_t mask, void *data) {
139 (void) fd; 139 (void) fd;
140 struct sway_server *server = data; 140 struct sway_server *server = data;
141 wlr_log(L_DEBUG, "Event on IPC listening socket"); 141 wlr_log(WLR_DEBUG, "Event on IPC listening socket");
142 assert(mask == WL_EVENT_READABLE); 142 assert(mask == WL_EVENT_READABLE);
143 143
144 int client_fd = accept(ipc_socket, NULL, NULL); 144 int client_fd = accept(ipc_socket, NULL, NULL);
145 if (client_fd == -1) { 145 if (client_fd == -1) {
146 wlr_log_errno(L_ERROR, "Unable to accept IPC client connection"); 146 wlr_log_errno(WLR_ERROR, "Unable to accept IPC client connection");
147 return 0; 147 return 0;
148 } 148 }
149 149
150 int flags; 150 int flags;
151 if ((flags = fcntl(client_fd, F_GETFD)) == -1 151 if ((flags = fcntl(client_fd, F_GETFD)) == -1
152 || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { 152 || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) {
153 wlr_log_errno(L_ERROR, "Unable to set CLOEXEC on IPC client socket"); 153 wlr_log_errno(WLR_ERROR, "Unable to set CLOEXEC on IPC client socket");
154 close(client_fd); 154 close(client_fd);
155 return 0; 155 return 0;
156 } 156 }
157 if ((flags = fcntl(client_fd, F_GETFL)) == -1 157 if ((flags = fcntl(client_fd, F_GETFL)) == -1
158 || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { 158 || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) {
159 wlr_log_errno(L_ERROR, "Unable to set NONBLOCK on IPC client socket"); 159 wlr_log_errno(WLR_ERROR, "Unable to set NONBLOCK on IPC client socket");
160 close(client_fd); 160 close(client_fd);
161 return 0; 161 return 0;
162 } 162 }
163 163
164 struct ipc_client *client = malloc(sizeof(struct ipc_client)); 164 struct ipc_client *client = malloc(sizeof(struct ipc_client));
165 if (!client) { 165 if (!client) {
166 wlr_log(L_ERROR, "Unable to allocate ipc client"); 166 wlr_log(WLR_ERROR, "Unable to allocate ipc client");
167 close(client_fd); 167 close(client_fd);
168 return 0; 168 return 0;
169 } 169 }
@@ -179,12 +179,12 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) {
179 client->write_buffer_len = 0; 179 client->write_buffer_len = 0;
180 client->write_buffer = malloc(client->write_buffer_size); 180 client->write_buffer = malloc(client->write_buffer_size);
181 if (!client->write_buffer) { 181 if (!client->write_buffer) {
182 wlr_log(L_ERROR, "Unable to allocate ipc client write buffer"); 182 wlr_log(WLR_ERROR, "Unable to allocate ipc client write buffer");
183 close(client_fd); 183 close(client_fd);
184 return 0; 184 return 0;
185 } 185 }
186 186
187 wlr_log(L_DEBUG, "New client: fd %d", client_fd); 187 wlr_log(WLR_DEBUG, "New client: fd %d", client_fd);
188 list_add(ipc_client_list, client); 188 list_add(ipc_client_list, client);
189 return 0; 189 return 0;
190} 190}
@@ -195,22 +195,22 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) {
195 struct ipc_client *client = data; 195 struct ipc_client *client = data;
196 196
197 if (mask & WL_EVENT_ERROR) { 197 if (mask & WL_EVENT_ERROR) {
198 wlr_log(L_ERROR, "IPC Client socket error, removing client"); 198 wlr_log(WLR_ERROR, "IPC Client socket error, removing client");
199 ipc_client_disconnect(client); 199 ipc_client_disconnect(client);
200 return 0; 200 return 0;
201 } 201 }
202 202
203 if (mask & WL_EVENT_HANGUP) { 203 if (mask & WL_EVENT_HANGUP) {
204 wlr_log(L_DEBUG, "Client %d hung up", client->fd); 204 wlr_log(WLR_DEBUG, "Client %d hung up", client->fd);
205 ipc_client_disconnect(client); 205 ipc_client_disconnect(client);
206 return 0; 206 return 0;
207 } 207 }
208 208
209 wlr_log(L_DEBUG, "Client %d readable", client->fd); 209 wlr_log(WLR_DEBUG, "Client %d readable", client->fd);
210 210
211 int read_available; 211 int read_available;
212 if (ioctl(client_fd, FIONREAD, &read_available) == -1) { 212 if (ioctl(client_fd, FIONREAD, &read_available) == -1) {
213 wlr_log_errno(L_INFO, "Unable to read IPC socket buffer size"); 213 wlr_log_errno(WLR_INFO, "Unable to read IPC socket buffer size");
214 ipc_client_disconnect(client); 214 ipc_client_disconnect(client);
215 return 0; 215 return 0;
216 } 216 }
@@ -232,13 +232,13 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) {
232 // Should be fully available, because read_available >= ipc_header_size 232 // Should be fully available, because read_available >= ipc_header_size
233 ssize_t received = recv(client_fd, buf, ipc_header_size, 0); 233 ssize_t received = recv(client_fd, buf, ipc_header_size, 0);
234 if (received == -1) { 234 if (received == -1) {
235 wlr_log_errno(L_INFO, "Unable to receive header from IPC client"); 235 wlr_log_errno(WLR_INFO, "Unable to receive header from IPC client");
236 ipc_client_disconnect(client); 236 ipc_client_disconnect(client);
237 return 0; 237 return 0;
238 } 238 }
239 239
240 if (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) { 240 if (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) {
241 wlr_log(L_DEBUG, "IPC header check failed"); 241 wlr_log(WLR_DEBUG, "IPC header check failed");
242 ipc_client_disconnect(client); 242 ipc_client_disconnect(client);
243 return 0; 243 return 0;
244 } 244 }
@@ -272,7 +272,7 @@ static void ipc_send_event(const char *json_string, enum ipc_command_type event)
272 } 272 }
273 client->current_command = event; 273 client->current_command = event;
274 if (!ipc_send_reply(client, json_string, (uint32_t) strlen(json_string))) { 274 if (!ipc_send_reply(client, json_string, (uint32_t) strlen(json_string))) {
275 wlr_log_errno(L_INFO, "Unable to send reply to IPC client"); 275 wlr_log_errno(WLR_INFO, "Unable to send reply to IPC client");
276 /* ipc_send_reply destroys client on error, which also 276 /* ipc_send_reply destroys client on error, which also
277 * removes it from the list, so we need to process 277 * removes it from the list, so we need to process
278 * current index again */ 278 * current index again */
@@ -286,7 +286,7 @@ void ipc_event_workspace(struct sway_container *old,
286 if (!ipc_has_event_listeners(IPC_EVENT_WORKSPACE)) { 286 if (!ipc_has_event_listeners(IPC_EVENT_WORKSPACE)) {
287 return; 287 return;
288 } 288 }
289 wlr_log(L_DEBUG, "Sending workspace::%s event", change); 289 wlr_log(WLR_DEBUG, "Sending workspace::%s event", change);
290 json_object *obj = json_object_new_object(); 290 json_object *obj = json_object_new_object();
291 json_object_object_add(obj, "change", json_object_new_string(change)); 291 json_object_object_add(obj, "change", json_object_new_string(change));
292 if (strcmp("focus", change) == 0) { 292 if (strcmp("focus", change) == 0) {
@@ -314,7 +314,7 @@ void ipc_event_window(struct sway_container *window, const char *change) {
314 if (!ipc_has_event_listeners(IPC_EVENT_WINDOW)) { 314 if (!ipc_has_event_listeners(IPC_EVENT_WINDOW)) {
315 return; 315 return;
316 } 316 }
317 wlr_log(L_DEBUG, "Sending window::%s event", change); 317 wlr_log(WLR_DEBUG, "Sending window::%s event", change);
318 json_object *obj = json_object_new_object(); 318 json_object *obj = json_object_new_object();
319 json_object_object_add(obj, "change", json_object_new_string(change)); 319 json_object_object_add(obj, "change", json_object_new_string(change));
320 json_object_object_add(obj, "container", ipc_json_describe_container_recursive(window)); 320 json_object_object_add(obj, "container", ipc_json_describe_container_recursive(window));
@@ -328,7 +328,7 @@ void ipc_event_barconfig_update(struct bar_config *bar) {
328 if (!ipc_has_event_listeners(IPC_EVENT_BARCONFIG_UPDATE)) { 328 if (!ipc_has_event_listeners(IPC_EVENT_BARCONFIG_UPDATE)) {
329 return; 329 return;
330 } 330 }
331 wlr_log(L_DEBUG, "Sending barconfig_update event"); 331 wlr_log(WLR_DEBUG, "Sending barconfig_update event");
332 json_object *json = ipc_json_describe_bar_config(bar); 332 json_object *json = ipc_json_describe_bar_config(bar);
333 333
334 const char *json_string = json_object_to_json_string(json); 334 const char *json_string = json_object_to_json_string(json);
@@ -340,7 +340,7 @@ void ipc_event_mode(const char *mode, bool pango) {
340 if (!ipc_has_event_listeners(IPC_EVENT_MODE)) { 340 if (!ipc_has_event_listeners(IPC_EVENT_MODE)) {
341 return; 341 return;
342 } 342 }
343 wlr_log(L_DEBUG, "Sending mode::%s event", mode); 343 wlr_log(WLR_DEBUG, "Sending mode::%s event", mode);
344 json_object *obj = json_object_new_object(); 344 json_object *obj = json_object_new_object();
345 json_object_object_add(obj, "change", json_object_new_string(mode)); 345 json_object_object_add(obj, "change", json_object_new_string(mode));
346 json_object_object_add(obj, "pango_markup", 346 json_object_object_add(obj, "pango_markup",
@@ -355,13 +355,13 @@ int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) {
355 struct ipc_client *client = data; 355 struct ipc_client *client = data;
356 356
357 if (mask & WL_EVENT_ERROR) { 357 if (mask & WL_EVENT_ERROR) {
358 wlr_log(L_ERROR, "IPC Client socket error, removing client"); 358 wlr_log(WLR_ERROR, "IPC Client socket error, removing client");
359 ipc_client_disconnect(client); 359 ipc_client_disconnect(client);
360 return 0; 360 return 0;
361 } 361 }
362 362
363 if (mask & WL_EVENT_HANGUP) { 363 if (mask & WL_EVENT_HANGUP) {
364 wlr_log(L_DEBUG, "Client %d hung up", client->fd); 364 wlr_log(WLR_DEBUG, "Client %d hung up", client->fd);
365 ipc_client_disconnect(client); 365 ipc_client_disconnect(client);
366 return 0; 366 return 0;
367 } 367 }
@@ -370,14 +370,14 @@ int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) {
370 return 0; 370 return 0;
371 } 371 }
372 372
373 wlr_log(L_DEBUG, "Client %d writable", client->fd); 373 wlr_log(WLR_DEBUG, "Client %d writable", client->fd);
374 374
375 ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); 375 ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len);
376 376
377 if (written == -1 && errno == EAGAIN) { 377 if (written == -1 && errno == EAGAIN) {
378 return 0; 378 return 0;
379 } else if (written == -1) { 379 } else if (written == -1) {
380 wlr_log_errno(L_INFO, "Unable to send data from queue to IPC client"); 380 wlr_log_errno(WLR_INFO, "Unable to send data from queue to IPC client");
381 ipc_client_disconnect(client); 381 ipc_client_disconnect(client);
382 return 0; 382 return 0;
383 } 383 }
@@ -400,7 +400,7 @@ void ipc_client_disconnect(struct ipc_client *client) {
400 400
401 shutdown(client->fd, SHUT_RDWR); 401 shutdown(client->fd, SHUT_RDWR);
402 402
403 wlr_log(L_INFO, "IPC Client %d disconnected", client->fd); 403 wlr_log(WLR_INFO, "IPC Client %d disconnected", client->fd);
404 wl_event_source_remove(client->event_source); 404 wl_event_source_remove(client->event_source);
405 if (client->writable_event_source) { 405 if (client->writable_event_source) {
406 wl_event_source_remove(client->writable_event_source); 406 wl_event_source_remove(client->writable_event_source);
@@ -461,7 +461,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
461 461
462 char *buf = malloc(client->payload_length + 1); 462 char *buf = malloc(client->payload_length + 1);
463 if (!buf) { 463 if (!buf) {
464 wlr_log_errno(L_INFO, "Unable to allocate IPC payload"); 464 wlr_log_errno(WLR_INFO, "Unable to allocate IPC payload");
465 ipc_client_disconnect(client); 465 ipc_client_disconnect(client);
466 return; 466 return;
467 } 467 }
@@ -470,7 +470,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
470 ssize_t received = recv(client->fd, buf, client->payload_length, 0); 470 ssize_t received = recv(client->fd, buf, client->payload_length, 0);
471 if (received == -1) 471 if (received == -1)
472 { 472 {
473 wlr_log_errno(L_INFO, "Unable to receive payload from IPC client"); 473 wlr_log_errno(WLR_INFO, "Unable to receive payload from IPC client");
474 ipc_client_disconnect(client); 474 ipc_client_disconnect(client);
475 free(buf); 475 free(buf);
476 return; 476 return;
@@ -533,7 +533,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
533 struct json_object *request = json_tokener_parse(buf); 533 struct json_object *request = json_tokener_parse(buf);
534 if (request == NULL) { 534 if (request == NULL) {
535 client_valid = ipc_send_reply(client, "{\"success\": false}", 18); 535 client_valid = ipc_send_reply(client, "{\"success\": false}", 18);
536 wlr_log_errno(L_INFO, "Failed to read request"); 536 wlr_log_errno(WLR_INFO, "Failed to read request");
537 goto exit_cleanup; 537 goto exit_cleanup;
538 } 538 }
539 539
@@ -556,7 +556,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
556 client_valid = 556 client_valid =
557 ipc_send_reply(client, "{\"success\": false}", 18); 557 ipc_send_reply(client, "{\"success\": false}", 18);
558 json_object_put(request); 558 json_object_put(request);
559 wlr_log_errno(L_INFO, "Failed to parse request"); 559 wlr_log_errno(WLR_INFO, "Failed to parse request");
560 goto exit_cleanup; 560 goto exit_cleanup;
561 } 561 }
562 } 562 }
@@ -668,7 +668,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
668 } 668 }
669 669
670 default: 670 default:
671 wlr_log(L_INFO, "Unknown IPC command type %i", client->current_command); 671 wlr_log(WLR_INFO, "Unknown IPC command type %i", client->current_command);
672 goto exit_cleanup; 672 goto exit_cleanup;
673 } 673 }
674 674
@@ -696,14 +696,14 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay
696 } 696 }
697 697
698 if (client->write_buffer_size > 4e6) { // 4 MB 698 if (client->write_buffer_size > 4e6) { // 4 MB
699 wlr_log(L_ERROR, "Client write buffer too big, disconnecting client"); 699 wlr_log(WLR_ERROR, "Client write buffer too big, disconnecting client");
700 ipc_client_disconnect(client); 700 ipc_client_disconnect(client);
701 return false; 701 return false;
702 } 702 }
703 703
704 char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); 704 char *new_buffer = realloc(client->write_buffer, client->write_buffer_size);
705 if (!new_buffer) { 705 if (!new_buffer) {
706 wlr_log(L_ERROR, "Unable to reallocate ipc client write buffer"); 706 wlr_log(WLR_ERROR, "Unable to reallocate ipc client write buffer");
707 ipc_client_disconnect(client); 707 ipc_client_disconnect(client);
708 return false; 708 return false;
709 } 709 }
@@ -720,6 +720,6 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay
720 ipc_client_handle_writable, client); 720 ipc_client_handle_writable, client);
721 } 721 }
722 722
723 wlr_log(L_DEBUG, "Added IPC reply to client %d queue: %s", client->fd, payload); 723 wlr_log(WLR_DEBUG, "Added IPC reply to client %d queue: %s", client->fd, payload);
724 return true; 724 return true;
725} 725}
diff --git a/sway/main.c b/sway/main.c
index ec7353be..c6453226 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -129,7 +129,7 @@ static void log_env() {
129 "SWAYSOCK" 129 "SWAYSOCK"
130 }; 130 };
131 for (size_t i = 0; i < sizeof(log_vars) / sizeof(char *); ++i) { 131 for (size_t i = 0; i < sizeof(log_vars) / sizeof(char *); ++i) {
132 wlr_log(L_INFO, "%s=%s", log_vars[i], getenv(log_vars[i])); 132 wlr_log(WLR_INFO, "%s=%s", log_vars[i], getenv(log_vars[i]));
133 } 133 }
134} 134}
135 135
@@ -144,14 +144,14 @@ static void log_distro() {
144 for (size_t i = 0; i < sizeof(paths) / sizeof(char *); ++i) { 144 for (size_t i = 0; i < sizeof(paths) / sizeof(char *); ++i) {
145 FILE *f = fopen(paths[i], "r"); 145 FILE *f = fopen(paths[i], "r");
146 if (f) { 146 if (f) {
147 wlr_log(L_INFO, "Contents of %s:", paths[i]); 147 wlr_log(WLR_INFO, "Contents of %s:", paths[i]);
148 while (!feof(f)) { 148 while (!feof(f)) {
149 char *line; 149 char *line;
150 if (!(line = read_line(f))) { 150 if (!(line = read_line(f))) {
151 break; 151 break;
152 } 152 }
153 if (*line) { 153 if (*line) {
154 wlr_log(L_INFO, "%s", line); 154 wlr_log(WLR_INFO, "%s", line);
155 } 155 }
156 free(line); 156 free(line);
157 } 157 }
@@ -163,7 +163,7 @@ static void log_distro() {
163static void log_kernel() { 163static void log_kernel() {
164 FILE *f = popen("uname -a", "r"); 164 FILE *f = popen("uname -a", "r");
165 if (!f) { 165 if (!f) {
166 wlr_log(L_INFO, "Unable to determine kernel version"); 166 wlr_log(WLR_INFO, "Unable to determine kernel version");
167 return; 167 return;
168 } 168 }
169 while (!feof(f)) { 169 while (!feof(f)) {
@@ -172,7 +172,7 @@ static void log_kernel() {
172 break; 172 break;
173 } 173 }
174 if (*line) { 174 if (*line) {
175 wlr_log(L_INFO, "%s", line); 175 wlr_log(WLR_INFO, "%s", line);
176 } 176 }
177 free(line); 177 free(line);
178 } 178 }
@@ -183,14 +183,14 @@ static void security_sanity_check() {
183 // TODO: Notify users visually if this has issues 183 // TODO: Notify users visually if this has issues
184 struct stat s; 184 struct stat s;
185 if (stat("/proc", &s)) { 185 if (stat("/proc", &s)) {
186 wlr_log(L_ERROR, 186 wlr_log(WLR_ERROR,
187 "!! DANGER !! /proc is not available - sway CANNOT enforce security rules!"); 187 "!! DANGER !! /proc is not available - sway CANNOT enforce security rules!");
188 } 188 }
189#ifdef __linux__ 189#ifdef __linux__
190 cap_flag_value_t v; 190 cap_flag_value_t v;
191 cap_t cap = cap_get_proc(); 191 cap_t cap = cap_get_proc();
192 if (!cap || cap_get_flag(cap, CAP_SYS_PTRACE, CAP_PERMITTED, &v) != 0 || v != CAP_SET) { 192 if (!cap || cap_get_flag(cap, CAP_SYS_PTRACE, CAP_PERMITTED, &v) != 0 || v != CAP_SET) {
193 wlr_log(L_ERROR, 193 wlr_log(WLR_ERROR,
194 "!! DANGER !! Sway does not have CAP_SYS_PTRACE and cannot enforce security rules for processes running as other users."); 194 "!! DANGER !! Sway does not have CAP_SYS_PTRACE and cannot enforce security rules for processes running as other users.");
195 } 195 }
196 if (cap) { 196 if (cap) {
@@ -206,13 +206,13 @@ static void executable_sanity_check() {
206 stat(exe, &sb); 206 stat(exe, &sb);
207 // We assume that cap_get_file returning NULL implies ENODATA 207 // We assume that cap_get_file returning NULL implies ENODATA
208 if (sb.st_mode & (S_ISUID|S_ISGID) && cap_get_file(exe)) { 208 if (sb.st_mode & (S_ISUID|S_ISGID) && cap_get_file(exe)) {
209 wlr_log(L_ERROR, 209 wlr_log(WLR_ERROR,
210 "sway executable has both the s(g)uid bit AND file caps set."); 210 "sway executable has both the s(g)uid bit AND file caps set.");
211 wlr_log(L_ERROR, 211 wlr_log(WLR_ERROR,
212 "This is strongly discouraged (and completely broken)."); 212 "This is strongly discouraged (and completely broken).");
213 wlr_log(L_ERROR, 213 wlr_log(WLR_ERROR,
214 "Please clear one of them (either the suid bit, or the file caps)."); 214 "Please clear one of them (either the suid bit, or the file caps).");
215 wlr_log(L_ERROR, 215 wlr_log(WLR_ERROR,
216 "If unsure, strip the file caps."); 216 "If unsure, strip the file caps.");
217 exit(EXIT_FAILURE); 217 exit(EXIT_FAILURE);
218 } 218 }
@@ -223,16 +223,16 @@ static void executable_sanity_check() {
223static void drop_permissions(bool keep_caps) { 223static void drop_permissions(bool keep_caps) {
224 if (getuid() != geteuid() || getgid() != getegid()) { 224 if (getuid() != geteuid() || getgid() != getegid()) {
225 if (setgid(getgid()) != 0) { 225 if (setgid(getgid()) != 0) {
226 wlr_log(L_ERROR, "Unable to drop root"); 226 wlr_log(WLR_ERROR, "Unable to drop root");
227 exit(EXIT_FAILURE); 227 exit(EXIT_FAILURE);
228 } 228 }
229 if (setuid(getuid()) != 0) { 229 if (setuid(getuid()) != 0) {
230 wlr_log(L_ERROR, "Unable to drop root"); 230 wlr_log(WLR_ERROR, "Unable to drop root");
231 exit(EXIT_FAILURE); 231 exit(EXIT_FAILURE);
232 } 232 }
233 } 233 }
234 if (setuid(0) != -1) { 234 if (setuid(0) != -1) {
235 wlr_log(L_ERROR, "Root privileges can be restored."); 235 wlr_log(WLR_ERROR, "Root privileges can be restored.");
236 exit(EXIT_FAILURE); 236 exit(EXIT_FAILURE);
237 } 237 }
238#ifdef __linux__ 238#ifdef __linux__
@@ -240,11 +240,11 @@ static void drop_permissions(bool keep_caps) {
240 // Drop every cap except CAP_SYS_PTRACE 240 // Drop every cap except CAP_SYS_PTRACE
241 cap_t caps = cap_init(); 241 cap_t caps = cap_init();
242 cap_value_t keep = CAP_SYS_PTRACE; 242 cap_value_t keep = CAP_SYS_PTRACE;
243 wlr_log(L_INFO, "Dropping extra capabilities"); 243 wlr_log(WLR_INFO, "Dropping extra capabilities");
244 if (cap_set_flag(caps, CAP_PERMITTED, 1, &keep, CAP_SET) || 244 if (cap_set_flag(caps, CAP_PERMITTED, 1, &keep, CAP_SET) ||
245 cap_set_flag(caps, CAP_EFFECTIVE, 1, &keep, CAP_SET) || 245 cap_set_flag(caps, CAP_EFFECTIVE, 1, &keep, CAP_SET) ||
246 cap_set_proc(caps)) { 246 cap_set_proc(caps)) {
247 wlr_log(L_ERROR, "Failed to drop extra capabilities"); 247 wlr_log(WLR_ERROR, "Failed to drop extra capabilities");
248 exit(EXIT_FAILURE); 248 exit(EXIT_FAILURE);
249 } 249 }
250 } 250 }
@@ -335,22 +335,22 @@ int main(int argc, char **argv) {
335 335
336 // TODO: switch logging over to wlroots? 336 // TODO: switch logging over to wlroots?
337 if (debug) { 337 if (debug) {
338 wlr_log_init(L_DEBUG, NULL); 338 wlr_log_init(WLR_DEBUG, NULL);
339 } else if (verbose || validate) { 339 } else if (verbose || validate) {
340 wlr_log_init(L_INFO, NULL); 340 wlr_log_init(WLR_INFO, NULL);
341 } else { 341 } else {
342 wlr_log_init(L_ERROR, NULL); 342 wlr_log_init(WLR_ERROR, NULL);
343 } 343 }
344 344
345 if (optind < argc) { // Behave as IPC client 345 if (optind < argc) { // Behave as IPC client
346 if(optind != 1) { 346 if(optind != 1) {
347 wlr_log(L_ERROR, "Don't use options with the IPC client"); 347 wlr_log(WLR_ERROR, "Don't use options with the IPC client");
348 exit(EXIT_FAILURE); 348 exit(EXIT_FAILURE);
349 } 349 }
350 drop_permissions(false); 350 drop_permissions(false);
351 char *socket_path = getenv("SWAYSOCK"); 351 char *socket_path = getenv("SWAYSOCK");
352 if (!socket_path) { 352 if (!socket_path) {
353 wlr_log(L_ERROR, "Unable to retrieve socket path"); 353 wlr_log(WLR_ERROR, "Unable to retrieve socket path");
354 exit(EXIT_FAILURE); 354 exit(EXIT_FAILURE);
355 } 355 }
356 char *command = join_args(argv + optind, argc - optind); 356 char *command = join_args(argv + optind, argc - optind);
@@ -369,7 +369,7 @@ int main(int argc, char **argv) {
369 if (getuid() != geteuid() || getgid() != getegid()) { 369 if (getuid() != geteuid() || getgid() != getegid()) {
370 // Retain capabilities after setuid() 370 // Retain capabilities after setuid()
371 if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) { 371 if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) {
372 wlr_log(L_ERROR, "Cannot keep caps after setuid()"); 372 wlr_log(WLR_ERROR, "Cannot keep caps after setuid()");
373 exit(EXIT_FAILURE); 373 exit(EXIT_FAILURE);
374 } 374 }
375 suid = true; 375 suid = true;
@@ -390,7 +390,7 @@ int main(int argc, char **argv) {
390 // prevent ipc from crashing sway 390 // prevent ipc from crashing sway
391 signal(SIGPIPE, SIG_IGN); 391 signal(SIGPIPE, SIG_IGN);
392 392
393 wlr_log(L_INFO, "Starting sway version " SWAY_VERSION); 393 wlr_log(WLR_INFO, "Starting sway version " SWAY_VERSION);
394 394
395 layout_init(); 395 layout_init();
396 396
@@ -423,7 +423,7 @@ int main(int argc, char **argv) {
423 char *line = config->cmd_queue->items[0]; 423 char *line = config->cmd_queue->items[0];
424 struct cmd_results *res = execute_command(line, NULL); 424 struct cmd_results *res = execute_command(line, NULL);
425 if (res->status != CMD_SUCCESS) { 425 if (res->status != CMD_SUCCESS) {
426 wlr_log(L_ERROR, "Error on line '%s': %s", line, res->error); 426 wlr_log(WLR_ERROR, "Error on line '%s': %s", line, res->error);
427 } 427 }
428 free_cmd_results(res); 428 free_cmd_results(res);
429 free(line); 429 free(line);
@@ -434,7 +434,7 @@ int main(int argc, char **argv) {
434 server_run(&server); 434 server_run(&server);
435 } 435 }
436 436
437 wlr_log(L_INFO, "Shutting down sway"); 437 wlr_log(WLR_INFO, "Shutting down sway");
438 438
439 server_fini(&server); 439 server_fini(&server);
440 440
diff --git a/sway/server.c b/sway/server.c
index cd15f454..1d8eb964 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -29,20 +29,20 @@
29#include "sway/xwayland.h" 29#include "sway/xwayland.h"
30 30
31bool server_privileged_prepare(struct sway_server *server) { 31bool server_privileged_prepare(struct sway_server *server) {
32 wlr_log(L_DEBUG, "Preparing Wayland server initialization"); 32 wlr_log(WLR_DEBUG, "Preparing Wayland server initialization");
33 server->wl_display = wl_display_create(); 33 server->wl_display = wl_display_create();
34 server->wl_event_loop = wl_display_get_event_loop(server->wl_display); 34 server->wl_event_loop = wl_display_get_event_loop(server->wl_display);
35 server->backend = wlr_backend_autocreate(server->wl_display, NULL); 35 server->backend = wlr_backend_autocreate(server->wl_display, NULL);
36 36
37 if (!server->backend) { 37 if (!server->backend) {
38 wlr_log(L_ERROR, "Unable to create backend"); 38 wlr_log(WLR_ERROR, "Unable to create backend");
39 return false; 39 return false;
40 } 40 }
41 return true; 41 return true;
42} 42}
43 43
44bool server_init(struct sway_server *server) { 44bool server_init(struct sway_server *server) {
45 wlr_log(L_DEBUG, "Initializing Wayland server"); 45 wlr_log(WLR_DEBUG, "Initializing Wayland server");
46 46
47 struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend); 47 struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend);
48 assert(renderer); 48 assert(renderer);
@@ -116,7 +116,7 @@ bool server_init(struct sway_server *server) {
116 116
117 server->socket = wl_display_add_socket_auto(server->wl_display); 117 server->socket = wl_display_add_socket_auto(server->wl_display);
118 if (!server->socket) { 118 if (!server->socket) {
119 wlr_log(L_ERROR, "Unable to open wayland socket"); 119 wlr_log(WLR_ERROR, "Unable to open wayland socket");
120 wlr_backend_destroy(server->backend); 120 wlr_backend_destroy(server->backend);
121 return false; 121 return false;
122 } 122 }
@@ -141,10 +141,10 @@ void server_fini(struct sway_server *server) {
141} 141}
142 142
143void server_run(struct sway_server *server) { 143void server_run(struct sway_server *server) {
144 wlr_log(L_INFO, "Running compositor on wayland display '%s'", 144 wlr_log(WLR_INFO, "Running compositor on wayland display '%s'",
145 server->socket); 145 server->socket);
146 if (!wlr_backend_start(server->backend)) { 146 if (!wlr_backend_start(server->backend)) {
147 wlr_log(L_ERROR, "Failed to start backend"); 147 wlr_log(WLR_ERROR, "Failed to start backend");
148 wlr_backend_destroy(server->backend); 148 wlr_backend_destroy(server->backend);
149 return; 149 return;
150 } 150 }
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c
index 582b2891..bcc3ee9a 100644
--- a/sway/tree/arrange.c
+++ b/sway/tree/arrange.c
@@ -47,11 +47,11 @@ static void apply_horiz_layout(struct sway_container *parent) {
47 double scale = parent->width / total_width; 47 double scale = parent->width / total_width;
48 48
49 // Resize windows 49 // Resize windows
50 wlr_log(L_DEBUG, "Arranging %p horizontally", parent); 50 wlr_log(WLR_DEBUG, "Arranging %p horizontally", parent);
51 double child_x = parent->x; 51 double child_x = parent->x;
52 for (size_t i = 0; i < num_children; ++i) { 52 for (size_t i = 0; i < num_children; ++i) {
53 struct sway_container *child = parent->children->items[i]; 53 struct sway_container *child = parent->children->items[i];
54 wlr_log(L_DEBUG, 54 wlr_log(WLR_DEBUG,
55 "Calculating arrangement for %p:%d (will scale %f by %f)", 55 "Calculating arrangement for %p:%d (will scale %f by %f)",
56 child, child->type, child->width, scale); 56 child, child->type, child->width, scale);
57 child->x = child_x; 57 child->x = child_x;
@@ -99,11 +99,11 @@ static void apply_vert_layout(struct sway_container *parent) {
99 double scale = parent_height / total_height; 99 double scale = parent_height / total_height;
100 100
101 // Resize 101 // Resize
102 wlr_log(L_DEBUG, "Arranging %p vertically", parent); 102 wlr_log(WLR_DEBUG, "Arranging %p vertically", parent);
103 double child_y = parent->y + parent_offset; 103 double child_y = parent->y + parent_offset;
104 for (size_t i = 0; i < num_children; ++i) { 104 for (size_t i = 0; i < num_children; ++i) {
105 struct sway_container *child = parent->children->items[i]; 105 struct sway_container *child = parent->children->items[i];
106 wlr_log(L_DEBUG, 106 wlr_log(WLR_DEBUG,
107 "Calculating arrangement for %p:%d (will scale %f by %f)", 107 "Calculating arrangement for %p:%d (will scale %f by %f)",
108 child, child->type, child->height, scale); 108 child, child->type, child->height, scale);
109 child->x = parent->x; 109 child->x = parent->x;
@@ -179,7 +179,7 @@ static void arrange_children_of(struct sway_container *parent,
179 if (config->reloading) { 179 if (config->reloading) {
180 return; 180 return;
181 } 181 }
182 wlr_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", parent, 182 wlr_log(WLR_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", parent,
183 parent->name, parent->width, parent->height, parent->x, parent->y); 183 parent->name, parent->width, parent->height, parent->x, parent->y);
184 184
185 // Calculate x, y, width and height of children 185 // Calculate x, y, width and height of children
@@ -226,7 +226,7 @@ static void arrange_workspace(struct sway_container *workspace,
226 } 226 }
227 struct sway_container *output = workspace->parent; 227 struct sway_container *output = workspace->parent;
228 struct wlr_box *area = &output->sway_output->usable_area; 228 struct wlr_box *area = &output->sway_output->usable_area;
229 wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", 229 wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d",
230 area->width, area->height, area->x, area->y); 230 area->width, area->height, area->x, area->y);
231 remove_gaps(workspace); 231 remove_gaps(workspace);
232 workspace->width = area->width; 232 workspace->width = area->width;
@@ -235,7 +235,7 @@ static void arrange_workspace(struct sway_container *workspace,
235 workspace->y = output->y + area->y; 235 workspace->y = output->y + area->y;
236 add_gaps(workspace); 236 add_gaps(workspace);
237 transaction_add_container(transaction, workspace); 237 transaction_add_container(transaction, workspace);
238 wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name, 238 wlr_log(WLR_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name,
239 workspace->x, workspace->y); 239 workspace->x, workspace->y);
240 arrange_floating(workspace->sway_workspace->floating, transaction); 240 arrange_floating(workspace->sway_workspace->floating, transaction);
241 arrange_children_of(workspace, transaction); 241 arrange_children_of(workspace, transaction);
@@ -254,7 +254,7 @@ static void arrange_output(struct sway_container *output,
254 output->width = output_box->width; 254 output->width = output_box->width;
255 output->height = output_box->height; 255 output->height = output_box->height;
256 transaction_add_container(transaction, output); 256 transaction_add_container(transaction, output);
257 wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", 257 wlr_log(WLR_DEBUG, "Arranging output '%s' at %f,%f",
258 output->name, output->x, output->y); 258 output->name, output->x, output->y);
259 for (int i = 0; i < output->children->length; ++i) { 259 for (int i = 0; i < output->children->length; ++i) {
260 struct sway_container *workspace = output->children->items[i]; 260 struct sway_container *workspace = output->children->items[i];
@@ -315,7 +315,7 @@ void arrange_and_commit(struct sway_container *container) {
315 315
316void remove_gaps(struct sway_container *c) { 316void remove_gaps(struct sway_container *c) {
317 if (c->current_gaps == 0) { 317 if (c->current_gaps == 0) {
318 wlr_log(L_DEBUG, "Removing gaps: not gapped: %p", c); 318 wlr_log(WLR_DEBUG, "Removing gaps: not gapped: %p", c);
319 return; 319 return;
320 } 320 }
321 321
@@ -326,12 +326,12 @@ void remove_gaps(struct sway_container *c) {
326 326
327 c->current_gaps = 0; 327 c->current_gaps = 0;
328 328
329 wlr_log(L_DEBUG, "Removing gaps %p", c); 329 wlr_log(WLR_DEBUG, "Removing gaps %p", c);
330} 330}
331 331
332void add_gaps(struct sway_container *c) { 332void add_gaps(struct sway_container *c) {
333 if (c->current_gaps > 0 || c->type == C_CONTAINER) { 333 if (c->current_gaps > 0 || c->type == C_CONTAINER) {
334 wlr_log(L_DEBUG, "Not adding gaps: %p", c); 334 wlr_log(WLR_DEBUG, "Not adding gaps: %p", c);
335 return; 335 return;
336 } 336 }
337 337
@@ -348,5 +348,5 @@ void add_gaps(struct sway_container *c) {
348 c->height -= 2 * gaps; 348 c->height -= 2 * gaps;
349 c->current_gaps = gaps; 349 c->current_gaps = gaps;
350 350
351 wlr_log(L_DEBUG, "Adding gaps: %p", c); 351 wlr_log(WLR_DEBUG, "Adding gaps: %p", c);
352} 352}
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 92408ce6..58852717 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -31,7 +31,7 @@ static list_t *get_bfs_queue() {
31 if (!bfs_queue) { 31 if (!bfs_queue) {
32 bfs_queue = create_list(); 32 bfs_queue = create_list();
33 if (!bfs_queue) { 33 if (!bfs_queue) {
34 wlr_log(L_ERROR, "could not allocate list for bfs queue"); 34 wlr_log(WLR_ERROR, "could not allocate list for bfs queue");
35 return NULL; 35 return NULL;
36 } 36 }
37 } 37 }
@@ -213,7 +213,7 @@ static struct sway_container *container_workspace_destroy(
213 return NULL; 213 return NULL;
214 } 214 }
215 215
216 wlr_log(L_DEBUG, "destroying workspace '%s'", workspace->name); 216 wlr_log(WLR_DEBUG, "destroying workspace '%s'", workspace->name);
217 217
218 struct sway_container *parent = workspace->parent; 218 struct sway_container *parent = workspace->parent;
219 if (!workspace_is_empty(workspace) && output) { 219 if (!workspace_is_empty(workspace) && output) {
@@ -226,7 +226,7 @@ static struct sway_container *container_workspace_destroy(
226 } 226 }
227 } 227 }
228 228
229 wlr_log(L_DEBUG, "moving children to different workspace '%s' -> '%s'", 229 wlr_log(WLR_DEBUG, "moving children to different workspace '%s' -> '%s'",
230 workspace->name, new_workspace->name); 230 workspace->name, new_workspace->name);
231 for (int i = 0; i < workspace->children->length; i++) { 231 for (int i = 0; i < workspace->children->length; i++) {
232 container_move_to(workspace->children->items[i], new_workspace); 232 container_move_to(workspace->children->items[i], new_workspace);
@@ -292,7 +292,7 @@ static struct sway_container *container_output_destroy(
292 output->sway_output->swayc = NULL; 292 output->sway_output->swayc = NULL;
293 output->sway_output = NULL; 293 output->sway_output = NULL;
294 294
295 wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name); 295 wlr_log(WLR_DEBUG, "OUTPUT: Destroying output '%s'", output->name);
296 296
297 return &root_container; 297 return &root_container;
298} 298}
@@ -319,7 +319,7 @@ static struct sway_container *container_destroy_noreaping(
319 // Workspaces will refuse to be destroyed if they're the last workspace 319 // Workspaces will refuse to be destroyed if they're the last workspace
320 // on their output. 320 // on their output.
321 if (!container_workspace_destroy(con)) { 321 if (!container_workspace_destroy(con)) {
322 wlr_log(L_ERROR, "workspace doesn't want to destroy"); 322 wlr_log(WLR_ERROR, "workspace doesn't want to destroy");
323 return NULL; 323 return NULL;
324 } 324 }
325 } 325 }
@@ -346,7 +346,7 @@ bool container_reap_empty(struct sway_container *con) {
346 break; 346 break;
347 case C_WORKSPACE: 347 case C_WORKSPACE:
348 if (!workspace_is_visible(con) && workspace_is_empty(con)) { 348 if (!workspace_is_visible(con) && workspace_is_empty(con)) {
349 wlr_log(L_DEBUG, "Destroying workspace via reaper"); 349 wlr_log(WLR_DEBUG, "Destroying workspace via reaper");
350 container_destroy_noreaping(con); 350 container_destroy_noreaping(con);
351 return true; 351 return true;
352 } 352 }
@@ -439,7 +439,7 @@ struct sway_container *container_view_create(struct sway_container *sibling,
439 } 439 }
440 const char *title = view_get_title(sway_view); 440 const char *title = view_get_title(sway_view);
441 struct sway_container *swayc = container_create(C_VIEW); 441 struct sway_container *swayc = container_create(C_VIEW);
442 wlr_log(L_DEBUG, "Adding new view %p:%s to container %p %d %s", 442 wlr_log(WLR_DEBUG, "Adding new view %p:%s to container %p %d %s",
443 swayc, title, sibling, sibling ? sibling->type : 0, sibling->name); 443 swayc, title, sibling, sibling ? sibling->type : 0, sibling->name);
444 // Setup values 444 // Setup values
445 swayc->sway_view = sway_view; 445 swayc->sway_view = sway_view;
@@ -702,7 +702,7 @@ void container_for_each_descendant_bfs(struct sway_container *con,
702 } 702 }
703 703
704 if (queue == NULL) { 704 if (queue == NULL) {
705 wlr_log(L_ERROR, "could not allocate list"); 705 wlr_log(WLR_ERROR, "could not allocate list");
706 return; 706 return;
707 } 707 }
708 708
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 0dba4aab..ba234e89 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -101,7 +101,7 @@ void container_insert_child(struct sway_container *parent,
101 if (old_parent) { 101 if (old_parent) {
102 container_remove_child(child); 102 container_remove_child(child);
103 } 103 }
104 wlr_log(L_DEBUG, "Inserting id:%zd at index %d", child->id, i); 104 wlr_log(WLR_DEBUG, "Inserting id:%zd at index %d", child->id, i);
105 list_insert(parent->children, i, child); 105 list_insert(parent->children, i, child);
106 child->parent = parent; 106 child->parent = parent;
107 container_handle_fullscreen_reparent(child, old_parent); 107 container_handle_fullscreen_reparent(child, old_parent);
@@ -127,7 +127,7 @@ struct sway_container *container_add_sibling(struct sway_container *fixed,
127 127
128void container_add_child(struct sway_container *parent, 128void container_add_child(struct sway_container *parent,
129 struct sway_container *child) { 129 struct sway_container *child) {
130 wlr_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)", 130 wlr_log(WLR_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)",
131 child, child->type, child->width, child->height, 131 child, child->type, child->width, child->height,
132 parent, parent->type, parent->width, parent->height); 132 parent, parent->type, parent->width, parent->height);
133 struct sway_container *old_parent = child->parent; 133 struct sway_container *old_parent = child->parent;
@@ -319,13 +319,13 @@ static void move_out_of_tabs_stacks(struct sway_container *container,
319 int offs) { 319 int offs) {
320 if (container->parent == current->parent 320 if (container->parent == current->parent
321 && current->parent->children->length == 1) { 321 && current->parent->children->length == 1) {
322 wlr_log(L_DEBUG, "Changing layout of %zd", current->parent->id); 322 wlr_log(WLR_DEBUG, "Changing layout of %zd", current->parent->id);
323 current->parent->layout = move_dir == 323 current->parent->layout = move_dir ==
324 MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; 324 MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT;
325 return; 325 return;
326 } 326 }
327 327
328 wlr_log(L_DEBUG, "Moving out of tab/stack into a split"); 328 wlr_log(WLR_DEBUG, "Moving out of tab/stack into a split");
329 bool is_workspace = current->parent->type == C_WORKSPACE; 329 bool is_workspace = current->parent->type == C_WORKSPACE;
330 struct sway_container *new_parent = container_split(current->parent, 330 struct sway_container *new_parent = container_split(current->parent,
331 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT); 331 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT);
@@ -370,7 +370,7 @@ void container_move(struct sway_container *container,
370 } 370 }
371 371
372 parent = current->parent; 372 parent = current->parent;
373 wlr_log(L_DEBUG, "Visiting %p %s '%s'", current, 373 wlr_log(WLR_DEBUG, "Visiting %p %s '%s'", current,
374 container_type_to_str(current->type), current->name); 374 container_type_to_str(current->type), current->name);
375 375
376 int index = index_child(current); 376 int index = index_child(current);
@@ -388,12 +388,12 @@ void container_move(struct sway_container *container,
388 root_container.sway_root->output_layout, wlr_dir, 388 root_container.sway_root->output_layout, wlr_dir,
389 current->sway_output->wlr_output, ref_lx, ref_ly); 389 current->sway_output->wlr_output, ref_lx, ref_ly);
390 if (!next) { 390 if (!next) {
391 wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go"); 391 wlr_log(WLR_DEBUG, "Hit edge of output, nowhere else to go");
392 return; 392 return;
393 } 393 }
394 struct sway_output *next_output = next->data; 394 struct sway_output *next_output = next->data;
395 current = next_output->swayc; 395 current = next_output->swayc;
396 wlr_log(L_DEBUG, "Selected next output (%s)", current->name); 396 wlr_log(WLR_DEBUG, "Selected next output (%s)", current->name);
397 // Select workspace and get outta here 397 // Select workspace and get outta here
398 current = seat_get_focus_inactive( 398 current = seat_get_focus_inactive(
399 config->handler_context.seat, current); 399 config->handler_context.seat, current);
@@ -406,20 +406,20 @@ void container_move(struct sway_container *container,
406 case C_WORKSPACE: 406 case C_WORKSPACE:
407 if (!is_parallel(current->layout, move_dir)) { 407 if (!is_parallel(current->layout, move_dir)) {
408 if (current->children->length >= 2) { 408 if (current->children->length >= 2) {
409 wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)", 409 wlr_log(WLR_DEBUG, "Rejiggering the workspace (%d kiddos)",
410 current->children->length); 410 current->children->length);
411 workspace_rejigger(current, container, move_dir); 411 workspace_rejigger(current, container, move_dir);
412 return; 412 return;
413 } else { 413 } else {
414 wlr_log(L_DEBUG, "Selecting output"); 414 wlr_log(WLR_DEBUG, "Selecting output");
415 current = current->parent; 415 current = current->parent;
416 } 416 }
417 } else if (current->layout == L_TABBED 417 } else if (current->layout == L_TABBED
418 || current->layout == L_STACKED) { 418 || current->layout == L_STACKED) {
419 wlr_log(L_DEBUG, "Rejiggering out of tabs/stacks"); 419 wlr_log(WLR_DEBUG, "Rejiggering out of tabs/stacks");
420 workspace_rejigger(current, container, move_dir); 420 workspace_rejigger(current, container, move_dir);
421 } else { 421 } else {
422 wlr_log(L_DEBUG, "Selecting output"); 422 wlr_log(WLR_DEBUG, "Selecting output");
423 current = current->parent; 423 current = current->parent;
424 } 424 }
425 break; 425 break;
@@ -435,11 +435,11 @@ void container_move(struct sway_container *container,
435 move_dir, offs); 435 move_dir, offs);
436 return; 436 return;
437 } else { 437 } else {
438 wlr_log(L_DEBUG, "Hit limit, selecting parent"); 438 wlr_log(WLR_DEBUG, "Hit limit, selecting parent");
439 current = current->parent; 439 current = current->parent;
440 } 440 }
441 } else { 441 } else {
442 wlr_log(L_DEBUG, "Hit limit, " 442 wlr_log(WLR_DEBUG, "Hit limit, "
443 "promoting descendant to sibling"); 443 "promoting descendant to sibling");
444 // Special case 444 // Special case
445 container_insert_child(current->parent, container, 445 container_insert_child(current->parent, container,
@@ -449,14 +449,14 @@ void container_move(struct sway_container *container,
449 } 449 }
450 } else { 450 } else {
451 sibling = parent->children->items[index + offs]; 451 sibling = parent->children->items[index + offs];
452 wlr_log(L_DEBUG, "Selecting sibling id:%zd", sibling->id); 452 wlr_log(WLR_DEBUG, "Selecting sibling id:%zd", sibling->id);
453 } 453 }
454 } else if (parent->layout == L_TABBED 454 } else if (parent->layout == L_TABBED
455 || parent->layout == L_STACKED) { 455 || parent->layout == L_STACKED) {
456 move_out_of_tabs_stacks(container, current, move_dir, offs); 456 move_out_of_tabs_stacks(container, current, move_dir, offs);
457 return; 457 return;
458 } else { 458 } else {
459 wlr_log(L_DEBUG, "Moving up to find a parallel container"); 459 wlr_log(WLR_DEBUG, "Moving up to find a parallel container");
460 current = current->parent; 460 current = current->parent;
461 } 461 }
462 break; 462 break;
@@ -475,11 +475,11 @@ void container_move(struct sway_container *container,
475 switch (sibling->type) { 475 switch (sibling->type) {
476 case C_VIEW: 476 case C_VIEW:
477 if (sibling->parent == container->parent) { 477 if (sibling->parent == container->parent) {
478 wlr_log(L_DEBUG, "Swapping siblings"); 478 wlr_log(WLR_DEBUG, "Swapping siblings");
479 sibling->parent->children->items[index + offs] = container; 479 sibling->parent->children->items[index + offs] = container;
480 sibling->parent->children->items[index] = sibling; 480 sibling->parent->children->items[index] = sibling;
481 } else { 481 } else {
482 wlr_log(L_DEBUG, "Promoting to sibling of cousin"); 482 wlr_log(WLR_DEBUG, "Promoting to sibling of cousin");
483 container_insert_child(sibling->parent, container, 483 container_insert_child(sibling->parent, container,
484 index_child(sibling) + (offs > 0 ? 0 : 1)); 484 index_child(sibling) + (offs > 0 ? 0 : 1));
485 container->width = container->height = 0; 485 container->width = container->height = 0;
@@ -490,31 +490,31 @@ void container_move(struct sway_container *container,
490 case C_CONTAINER: 490 case C_CONTAINER:
491 if (is_parallel(sibling->layout, move_dir)) { 491 if (is_parallel(sibling->layout, move_dir)) {
492 int limit = container_limit(sibling, invert_movement(move_dir)); 492 int limit = container_limit(sibling, invert_movement(move_dir));
493 wlr_log(L_DEBUG, "limit: %d", limit); 493 wlr_log(WLR_DEBUG, "limit: %d", limit);
494 wlr_log(L_DEBUG, 494 wlr_log(WLR_DEBUG,
495 "Reparenting container (parallel) to index %d " 495 "Reparenting container (parallel) to index %d "
496 "(move dir: %d)", limit, move_dir); 496 "(move dir: %d)", limit, move_dir);
497 container_insert_child(sibling, container, limit); 497 container_insert_child(sibling, container, limit);
498 container->width = container->height = 0; 498 container->width = container->height = 0;
499 sibling = NULL; 499 sibling = NULL;
500 } else { 500 } else {
501 wlr_log(L_DEBUG, "Reparenting container (perpendicular)"); 501 wlr_log(WLR_DEBUG, "Reparenting container (perpendicular)");
502 struct sway_container *focus_inactive = seat_get_focus_inactive( 502 struct sway_container *focus_inactive = seat_get_focus_inactive(
503 config->handler_context.seat, sibling); 503 config->handler_context.seat, sibling);
504 if (focus_inactive && focus_inactive != sibling) { 504 if (focus_inactive && focus_inactive != sibling) {
505 while (focus_inactive->parent != sibling) { 505 while (focus_inactive->parent != sibling) {
506 focus_inactive = focus_inactive->parent; 506 focus_inactive = focus_inactive->parent;
507 } 507 }
508 wlr_log(L_DEBUG, "Focus inactive: id:%zd", 508 wlr_log(WLR_DEBUG, "Focus inactive: id:%zd",
509 focus_inactive->id); 509 focus_inactive->id);
510 sibling = focus_inactive; 510 sibling = focus_inactive;
511 continue; 511 continue;
512 } else if (sibling->children->length) { 512 } else if (sibling->children->length) {
513 wlr_log(L_DEBUG, "No focus-inactive, adding arbitrarily"); 513 wlr_log(WLR_DEBUG, "No focus-inactive, adding arbitrarily");
514 container_remove_child(container); 514 container_remove_child(container);
515 container_add_sibling(sibling->children->items[0], container); 515 container_add_sibling(sibling->children->items[0], container);
516 } else { 516 } else {
517 wlr_log(L_DEBUG, "No kiddos, adding container alone"); 517 wlr_log(WLR_DEBUG, "No kiddos, adding container alone");
518 container_remove_child(container); 518 container_remove_child(container);
519 container_add_child(sibling, container); 519 container_add_child(sibling, container);
520 } 520 }
@@ -611,7 +611,7 @@ static struct sway_container *get_swayc_in_output_direction(
611 } 611 }
612 612
613 if (ws == NULL) { 613 if (ws == NULL) {
614 wlr_log(L_ERROR, "got an output without a workspace"); 614 wlr_log(WLR_ERROR, "got an output without a workspace");
615 return NULL; 615 return NULL;
616 } 616 }
617 617
@@ -783,7 +783,7 @@ struct sway_container *container_get_in_direction(
783 } else { 783 } else {
784 struct sway_container *desired_con = 784 struct sway_container *desired_con =
785 parent->children->items[desired]; 785 parent->children->items[desired];
786 wlr_log(L_DEBUG, 786 wlr_log(WLR_DEBUG,
787 "cont %d-%p dir %i sibling %d: %p", idx, 787 "cont %d-%p dir %i sibling %d: %p", idx,
788 container, dir, desired, desired_con); 788 container, dir, desired, desired_con);
789 return seat_get_focus_inactive_view(seat, desired_con); 789 return seat_get_focus_inactive_view(seat, desired_con);
@@ -848,7 +848,7 @@ struct sway_container *container_split(struct sway_container *child,
848 848
849 struct sway_container *cont = container_create(C_CONTAINER); 849 struct sway_container *cont = container_create(C_CONTAINER);
850 850
851 wlr_log(L_DEBUG, "creating container %p around %p", cont, child); 851 wlr_log(WLR_DEBUG, "creating container %p around %p", cont, child);
852 852
853 remove_gaps(child); 853 remove_gaps(child);
854 854
@@ -896,7 +896,7 @@ struct sway_container *container_split(struct sway_container *child,
896void container_recursive_resize(struct sway_container *container, 896void container_recursive_resize(struct sway_container *container,
897 double amount, enum resize_edge edge) { 897 double amount, enum resize_edge edge) {
898 bool layout_match = true; 898 bool layout_match = true;
899 wlr_log(L_DEBUG, "Resizing %p with amount: %f", container, amount); 899 wlr_log(WLR_DEBUG, "Resizing %p with amount: %f", container, amount);
900 if (edge == RESIZE_EDGE_LEFT || edge == RESIZE_EDGE_RIGHT) { 900 if (edge == RESIZE_EDGE_LEFT || edge == RESIZE_EDGE_RIGHT) {
901 container->width += amount; 901 container->width += amount;
902 layout_match = container->layout == L_HORIZ; 902 layout_match = container->layout == L_HORIZ;
@@ -986,7 +986,7 @@ void container_swap(struct sway_container *con1, struct sway_container *con2) {
986 return; 986 return;
987 } 987 }
988 988
989 wlr_log(L_DEBUG, "Swapping containers %zu and %zu", con1->id, con2->id); 989 wlr_log(WLR_DEBUG, "Swapping containers %zu and %zu", con1->id, con2->id);
990 990
991 int fs1 = con1->type == C_VIEW && con1->sway_view->is_fullscreen; 991 int fs1 = con1->type == C_VIEW && con1->sway_view->is_fullscreen;
992 int fs2 = con2->type == C_VIEW && con2->sway_view->is_fullscreen; 992 int fs2 = con2->type == C_VIEW && con2->sway_view->is_fullscreen;
diff --git a/sway/tree/output.c b/sway/tree/output.c
index e2927cdb..da535c18 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -43,11 +43,11 @@ struct sway_container *output_create(
43 43
44 if (strcasecmp(name, cur->name) == 0 || 44 if (strcasecmp(name, cur->name) == 0 ||
45 strcasecmp(identifier, cur->name) == 0) { 45 strcasecmp(identifier, cur->name) == 0) {
46 wlr_log(L_DEBUG, "Matched output config for %s", name); 46 wlr_log(WLR_DEBUG, "Matched output config for %s", name);
47 oc = cur; 47 oc = cur;
48 } 48 }
49 if (strcasecmp("*", cur->name) == 0) { 49 if (strcasecmp("*", cur->name) == 0) {
50 wlr_log(L_DEBUG, "Matched wildcard output config for %s", name); 50 wlr_log(WLR_DEBUG, "Matched wildcard output config for %s", name);
51 all = cur; 51 all = cur;
52 } 52 }
53 53
@@ -86,7 +86,7 @@ struct sway_container *output_create(
86 if (!output->children->length) { 86 if (!output->children->length) {
87 // Create workspace 87 // Create workspace
88 char *ws_name = workspace_next_name(output->name); 88 char *ws_name = workspace_next_name(output->name);
89 wlr_log(L_DEBUG, "Creating default workspace %s", ws_name); 89 wlr_log(WLR_DEBUG, "Creating default workspace %s", ws_name);
90 struct sway_container *ws = workspace_create(output, ws_name); 90 struct sway_container *ws = workspace_create(output, ws_name);
91 // Set each seat's focus if not already set 91 // Set each seat's focus if not already set
92 struct sway_seat *seat = NULL; 92 struct sway_seat *seat = NULL;
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 3ef79fa8..c96b6a97 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -462,17 +462,17 @@ void view_execute_criteria(struct sway_view *view) {
462 list_t *criterias = criteria_for_view(view, CT_COMMAND); 462 list_t *criterias = criteria_for_view(view, CT_COMMAND);
463 for (int i = 0; i < criterias->length; i++) { 463 for (int i = 0; i < criterias->length; i++) {
464 struct criteria *criteria = criterias->items[i]; 464 struct criteria *criteria = criterias->items[i];
465 wlr_log(L_DEBUG, "Checking criteria %s", criteria->raw); 465 wlr_log(WLR_DEBUG, "Checking criteria %s", criteria->raw);
466 if (view_has_executed_criteria(view, criteria)) { 466 if (view_has_executed_criteria(view, criteria)) {
467 wlr_log(L_DEBUG, "Criteria already executed"); 467 wlr_log(WLR_DEBUG, "Criteria already executed");
468 continue; 468 continue;
469 } 469 }
470 wlr_log(L_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", 470 wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'",
471 criteria->raw, view, criteria->cmdlist); 471 criteria->raw, view, criteria->cmdlist);
472 list_add(view->executed_criteria, criteria); 472 list_add(view->executed_criteria, criteria);
473 struct cmd_results *res = execute_command(criteria->cmdlist, NULL); 473 struct cmd_results *res = execute_command(criteria->cmdlist, NULL);
474 if (res->status != CMD_SUCCESS) { 474 if (res->status != CMD_SUCCESS) {
475 wlr_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error); 475 wlr_log(WLR_ERROR, "Command '%s' failed: %s", res->input, res->error);
476 } 476 }
477 free_cmd_results(res); 477 free_cmd_results(res);
478 // view must be focused for commands to affect it, 478 // view must be focused for commands to affect it,
@@ -601,7 +601,7 @@ static void view_subsurface_create(struct sway_view *view,
601 struct wlr_subsurface *subsurface) { 601 struct wlr_subsurface *subsurface) {
602 struct sway_view_child *child = calloc(1, sizeof(struct sway_view_child)); 602 struct sway_view_child *child = calloc(1, sizeof(struct sway_view_child));
603 if (child == NULL) { 603 if (child == NULL) {
604 wlr_log(L_ERROR, "Allocation failed"); 604 wlr_log(WLR_ERROR, "Allocation failed");
605 return; 605 return;
606 } 606 }
607 view_child_init(child, NULL, view, subsurface->surface); 607 view_child_init(child, NULL, view, subsurface->surface);
@@ -721,7 +721,7 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) {
721 return NULL; 721 return NULL;
722 } 722 }
723 723
724 wlr_log(L_DEBUG, "Surface of unknown type (role %s): %p", 724 wlr_log(WLR_DEBUG, "Surface of unknown type (role %s): %p",
725 wlr_surface->role, wlr_surface); 725 wlr_surface->role, wlr_surface);
726 return NULL; 726 return NULL;
727} 727}
@@ -789,7 +789,7 @@ static char *escape_title(char *buffer) {
789 char *escaped_title = calloc(length + 1, sizeof(char)); 789 char *escaped_title = calloc(length + 1, sizeof(char));
790 int result = escape_markup_text(buffer, escaped_title, length); 790 int result = escape_markup_text(buffer, escaped_title, length);
791 if (result != length) { 791 if (result != length) {
792 wlr_log(L_ERROR, "Could not escape title: %s", buffer); 792 wlr_log(WLR_ERROR, "Could not escape title: %s", buffer);
793 free(escaped_title); 793 free(escaped_title);
794 return buffer; 794 return buffer;
795 } 795 }
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 51f0fcb4..50f9400a 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -49,7 +49,7 @@ struct sway_container *workspace_create(struct sway_container *output,
49 output = get_workspace_initial_output(name); 49 output = get_workspace_initial_output(name);
50 } 50 }
51 51
52 wlr_log(L_DEBUG, "Added workspace %s for output %s", name, output->name); 52 wlr_log(WLR_DEBUG, "Added workspace %s for output %s", name, output->name);
53 struct sway_container *workspace = container_create(C_WORKSPACE); 53 struct sway_container *workspace = container_create(C_WORKSPACE);
54 54
55 workspace->x = output->x; 55 workspace->x = output->x;
@@ -107,7 +107,7 @@ static bool workspace_valid_on_output(const char *output_name,
107} 107}
108 108
109char *workspace_next_name(const char *output_name) { 109char *workspace_next_name(const char *output_name) {
110 wlr_log(L_DEBUG, "Workspace: Generating new workspace name for output %s", 110 wlr_log(WLR_DEBUG, "Workspace: Generating new workspace name for output %s",
111 output_name); 111 output_name);
112 // Scan all workspace bindings to find the next available workspace name, 112 // Scan all workspace bindings to find the next available workspace name,
113 // if none are found/available then default to a number 113 // if none are found/available then default to a number
@@ -135,7 +135,7 @@ char *workspace_next_name(const char *output_name) {
135 while (isspace(*_target)) { 135 while (isspace(*_target)) {
136 memmove(_target, _target+1, strlen(_target+1)); 136 memmove(_target, _target+1, strlen(_target+1));
137 } 137 }
138 wlr_log(L_DEBUG, "Got valid workspace command for target: '%s'", 138 wlr_log(WLR_DEBUG, "Got valid workspace command for target: '%s'",
139 _target); 139 _target);
140 140
141 // Make sure that the command references an actual workspace 141 // Make sure that the command references an actual workspace
@@ -161,7 +161,7 @@ char *workspace_next_name(const char *output_name) {
161 temp[length - 1] = '\0'; 161 temp[length - 1] = '\0';
162 free(_target); 162 free(_target);
163 _target = temp; 163 _target = temp;
164 wlr_log(L_DEBUG, "Isolated name from workspace number: '%s'", _target); 164 wlr_log(WLR_DEBUG, "Isolated name from workspace number: '%s'", _target);
165 165
166 // Make sure the workspace number doesn't already exist 166 // Make sure the workspace number doesn't already exist
167 if (workspace_by_number(_target)) { 167 if (workspace_by_number(_target)) {
@@ -190,7 +190,7 @@ char *workspace_next_name(const char *output_name) {
190 order = binding->order; 190 order = binding->order;
191 free(target); 191 free(target);
192 target = _target; 192 target = _target;
193 wlr_log(L_DEBUG, "Workspace: Found free name %s", _target); 193 wlr_log(WLR_DEBUG, "Workspace: Found free name %s", _target);
194 } else { 194 } else {
195 free(_target); 195 free(_target);
196 } 196 }
@@ -387,7 +387,7 @@ bool workspace_switch(struct sway_container *workspace) {
387 free(prev_workspace_name); 387 free(prev_workspace_name);
388 prev_workspace_name = malloc(strlen(active_ws->name) + 1); 388 prev_workspace_name = malloc(strlen(active_ws->name) + 1);
389 if (!prev_workspace_name) { 389 if (!prev_workspace_name) {
390 wlr_log(L_ERROR, "Unable to allocate previous workspace name"); 390 wlr_log(WLR_ERROR, "Unable to allocate previous workspace name");
391 return false; 391 return false;
392 } 392 }
393 strcpy(prev_workspace_name, active_ws->name); 393 strcpy(prev_workspace_name, active_ws->name);
@@ -409,7 +409,7 @@ bool workspace_switch(struct sway_container *workspace) {
409 } 409 }
410 } 410 }
411 411
412 wlr_log(L_DEBUG, "Switching to workspace %p:%s", 412 wlr_log(WLR_DEBUG, "Switching to workspace %p:%s",
413 workspace, workspace->name); 413 workspace, workspace->name);
414 struct sway_container *next = seat_get_focus_inactive(seat, workspace); 414 struct sway_container *next = seat_get_focus_inactive(seat, workspace);
415 if (next == NULL) { 415 if (next == NULL) {
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 5b8028e5..f03c5aea 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -46,7 +46,7 @@ static void swaybar_output_free(struct swaybar_output *output) {
46 if (!output) { 46 if (!output) {
47 return; 47 return;
48 } 48 }
49 wlr_log(L_DEBUG, "Removing output %s", output->name); 49 wlr_log(WLR_DEBUG, "Removing output %s", output->name);
50 zwlr_layer_surface_v1_destroy(output->layer_surface); 50 zwlr_layer_surface_v1_destroy(output->layer_surface);
51 wl_surface_destroy(output->surface); 51 wl_surface_destroy(output->surface);
52 wl_output_destroy(output->output); 52 wl_output_destroy(output->output);
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c
index 141612a6..26f073c8 100644
--- a/swaybar/i3bar.c
+++ b/swaybar/i3bar.c
@@ -31,7 +31,7 @@ static bool i3bar_parse_json(struct status_line *status, const char *text) {
31 status_error(status, "[failed to parse i3bar json]"); 31 status_error(status, "[failed to parse i3bar json]");
32 return false; 32 return false;
33 } 33 }
34 wlr_log(L_DEBUG, "Got i3bar json: '%s'", text); 34 wlr_log(WLR_DEBUG, "Got i3bar json: '%s'", text);
35 for (size_t i = 0; i < json_object_array_length(results); ++i) { 35 for (size_t i = 0; i < json_object_array_length(results); ++i) {
36 json_object *full_text, *short_text, *color, *min_width, *align, *urgent; 36 json_object *full_text, *short_text, *color, *min_width, *align, *urgent;
37 json_object *name, *instance, *separator, *separator_block_width; 37 json_object *name, *instance, *separator, *separator_block_width;
@@ -193,7 +193,7 @@ bool i3bar_handle_readable(struct status_line *status) {
193 193
194void i3bar_block_send_click(struct status_line *status, 194void i3bar_block_send_click(struct status_line *status,
195 struct i3bar_block *block, int x, int y, uint32_t button) { 195 struct i3bar_block *block, int x, int y, uint32_t button) {
196 wlr_log(L_DEBUG, "block %s clicked", block->name ? block->name : "(nil)"); 196 wlr_log(WLR_DEBUG, "block %s clicked", block->name ? block->name : "(nil)");
197 if (!block->name || !status->i3bar_state.click_events) { 197 if (!block->name || !status->i3bar_state.click_events) {
198 return; 198 return;
199 } 199 }
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 959fa095..08531f2a 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -327,7 +327,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
327 json_object *result = json_tokener_parse(resp->payload); 327 json_object *result = json_tokener_parse(resp->payload);
328 if (!result) { 328 if (!result) {
329 free_ipc_response(resp); 329 free_ipc_response(resp);
330 wlr_log(L_ERROR, "failed to parse payload as json"); 330 wlr_log(WLR_ERROR, "failed to parse payload as json");
331 return false; 331 return false;
332 } 332 }
333 json_object *json_change, *json_pango_markup; 333 json_object *json_change, *json_pango_markup;
@@ -340,7 +340,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
340 bar->config->mode = strdup(change); 340 bar->config->mode = strdup(change);
341 } 341 }
342 } else { 342 } else {
343 wlr_log(L_ERROR, "failed to parse response"); 343 wlr_log(WLR_ERROR, "failed to parse response");
344 json_object_put(result); 344 json_object_put(result);
345 free_ipc_response(resp); 345 free_ipc_response(resp);
346 return false; 346 return false;
diff --git a/swaybar/main.c b/swaybar/main.c
index c897e1c9..60e4b37c 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -75,13 +75,13 @@ int main(int argc, char **argv) {
75 } 75 }
76 76
77 if (debug) { 77 if (debug) {
78 wlr_log_init(L_DEBUG, NULL); 78 wlr_log_init(WLR_DEBUG, NULL);
79 } else { 79 } else {
80 wlr_log_init(L_ERROR, NULL); 80 wlr_log_init(WLR_ERROR, NULL);
81 } 81 }
82 82
83 if (!bar_id) { 83 if (!bar_id) {
84 wlr_log(L_ERROR, "No bar_id passed. " 84 wlr_log(WLR_ERROR, "No bar_id passed. "
85 "Provide --bar_id or let sway start swaybar"); 85 "Provide --bar_id or let sway start swaybar");
86 return 1; 86 return 1;
87 } 87 }
@@ -89,7 +89,7 @@ int main(int argc, char **argv) {
89 if (!socket_path) { 89 if (!socket_path) {
90 socket_path = get_socketpath(); 90 socket_path = get_socketpath();
91 if (!socket_path) { 91 if (!socket_path) {
92 wlr_log(L_ERROR, "Unable to retrieve socket path"); 92 wlr_log(WLR_ERROR, "Unable to retrieve socket path");
93 return 1; 93 return 1;
94 } 94 }
95 } 95 }
diff --git a/swaybar/status_line.c b/swaybar/status_line.c
index e0e7414a..bc47580b 100644
--- a/swaybar/status_line.c
+++ b/swaybar/status_line.c
@@ -49,14 +49,14 @@ bool status_handle_readable(struct status_line *status) {
49 json_object *version; 49 json_object *version;
50 if (json_object_object_get_ex(proto, "version", &version) 50 if (json_object_object_get_ex(proto, "version", &version)
51 && json_object_get_int(version) == 1) { 51 && json_object_get_int(version) == 1) {
52 wlr_log(L_DEBUG, "Switched to i3bar protocol."); 52 wlr_log(WLR_DEBUG, "Switched to i3bar protocol.");
53 status->protocol = PROTOCOL_I3BAR; 53 status->protocol = PROTOCOL_I3BAR;
54 } 54 }
55 json_object *click_events; 55 json_object *click_events;
56 if (json_object_object_get_ex( 56 if (json_object_object_get_ex(
57 proto, "click_events", &click_events) 57 proto, "click_events", &click_events)
58 && json_object_get_boolean(click_events)) { 58 && json_object_get_boolean(click_events)) {
59 wlr_log(L_DEBUG, "Enabled click events."); 59 wlr_log(WLR_DEBUG, "Enabled click events.");
60 status->i3bar_state.click_events = true; 60 status->i3bar_state.click_events = true;
61 const char *events_array = "[\n"; 61 const char *events_array = "[\n";
62 ssize_t len = strlen(events_array); 62 ssize_t len = strlen(events_array);
@@ -91,7 +91,7 @@ struct status_line *status_line_init(char *cmd) {
91 int pipe_read_fd[2]; 91 int pipe_read_fd[2];
92 int pipe_write_fd[2]; 92 int pipe_write_fd[2];
93 if (pipe(pipe_read_fd) != 0 || pipe(pipe_write_fd) != 0) { 93 if (pipe(pipe_read_fd) != 0 || pipe(pipe_write_fd) != 0) {
94 wlr_log(L_ERROR, "Unable to create pipes for status_command fork"); 94 wlr_log(WLR_ERROR, "Unable to create pipes for status_command fork");
95 exit(1); 95 exit(1);
96 } 96 }
97 97
diff --git a/swaybg/main.c b/swaybg/main.c
index 5b6c378c..1796b245 100644
--- a/swaybg/main.c
+++ b/swaybg/main.c
@@ -48,7 +48,7 @@ struct swaybg_state {
48bool is_valid_color(const char *color) { 48bool is_valid_color(const char *color) {
49 int len = strlen(color); 49 int len = strlen(color);
50 if (len != 7 || color[0] != '#') { 50 if (len != 7 || color[0] != '#') {
51 wlr_log(L_ERROR, "%s is not a valid color for swaybg. " 51 wlr_log(WLR_ERROR, "%s is not a valid color for swaybg. "
52 "Color should be specified as #rrggbb (no alpha).", color); 52 "Color should be specified as #rrggbb (no alpha).", color);
53 return false; 53 return false;
54 } 54 }
@@ -185,10 +185,10 @@ int main(int argc, const char **argv) {
185 struct swaybg_args args = {0}; 185 struct swaybg_args args = {0};
186 struct swaybg_state state = {0}; 186 struct swaybg_state state = {0};
187 state.args = &args; 187 state.args = &args;
188 wlr_log_init(L_DEBUG, NULL); 188 wlr_log_init(WLR_DEBUG, NULL);
189 189
190 if (argc != 4) { 190 if (argc != 4) {
191 wlr_log(L_ERROR, "Do not run this program manually. " 191 wlr_log(WLR_ERROR, "Do not run this program manually. "
192 "See man 5 sway and look for output options."); 192 "See man 5 sway and look for output options.");
193 return 1; 193 return 1;
194 } 194 }
diff --git a/swayidle/main.c b/swayidle/main.c
index 7666578f..64e45036 100644
--- a/swayidle/main.c
+++ b/swayidle/main.c
@@ -59,24 +59,24 @@ static void cmd_exec(void *data) {
59 return; 59 return;
60 } 60 }
61 char *param = (char *)data; 61 char *param = (char *)data;
62 wlr_log(L_DEBUG, "Cmd exec %s", param); 62 wlr_log(WLR_DEBUG, "Cmd exec %s", param);
63 pid_t pid = fork(); 63 pid_t pid = fork();
64 if (pid == 0) { 64 if (pid == 0) {
65 pid = fork(); 65 pid = fork();
66 if (pid == 0) { 66 if (pid == 0) {
67 char *const cmd[] = { "sh", "-c", param, NULL, }; 67 char *const cmd[] = { "sh", "-c", param, NULL, };
68 execvp(cmd[0], cmd); 68 execvp(cmd[0], cmd);
69 wlr_log_errno(L_ERROR, "execve failed!"); 69 wlr_log_errno(WLR_ERROR, "execve failed!");
70 exit(1); 70 exit(1);
71 } else if (pid < 0) { 71 } else if (pid < 0) {
72 wlr_log_errno(L_ERROR, "fork failed"); 72 wlr_log_errno(WLR_ERROR, "fork failed");
73 exit(1); 73 exit(1);
74 } 74 }
75 exit(0); 75 exit(0);
76 } else if (pid < 0) { 76 } else if (pid < 0) {
77 wlr_log_errno(L_ERROR, "fork failed"); 77 wlr_log_errno(WLR_ERROR, "fork failed");
78 } else { 78 } else {
79 wlr_log(L_DEBUG, "Spawned process %s", param); 79 wlr_log(WLR_DEBUG, "Spawned process %s", param);
80 waitpid(pid, NULL, 0); 80 waitpid(pid, NULL, 0);
81 } 81 }
82} 82}
@@ -86,7 +86,7 @@ static int lock_fd = -1;
86static int ongoing_fd = -1; 86static int ongoing_fd = -1;
87 87
88static int release_lock(void *data) { 88static int release_lock(void *data) {
89 wlr_log(L_INFO, "Releasing sleep lock %d", ongoing_fd); 89 wlr_log(WLR_INFO, "Releasing sleep lock %d", ongoing_fd);
90 if (ongoing_fd >= 0) { 90 if (ongoing_fd >= 0) {
91 close(ongoing_fd); 91 close(ongoing_fd);
92 } 92 }
@@ -101,7 +101,7 @@ void acquire_sleep_lock() {
101 int ret = sd_bus_default_system(&bus); 101 int ret = sd_bus_default_system(&bus);
102 102
103 if (ret < 0) { 103 if (ret < 0) {
104 wlr_log(L_ERROR, "Failed to open D-Bus connection: %s", 104 wlr_log(WLR_ERROR, "Failed to open D-Bus connection: %s",
105 strerror(-ret)); 105 strerror(-ret));
106 return; 106 return;
107 } 107 }
@@ -112,17 +112,17 @@ void acquire_sleep_lock() {
112 &error, &msg, "ssss", "sleep", "swayidle", 112 &error, &msg, "ssss", "sleep", "swayidle",
113 "Setup Up Lock Screen", "delay"); 113 "Setup Up Lock Screen", "delay");
114 if (ret < 0) { 114 if (ret < 0) {
115 wlr_log(L_ERROR, "Failed to send Inhibit signal: %s", 115 wlr_log(WLR_ERROR, "Failed to send Inhibit signal: %s",
116 strerror(-ret)); 116 strerror(-ret));
117 } else { 117 } else {
118 ret = sd_bus_message_read(msg, "h", &lock_fd); 118 ret = sd_bus_message_read(msg, "h", &lock_fd);
119 if (ret < 0) { 119 if (ret < 0) {
120 wlr_log(L_ERROR, 120 wlr_log(WLR_ERROR,
121 "Failed to parse D-Bus response for Inhibit: %s", 121 "Failed to parse D-Bus response for Inhibit: %s",
122 strerror(-ret)); 122 strerror(-ret));
123 } 123 }
124 } 124 }
125 wlr_log(L_INFO, "Got sleep lock: %d", lock_fd); 125 wlr_log(WLR_INFO, "Got sleep lock: %d", lock_fd);
126} 126}
127 127
128static int prepare_for_sleep(sd_bus_message *msg, void *userdata, 128static int prepare_for_sleep(sd_bus_message *msg, void *userdata,
@@ -131,10 +131,10 @@ static int prepare_for_sleep(sd_bus_message *msg, void *userdata,
131 int going_down = 1; 131 int going_down = 1;
132 int ret = sd_bus_message_read(msg, "b", &going_down); 132 int ret = sd_bus_message_read(msg, "b", &going_down);
133 if (ret < 0) { 133 if (ret < 0) {
134 wlr_log(L_ERROR, "Failed to parse D-Bus response for Inhibit: %s", 134 wlr_log(WLR_ERROR, "Failed to parse D-Bus response for Inhibit: %s",
135 strerror(-ret)); 135 strerror(-ret));
136 } 136 }
137 wlr_log(L_DEBUG, "PrepareForSleep signal received %d", going_down); 137 wlr_log(WLR_DEBUG, "PrepareForSleep signal received %d", going_down);
138 if (!going_down) { 138 if (!going_down) {
139 acquire_sleep_lock(); 139 acquire_sleep_lock();
140 return 0; 140 return 0;
@@ -151,7 +151,7 @@ static int prepare_for_sleep(sd_bus_message *msg, void *userdata,
151 wl_event_loop_add_timer(state.event_loop, release_lock, NULL); 151 wl_event_loop_add_timer(state.event_loop, release_lock, NULL);
152 wl_event_source_timer_update(source, 1000); 152 wl_event_source_timer_update(source, 1000);
153 } 153 }
154 wlr_log(L_DEBUG, "Prepare for sleep done"); 154 wlr_log(WLR_DEBUG, "Prepare for sleep done");
155 return 0; 155 return 0;
156} 156}
157 157
@@ -168,7 +168,7 @@ void setup_sleep_listener() {
168 168
169 int ret = sd_bus_default_system(&bus); 169 int ret = sd_bus_default_system(&bus);
170 if (ret < 0) { 170 if (ret < 0) {
171 wlr_log(L_ERROR, "Failed to open D-Bus connection: %s", 171 wlr_log(WLR_ERROR, "Failed to open D-Bus connection: %s",
172 strerror(-ret)); 172 strerror(-ret));
173 return; 173 return;
174 } 174 }
@@ -183,7 +183,7 @@ void setup_sleep_listener() {
183 "/org/freedesktop/login1"); 183 "/org/freedesktop/login1");
184 ret = sd_bus_add_match(bus, NULL, str, prepare_for_sleep, NULL); 184 ret = sd_bus_add_match(bus, NULL, str, prepare_for_sleep, NULL);
185 if (ret < 0) { 185 if (ret < 0) {
186 wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); 186 wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret));
187 return; 187 return;
188 } 188 }
189 acquire_sleep_lock(); 189 acquire_sleep_lock();
@@ -214,7 +214,7 @@ static const struct wl_registry_listener registry_listener = {
214 214
215static void handle_idle(void *data, struct org_kde_kwin_idle_timeout *timer) { 215static void handle_idle(void *data, struct org_kde_kwin_idle_timeout *timer) {
216 struct swayidle_timeout_cmd *cmd = data; 216 struct swayidle_timeout_cmd *cmd = data;
217 wlr_log(L_DEBUG, "idle state"); 217 wlr_log(WLR_DEBUG, "idle state");
218 if (cmd && cmd->idle_cmd && cmd->idle_cmd->callback) { 218 if (cmd && cmd->idle_cmd && cmd->idle_cmd->callback) {
219 cmd->idle_cmd->callback(cmd->idle_cmd->param); 219 cmd->idle_cmd->callback(cmd->idle_cmd->param);
220 } 220 }
@@ -222,7 +222,7 @@ static void handle_idle(void *data, struct org_kde_kwin_idle_timeout *timer) {
222 222
223static void handle_resume(void *data, struct org_kde_kwin_idle_timeout *timer) { 223static void handle_resume(void *data, struct org_kde_kwin_idle_timeout *timer) {
224 struct swayidle_timeout_cmd *cmd = data; 224 struct swayidle_timeout_cmd *cmd = data;
225 wlr_log(L_DEBUG, "active state"); 225 wlr_log(WLR_DEBUG, "active state");
226 if (cmd && cmd->resume_cmd && cmd->resume_cmd->callback) { 226 if (cmd && cmd->resume_cmd && cmd->resume_cmd->callback) {
227 cmd->resume_cmd->callback(cmd->resume_cmd->param); 227 cmd->resume_cmd->callback(cmd->resume_cmd->param);
228 } 228 }
@@ -235,12 +235,12 @@ static const struct org_kde_kwin_idle_timeout_listener idle_timer_listener = {
235 235
236struct swayidle_cmd *parse_command(int argc, char **argv) { 236struct swayidle_cmd *parse_command(int argc, char **argv) {
237 if (argc < 1) { 237 if (argc < 1) {
238 wlr_log(L_ERROR, "Too few parameters for command in parse_command"); 238 wlr_log(WLR_ERROR, "Too few parameters for command in parse_command");
239 return NULL; 239 return NULL;
240 } 240 }
241 241
242 struct swayidle_cmd *cmd = calloc(1, sizeof(struct swayidle_cmd)); 242 struct swayidle_cmd *cmd = calloc(1, sizeof(struct swayidle_cmd));
243 wlr_log(L_DEBUG, "Command: %s", argv[0]); 243 wlr_log(WLR_DEBUG, "Command: %s", argv[0]);
244 cmd->callback = cmd_exec; 244 cmd->callback = cmd_exec;
245 cmd->param = argv[0]; 245 cmd->param = argv[0];
246 return cmd; 246 return cmd;
@@ -248,7 +248,7 @@ struct swayidle_cmd *parse_command(int argc, char **argv) {
248 248
249int parse_timeout(int argc, char **argv) { 249int parse_timeout(int argc, char **argv) {
250 if (argc < 3) { 250 if (argc < 3) {
251 wlr_log(L_ERROR, "Too few parameters to timeout command. " 251 wlr_log(WLR_ERROR, "Too few parameters to timeout command. "
252 "Usage: timeout <seconds> <command>"); 252 "Usage: timeout <seconds> <command>");
253 exit(-1); 253 exit(-1);
254 } 254 }
@@ -256,7 +256,7 @@ int parse_timeout(int argc, char **argv) {
256 char *endptr; 256 char *endptr;
257 int seconds = strtoul(argv[1], &endptr, 10); 257 int seconds = strtoul(argv[1], &endptr, 10);
258 if (errno != 0 || *endptr != '\0') { 258 if (errno != 0 || *endptr != '\0') {
259 wlr_log(L_ERROR, "Invalid timeout parameter '%s', it should be a " 259 wlr_log(WLR_ERROR, "Invalid timeout parameter '%s', it should be a "
260 "numeric value representing seconds", optarg); 260 "numeric value representing seconds", optarg);
261 exit(-1); 261 exit(-1);
262 } 262 }
@@ -264,13 +264,13 @@ int parse_timeout(int argc, char **argv) {
264 calloc(1, sizeof(struct swayidle_timeout_cmd)); 264 calloc(1, sizeof(struct swayidle_timeout_cmd));
265 cmd->timeout = seconds * 1000; 265 cmd->timeout = seconds * 1000;
266 266
267 wlr_log(L_DEBUG, "Register idle timeout at %d ms", cmd->timeout); 267 wlr_log(WLR_DEBUG, "Register idle timeout at %d ms", cmd->timeout);
268 wlr_log(L_DEBUG, "Setup idle"); 268 wlr_log(WLR_DEBUG, "Setup idle");
269 cmd->idle_cmd = parse_command(argc - 2, &argv[2]); 269 cmd->idle_cmd = parse_command(argc - 2, &argv[2]);
270 270
271 int result = 3; 271 int result = 3;
272 if (argc >= 5 && !strcmp("resume", argv[3])) { 272 if (argc >= 5 && !strcmp("resume", argv[3])) {
273 wlr_log(L_DEBUG, "Setup resume"); 273 wlr_log(WLR_DEBUG, "Setup resume");
274 cmd->resume_cmd = parse_command(argc - 4, &argv[4]); 274 cmd->resume_cmd = parse_command(argc - 4, &argv[4]);
275 result = 5; 275 result = 5;
276 } 276 }
@@ -280,14 +280,14 @@ int parse_timeout(int argc, char **argv) {
280 280
281int parse_sleep(int argc, char **argv) { 281int parse_sleep(int argc, char **argv) {
282 if (argc < 2) { 282 if (argc < 2) {
283 wlr_log(L_ERROR, "Too few parameters to before-sleep command. " 283 wlr_log(WLR_ERROR, "Too few parameters to before-sleep command. "
284 "Usage: before-sleep <command>"); 284 "Usage: before-sleep <command>");
285 exit(-1); 285 exit(-1);
286 } 286 }
287 287
288 lock_cmd = parse_command(argc - 1, &argv[1]); 288 lock_cmd = parse_command(argc - 1, &argv[1]);
289 if (lock_cmd) { 289 if (lock_cmd) {
290 wlr_log(L_DEBUG, "Setup sleep lock: %s", lock_cmd->param); 290 wlr_log(WLR_DEBUG, "Setup sleep lock: %s", lock_cmd->param);
291 } 291 }
292 292
293 return 2; 293 return 2;
@@ -314,10 +314,10 @@ int parse_args(int argc, char *argv[]) {
314 } 314 }
315 315
316 if (debug) { 316 if (debug) {
317 wlr_log_init(L_DEBUG, NULL); 317 wlr_log_init(WLR_DEBUG, NULL);
318 wlr_log(L_DEBUG, "Loglevel debug"); 318 wlr_log(WLR_DEBUG, "Loglevel debug");
319 } else { 319 } else {
320 wlr_log_init(L_INFO, NULL); 320 wlr_log_init(WLR_INFO, NULL);
321 } 321 }
322 322
323 323
@@ -326,13 +326,13 @@ int parse_args(int argc, char *argv[]) {
326 int i = optind; 326 int i = optind;
327 while (i < argc) { 327 while (i < argc) {
328 if (!strcmp("timeout", argv[i])) { 328 if (!strcmp("timeout", argv[i])) {
329 wlr_log(L_DEBUG, "Got timeout"); 329 wlr_log(WLR_DEBUG, "Got timeout");
330 i += parse_timeout(argc - i, &argv[i]); 330 i += parse_timeout(argc - i, &argv[i]);
331 } else if (!strcmp("before-sleep", argv[i])) { 331 } else if (!strcmp("before-sleep", argv[i])) {
332 wlr_log(L_DEBUG, "Got before-sleep"); 332 wlr_log(WLR_DEBUG, "Got before-sleep");
333 i += parse_sleep(argc - i, &argv[i]); 333 i += parse_sleep(argc - i, &argv[i]);
334 } else { 334 } else {
335 wlr_log(L_ERROR, "Unsupported command '%s'", argv[i]); 335 wlr_log(WLR_ERROR, "Unsupported command '%s'", argv[i]);
336 exit(-1); 336 exit(-1);
337 } 337 }
338 } 338 }
@@ -358,7 +358,7 @@ static int display_event(int fd, uint32_t mask, void *data) {
358 sway_terminate(0); 358 sway_terminate(0);
359 } 359 }
360 if (wl_display_dispatch(state.display) < 0) { 360 if (wl_display_dispatch(state.display) < 0) {
361 wlr_log_errno(L_ERROR, "wl_display_dispatch failed, exiting"); 361 wlr_log_errno(WLR_ERROR, "wl_display_dispatch failed, exiting");
362 sway_terminate(0); 362 sway_terminate(0);
363 }; 363 };
364 return 0; 364 return 0;
@@ -367,7 +367,7 @@ static int display_event(int fd, uint32_t mask, void *data) {
367void register_idle_timeout(void *item) { 367void register_idle_timeout(void *item) {
368 struct swayidle_timeout_cmd *cmd = item; 368 struct swayidle_timeout_cmd *cmd = item;
369 if (cmd == NULL || !cmd->timeout) { 369 if (cmd == NULL || !cmd->timeout) {
370 wlr_log(L_ERROR, "Invalid idle cmd, will not register"); 370 wlr_log(WLR_ERROR, "Invalid idle cmd, will not register");
371 return; 371 return;
372 } 372 }
373 state.idle_timer = 373 state.idle_timer =
@@ -376,7 +376,7 @@ void register_idle_timeout(void *item) {
376 org_kde_kwin_idle_timeout_add_listener(state.idle_timer, 376 org_kde_kwin_idle_timeout_add_listener(state.idle_timer,
377 &idle_timer_listener, cmd); 377 &idle_timer_listener, cmd);
378 } else { 378 } else {
379 wlr_log(L_ERROR, "Could not create idle timer"); 379 wlr_log(WLR_ERROR, "Could not create idle timer");
380 } 380 }
381} 381}
382 382
@@ -390,7 +390,7 @@ int main(int argc, char *argv[]) {
390 390
391 state.display = wl_display_connect(NULL); 391 state.display = wl_display_connect(NULL);
392 if (state.display == NULL) { 392 if (state.display == NULL) {
393 wlr_log(L_ERROR, "Failed to create display"); 393 wlr_log(WLR_ERROR, "Failed to create display");
394 return -3; 394 return -3;
395 } 395 }
396 396
@@ -401,11 +401,11 @@ int main(int argc, char *argv[]) {
401 state.event_loop = wl_event_loop_create(); 401 state.event_loop = wl_event_loop_create();
402 402
403 if (idle_manager == NULL) { 403 if (idle_manager == NULL) {
404 wlr_log(L_ERROR, "Display doesn't support idle protocol"); 404 wlr_log(WLR_ERROR, "Display doesn't support idle protocol");
405 return -4; 405 return -4;
406 } 406 }
407 if (seat == NULL) { 407 if (seat == NULL) {
408 wlr_log(L_ERROR, "Seat error"); 408 wlr_log(WLR_ERROR, "Seat error");
409 return -5; 409 return -5;
410 } 410 }
411 411
@@ -417,7 +417,7 @@ int main(int argc, char *argv[]) {
417 } 417 }
418#endif 418#endif
419 if (!should_run) { 419 if (!should_run) {
420 wlr_log(L_INFO, "No command specified! Nothing to do, will exit"); 420 wlr_log(WLR_INFO, "No command specified! Nothing to do, will exit");
421 sway_terminate(0); 421 sway_terminate(0);
422 } 422 }
423 list_foreach(state.timeout_cmds, register_idle_timeout); 423 list_foreach(state.timeout_cmds, register_idle_timeout);
diff --git a/swaylock/main.c b/swaylock/main.c
index 73c2b5d6..68d67a10 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -34,7 +34,7 @@ void sway_terminate(int exit_code) {
34static void daemonize() { 34static void daemonize() {
35 int fds[2]; 35 int fds[2];
36 if (pipe(fds) != 0) { 36 if (pipe(fds) != 0) {
37 wlr_log(L_ERROR, "Failed to pipe"); 37 wlr_log(WLR_ERROR, "Failed to pipe");
38 exit(1); 38 exit(1);
39 } 39 }
40 if (fork() == 0) { 40 if (fork() == 0) {
@@ -58,7 +58,7 @@ static void daemonize() {
58 close(fds[1]); 58 close(fds[1]);
59 uint8_t success; 59 uint8_t success;
60 if (read(fds[0], &success, 1) != 1 || !success) { 60 if (read(fds[0], &success, 1) != 1 || !success) {
61 wlr_log(L_ERROR, "Failed to daemonize"); 61 wlr_log(WLR_ERROR, "Failed to daemonize");
62 exit(1); 62 exit(1);
63 } 63 }
64 close(fds[0]); 64 close(fds[0]);
@@ -238,7 +238,7 @@ static void handle_xdg_output_logical_position(void *data,
238 238
239static void handle_xdg_output_name(void *data, struct zxdg_output_v1 *output, 239static void handle_xdg_output_name(void *data, struct zxdg_output_v1 *output,
240 const char *name) { 240 const char *name) {
241 wlr_log(L_DEBUG, "output name is %s", name); 241 wlr_log(WLR_DEBUG, "output name is %s", name);
242 struct swaylock_surface *surface = data; 242 struct swaylock_surface *surface = data;
243 surface->xdg_output = output; 243 surface->xdg_output = output;
244 surface->output_name = strdup(name); 244 surface->output_name = strdup(name);
@@ -354,10 +354,10 @@ static void load_image(char *arg, struct swaylock_state *state) {
354 } 354 }
355 if (exists) { 355 if (exists) {
356 if (image->output_name) { 356 if (image->output_name) {
357 wlr_log(L_ERROR, "Multiple images defined for output %s", 357 wlr_log(WLR_ERROR, "Multiple images defined for output %s",
358 image->output_name); 358 image->output_name);
359 } else { 359 } else {
360 wlr_log(L_ERROR, "Multiple default images defined"); 360 wlr_log(WLR_ERROR, "Multiple default images defined");
361 } 361 }
362 } 362 }
363 363
@@ -377,7 +377,7 @@ static void load_image(char *arg, struct swaylock_state *state) {
377 } 377 }
378 wl_list_insert(&state->images, &image->link); 378 wl_list_insert(&state->images, &image->link);
379 state->args.mode = BACKGROUND_MODE_FILL; 379 state->args.mode = BACKGROUND_MODE_FILL;
380 wlr_log(L_DEBUG, "Loaded image %s for output %s", 380 wlr_log(WLR_DEBUG, "Loaded image %s for output %s",
381 image->path, image->output_name ? image->output_name : "*"); 381 image->path, image->output_name ? image->output_name : "*");
382} 382}
383 383
@@ -416,7 +416,7 @@ int main(int argc, char **argv) {
416 }; 416 };
417 wl_list_init(&state.images); 417 wl_list_init(&state.images);
418 418
419 wlr_log_init(L_DEBUG, NULL); 419 wlr_log_init(WLR_DEBUG, NULL);
420 420
421 int c; 421 int c;
422 while (1) { 422 while (1) {
@@ -480,13 +480,13 @@ int main(int argc, char **argv) {
480 wl_display_roundtrip(state.display); 480 wl_display_roundtrip(state.display);
481 assert(state.compositor && state.layer_shell && state.shm); 481 assert(state.compositor && state.layer_shell && state.shm);
482 if (!state.input_inhibit_manager) { 482 if (!state.input_inhibit_manager) {
483 wlr_log(L_ERROR, "Compositor does not support the input inhibitor " 483 wlr_log(WLR_ERROR, "Compositor does not support the input inhibitor "
484 "protocol, refusing to run insecurely"); 484 "protocol, refusing to run insecurely");
485 return 1; 485 return 1;
486 } 486 }
487 487
488 if (wl_list_empty(&state.surfaces)) { 488 if (wl_list_empty(&state.surfaces)) {
489 wlr_log(L_DEBUG, "Exiting - no outputs to show on."); 489 wlr_log(WLR_DEBUG, "Exiting - no outputs to show on.");
490 return 0; 490 return 0;
491 } 491 }
492 492
@@ -502,7 +502,7 @@ int main(int argc, char **argv) {
502 } 502 }
503 wl_display_roundtrip(state.display); 503 wl_display_roundtrip(state.display);
504 } else { 504 } else {
505 wlr_log(L_INFO, "Compositor does not support zxdg output manager, " 505 wlr_log(WLR_INFO, "Compositor does not support zxdg output manager, "
506 "images assigned to named outputs will not work"); 506 "images assigned to named outputs will not work");
507 } 507 }
508 508
diff --git a/swaylock/password.c b/swaylock/password.c
index d844ec98..7c6fd67b 100644
--- a/swaylock/password.c
+++ b/swaylock/password.c
@@ -53,15 +53,15 @@ static bool attempt_password(struct swaylock_password *pw) {
53 // TODO: only call pam_start once. keep the same handle the whole time 53 // TODO: only call pam_start once. keep the same handle the whole time
54 if ((pam_err = pam_start("swaylock", username, 54 if ((pam_err = pam_start("swaylock", username,
55 &local_conversation, &local_auth_handle)) != PAM_SUCCESS) { 55 &local_conversation, &local_auth_handle)) != PAM_SUCCESS) {
56 wlr_log(L_ERROR, "PAM returned error %d", pam_err); 56 wlr_log(WLR_ERROR, "PAM returned error %d", pam_err);
57 } 57 }
58 if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) { 58 if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) {
59 wlr_log(L_ERROR, "pam_authenticate failed"); 59 wlr_log(WLR_ERROR, "pam_authenticate failed");
60 goto fail; 60 goto fail;
61 } 61 }
62 // TODO: only call pam_end once we succeed at authing. refresh tokens beforehand 62 // TODO: only call pam_end once we succeed at authing. refresh tokens beforehand
63 if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) { 63 if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) {
64 wlr_log(L_ERROR, "pam_end failed"); 64 wlr_log(WLR_ERROR, "pam_end failed");
65 goto fail; 65 goto fail;
66 } 66 }
67 clear_password_buffer(pw); 67 clear_password_buffer(pw);
diff --git a/swaylock/seat.c b/swaylock/seat.c
index 6c66d220..c2630d87 100644
--- a/swaylock/seat.c
+++ b/swaylock/seat.c
@@ -12,13 +12,13 @@ static void keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
12 struct swaylock_state *state = data; 12 struct swaylock_state *state = data;
13 if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { 13 if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
14 close(fd); 14 close(fd);
15 wlr_log(L_ERROR, "Unknown keymap format %d, aborting", format); 15 wlr_log(WLR_ERROR, "Unknown keymap format %d, aborting", format);
16 exit(1); 16 exit(1);
17 } 17 }
18 char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); 18 char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
19 if (map_shm == MAP_FAILED) { 19 if (map_shm == MAP_FAILED) {
20 close(fd); 20 close(fd);
21 wlr_log(L_ERROR, "Unable to initialize keymap shm, aborting"); 21 wlr_log(WLR_ERROR, "Unable to initialize keymap shm, aborting");
22 exit(1); 22 exit(1);
23 } 23 }
24 struct xkb_keymap *keymap = xkb_keymap_new_from_string( 24 struct xkb_keymap *keymap = xkb_keymap_new_from_string(
diff --git a/swaymsg/main.c b/swaymsg/main.c
index 4283bf00..542ca819 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -323,7 +323,7 @@ int main(int argc, char **argv) {
323 char *socket_path = NULL; 323 char *socket_path = NULL;
324 char *cmdtype = NULL; 324 char *cmdtype = NULL;
325 325
326 wlr_log_init(L_INFO, NULL); 326 wlr_log_init(WLR_INFO, NULL);
327 327
328 static struct option long_options[] = { 328 static struct option long_options[] = {
329 {"help", no_argument, NULL, 'h'}, 329 {"help", no_argument, NULL, 'h'},