diff options
Diffstat (limited to 'sway')
82 files changed, 353 insertions, 356 deletions
diff --git a/sway/commands.c b/sway/commands.c index 6f786035..f92a5e46 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -142,7 +142,7 @@ struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers, | |||
142 | int handlers_size) { | 142 | int handlers_size) { |
143 | struct cmd_handler d = { .command=line }; | 143 | struct cmd_handler d = { .command=line }; |
144 | struct cmd_handler *res = NULL; | 144 | struct cmd_handler *res = NULL; |
145 | wlr_log(WLR_DEBUG, "find_handler(%s)", line); | 145 | sway_log(SWAY_DEBUG, "find_handler(%s)", line); |
146 | 146 | ||
147 | bool config_loading = config->reading || !config->active; | 147 | bool config_loading = config->reading || !config->active; |
148 | 148 | ||
@@ -247,10 +247,10 @@ list_t *execute_command(char *_exec, struct sway_seat *seat, | |||
247 | cmd = argsep(&cmdlist, ","); | 247 | cmd = argsep(&cmdlist, ","); |
248 | for (; isspace(*cmd); ++cmd) {} | 248 | for (; isspace(*cmd); ++cmd) {} |
249 | if (strcmp(cmd, "") == 0) { | 249 | if (strcmp(cmd, "") == 0) { |
250 | wlr_log(WLR_INFO, "Ignoring empty command."); | 250 | sway_log(SWAY_INFO, "Ignoring empty command."); |
251 | continue; | 251 | continue; |
252 | } | 252 | } |
253 | wlr_log(WLR_INFO, "Handling command '%s'", cmd); | 253 | sway_log(SWAY_INFO, "Handling command '%s'", cmd); |
254 | //TODO better handling of argv | 254 | //TODO better handling of argv |
255 | int argc; | 255 | int argc; |
256 | char **argv = split_args(cmd, &argc); | 256 | char **argv = split_args(cmd, &argc); |
@@ -353,7 +353,7 @@ struct cmd_results *config_command(char *exec, char **new_block) { | |||
353 | } | 353 | } |
354 | 354 | ||
355 | // Determine the command handler | 355 | // Determine the command handler |
356 | wlr_log(WLR_INFO, "Config command: %s", exec); | 356 | sway_log(SWAY_INFO, "Config command: %s", exec); |
357 | struct cmd_handler *handler = find_handler(argv[0], NULL, 0); | 357 | struct cmd_handler *handler = find_handler(argv[0], NULL, 0); |
358 | if (!handler || !handler->handle) { | 358 | if (!handler || !handler->handle) { |
359 | const char *error = handler | 359 | const char *error = handler |
@@ -373,7 +373,7 @@ struct cmd_results *config_command(char *exec, char **new_block) { | |||
373 | argv[1] = temp; | 373 | argv[1] = temp; |
374 | } | 374 | } |
375 | char *command = do_var_replacement(join_args(argv, argc)); | 375 | char *command = do_var_replacement(join_args(argv, argc)); |
376 | wlr_log(WLR_INFO, "After replacement: %s", command); | 376 | sway_log(SWAY_INFO, "After replacement: %s", command); |
377 | free_argv(argc, argv); | 377 | free_argv(argc, argv); |
378 | argv = split_args(command, &argc); | 378 | argv = split_args(command, &argc); |
379 | free(command); | 379 | free(command); |
@@ -402,7 +402,7 @@ cleanup: | |||
402 | struct cmd_results *config_subcommand(char **argv, int argc, | 402 | struct cmd_results *config_subcommand(char **argv, int argc, |
403 | struct cmd_handler *handlers, size_t handlers_size) { | 403 | struct cmd_handler *handlers, size_t handlers_size) { |
404 | char *command = join_args(argv, argc); | 404 | char *command = join_args(argv, argc); |
405 | wlr_log(WLR_DEBUG, "Subcommand: %s", command); | 405 | sway_log(SWAY_DEBUG, "Subcommand: %s", command); |
406 | free(command); | 406 | free(command); |
407 | 407 | ||
408 | struct cmd_handler *handler = find_handler(argv[0], handlers, | 408 | struct cmd_handler *handler = find_handler(argv[0], handlers, |
@@ -489,7 +489,7 @@ struct cmd_results *config_commands_command(char *exec) { | |||
489 | } | 489 | } |
490 | policy->context = context; | 490 | policy->context = context; |
491 | 491 | ||
492 | wlr_log(WLR_INFO, "Set command policy for %s to %d", | 492 | sway_log(SWAY_INFO, "Set command policy for %s to %d", |
493 | policy->command, policy->context); | 493 | policy->command, policy->context); |
494 | 494 | ||
495 | results = cmd_results_new(CMD_SUCCESS, NULL); | 495 | results = cmd_results_new(CMD_SUCCESS, NULL); |
@@ -503,7 +503,7 @@ struct cmd_results *cmd_results_new(enum cmd_status status, | |||
503 | const char *format, ...) { | 503 | const char *format, ...) { |
504 | struct cmd_results *results = malloc(sizeof(struct cmd_results)); | 504 | struct cmd_results *results = malloc(sizeof(struct cmd_results)); |
505 | if (!results) { | 505 | if (!results) { |
506 | wlr_log(WLR_ERROR, "Unable to allocate command results"); | 506 | sway_log(SWAY_ERROR, "Unable to allocate command results"); |
507 | return NULL; | 507 | return NULL; |
508 | } | 508 | } |
509 | results->status = status; | 509 | results->status = status; |
diff --git a/sway/commands/assign.c b/sway/commands/assign.c index 3bd1f65d..976bc3cc 100644 --- a/sway/commands/assign.c +++ b/sway/commands/assign.c | |||
@@ -56,7 +56,7 @@ struct cmd_results *cmd_assign(int argc, char **argv) { | |||
56 | criteria->target = join_args(argv, argc); | 56 | criteria->target = join_args(argv, argc); |
57 | 57 | ||
58 | list_add(config->criteria, criteria); | 58 | list_add(config->criteria, criteria); |
59 | wlr_log(WLR_DEBUG, "assign: '%s' -> '%s' added", criteria->raw, | 59 | sway_log(SWAY_DEBUG, "assign: '%s' -> '%s' added", criteria->raw, |
60 | criteria->target); | 60 | criteria->target); |
61 | 61 | ||
62 | return cmd_results_new(CMD_SUCCESS, NULL); | 62 | return cmd_results_new(CMD_SUCCESS, NULL); |
diff --git a/sway/commands/bar.c b/sway/commands/bar.c index 2cfc538f..e9360603 100644 --- a/sway/commands/bar.c +++ b/sway/commands/bar.c | |||
@@ -1,9 +1,9 @@ | |||
1 | #define _POSIX_C_SOURCE 200809 | 1 | #define _POSIX_C_SOURCE 200809 |
2 | #include <string.h> | 2 | #include <string.h> |
3 | #include <strings.h> | 3 | #include <strings.h> |
4 | #include <wlr/util/log.h> | ||
5 | #include "sway/commands.h" | 4 | #include "sway/commands.h" |
6 | #include "sway/config.h" | 5 | #include "sway/config.h" |
6 | #include "log.h" | ||
7 | #include "util.h" | 7 | #include "util.h" |
8 | 8 | ||
9 | // Must be in alphabetical order for bsearch | 9 | // Must be in alphabetical order for bsearch |
@@ -60,14 +60,14 @@ struct cmd_results *cmd_bar(int argc, char **argv) { | |||
60 | for (int i = 0; i < config->bars->length; ++i) { | 60 | for (int i = 0; i < config->bars->length; ++i) { |
61 | struct bar_config *item = config->bars->items[i]; | 61 | struct bar_config *item = config->bars->items[i]; |
62 | if (strcmp(item->id, argv[0]) == 0) { | 62 | if (strcmp(item->id, argv[0]) == 0) { |
63 | wlr_log(WLR_DEBUG, "Selecting bar: %s", argv[0]); | 63 | sway_log(SWAY_DEBUG, "Selecting bar: %s", argv[0]); |
64 | bar = item; | 64 | bar = item; |
65 | break; | 65 | break; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | if (!bar) { | 68 | if (!bar) { |
69 | spawn = !config->reading; | 69 | spawn = !config->reading; |
70 | wlr_log(WLR_DEBUG, "Creating bar: %s", argv[0]); | 70 | sway_log(SWAY_DEBUG, "Creating bar: %s", argv[0]); |
71 | bar = default_bar_config(); | 71 | bar = default_bar_config(); |
72 | if (!bar) { | 72 | if (!bar) { |
73 | return cmd_results_new(CMD_FAILURE, | 73 | return cmd_results_new(CMD_FAILURE, |
@@ -99,7 +99,7 @@ struct cmd_results *cmd_bar(int argc, char **argv) { | |||
99 | 99 | ||
100 | // Set current bar | 100 | // Set current bar |
101 | config->current_bar = bar; | 101 | config->current_bar = bar; |
102 | wlr_log(WLR_DEBUG, "Creating bar %s", bar->id); | 102 | sway_log(SWAY_DEBUG, "Creating bar %s", bar->id); |
103 | } | 103 | } |
104 | 104 | ||
105 | if (find_handler(argv[0], bar_config_handlers, | 105 | if (find_handler(argv[0], bar_config_handlers, |
diff --git a/sway/commands/bar/bind.c b/sway/commands/bar/bind.c index 4b0be804..17030a05 100644 --- a/sway/commands/bar/bind.c +++ b/sway/commands/bar/bind.c | |||
@@ -59,7 +59,7 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) { | |||
59 | overwritten = true; | 59 | overwritten = true; |
60 | bindings->items[i] = binding; | 60 | bindings->items[i] = binding; |
61 | free_bar_binding(other); | 61 | free_bar_binding(other); |
62 | wlr_log(WLR_DEBUG, "[bar %s] Updated binding for %u (%s)%s", | 62 | sway_log(SWAY_DEBUG, "[bar %s] Updated binding for %u (%s)%s", |
63 | config->current_bar->id, binding->button, name, | 63 | config->current_bar->id, binding->button, name, |
64 | binding->release ? " - release" : ""); | 64 | binding->release ? " - release" : ""); |
65 | break; | 65 | break; |
@@ -67,7 +67,7 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) { | |||
67 | } | 67 | } |
68 | if (!overwritten) { | 68 | if (!overwritten) { |
69 | list_add(bindings, binding); | 69 | list_add(bindings, binding); |
70 | wlr_log(WLR_DEBUG, "[bar %s] Added binding for %u (%s)%s", | 70 | sway_log(SWAY_DEBUG, "[bar %s] Added binding for %u (%s)%s", |
71 | config->current_bar->id, binding->button, name, | 71 | config->current_bar->id, binding->button, name, |
72 | binding->release ? " - release" : ""); | 72 | binding->release ? " - release" : ""); |
73 | } | 73 | } |
diff --git a/sway/commands/bar/binding_mode_indicator.c b/sway/commands/bar/binding_mode_indicator.c index 15acc309..29c93ddc 100644 --- a/sway/commands/bar/binding_mode_indicator.c +++ b/sway/commands/bar/binding_mode_indicator.c | |||
@@ -16,10 +16,10 @@ struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) { | |||
16 | config->current_bar->binding_mode_indicator = | 16 | config->current_bar->binding_mode_indicator = |
17 | parse_boolean(argv[0], config->current_bar->binding_mode_indicator); | 17 | parse_boolean(argv[0], config->current_bar->binding_mode_indicator); |
18 | if (config->current_bar->binding_mode_indicator) { | 18 | if (config->current_bar->binding_mode_indicator) { |
19 | wlr_log(WLR_DEBUG, "Enabling binding mode indicator on bar: %s", | 19 | sway_log(SWAY_DEBUG, "Enabling binding mode indicator on bar: %s", |
20 | config->current_bar->id); | 20 | config->current_bar->id); |
21 | } else { | 21 | } else { |
22 | wlr_log(WLR_DEBUG, "Disabling binding mode indicator on bar: %s", | 22 | sway_log(SWAY_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_SUCCESS, NULL); | 25 | return cmd_results_new(CMD_SUCCESS, NULL); |
diff --git a/sway/commands/bar/font.c b/sway/commands/bar/font.c index c6147e3d..cf1f759e 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(WLR_DEBUG, "Settings font '%s' for bar: %s", | 18 | sway_log(SWAY_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); | 20 | return cmd_results_new(CMD_SUCCESS, NULL); |
21 | } | 21 | } |
diff --git a/sway/commands/bar/gaps.c b/sway/commands/bar/gaps.c index fabe12fc..83480fb5 100644 --- a/sway/commands/bar/gaps.c +++ b/sway/commands/bar/gaps.c | |||
@@ -47,7 +47,7 @@ struct cmd_results *bar_cmd_gaps(int argc, char **argv) { | |||
47 | config->current_bar->gaps.bottom = bottom; | 47 | config->current_bar->gaps.bottom = bottom; |
48 | config->current_bar->gaps.left = left; | 48 | config->current_bar->gaps.left = left; |
49 | 49 | ||
50 | wlr_log(WLR_DEBUG, "Setting bar gaps to %d %d %d %d on bar: %s", | 50 | sway_log(SWAY_DEBUG, "Setting bar gaps to %d %d %d %d on bar: %s", |
51 | config->current_bar->gaps.top, config->current_bar->gaps.right, | 51 | config->current_bar->gaps.top, config->current_bar->gaps.right, |
52 | config->current_bar->gaps.bottom, config->current_bar->gaps.left, | 52 | config->current_bar->gaps.bottom, config->current_bar->gaps.left, |
53 | config->current_bar->id); | 53 | config->current_bar->id); |
diff --git a/sway/commands/bar/height.c b/sway/commands/bar/height.c index a2e72533..945eb707 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(WLR_DEBUG, "Setting bar height to %d on bar: %s", | 17 | sway_log(SWAY_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); | 19 | return cmd_results_new(CMD_SUCCESS, NULL); |
20 | } | 20 | } |
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c index 3364ce70..b2c2d245 100644 --- a/sway/commands/bar/hidden_state.c +++ b/sway/commands/bar/hidden_state.c | |||
@@ -26,7 +26,7 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar, | |||
26 | if (!config->reading) { | 26 | if (!config->reading) { |
27 | ipc_event_barconfig_update(bar); | 27 | ipc_event_barconfig_update(bar); |
28 | } | 28 | } |
29 | wlr_log(WLR_DEBUG, "Setting hidden_state: '%s' for bar: %s", | 29 | sway_log(SWAY_DEBUG, "Setting hidden_state: '%s' for bar: %s", |
30 | bar->hidden_state, bar->id); | 30 | bar->hidden_state, bar->id); |
31 | } | 31 | } |
32 | // free old mode | 32 | // free old mode |
diff --git a/sway/commands/bar/icon_theme.c b/sway/commands/bar/icon_theme.c index 2d16f748..54b7b16e 100644 --- a/sway/commands/bar/icon_theme.c +++ b/sway/commands/bar/icon_theme.c | |||
@@ -16,7 +16,7 @@ struct cmd_results *bar_cmd_icon_theme(int argc, char **argv) { | |||
16 | return cmd_results_new(CMD_FAILURE, "No bar defined."); | 16 | return cmd_results_new(CMD_FAILURE, "No bar defined."); |
17 | } | 17 | } |
18 | 18 | ||
19 | wlr_log(WLR_DEBUG, "[Bar %s] Setting icon theme to %s", | 19 | sway_log(SWAY_DEBUG, "[Bar %s] Setting icon theme to %s", |
20 | config->current_bar->id, argv[0]); | 20 | config->current_bar->id, argv[0]); |
21 | free(config->current_bar->icon_theme); | 21 | free(config->current_bar->icon_theme); |
22 | config->current_bar->icon_theme = strdup(argv[0]); | 22 | config->current_bar->icon_theme = strdup(argv[0]); |
diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c index bef3023b..a9a61743 100644 --- a/sway/commands/bar/id.c +++ b/sway/commands/bar/id.c | |||
@@ -26,7 +26,7 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) { | |||
26 | } | 26 | } |
27 | } | 27 | } |
28 | 28 | ||
29 | wlr_log(WLR_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name); | 29 | sway_log(SWAY_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name); |
30 | 30 | ||
31 | // free old bar id | 31 | // free old bar id |
32 | free(config->current_bar->id); | 32 | free(config->current_bar->id); |
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c index 1698db8d..d89ddf24 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(WLR_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); | 31 | sway_log(SWAY_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 0d28d6a2..62ec681f 100644 --- a/sway/commands/bar/modifier.c +++ b/sway/commands/bar/modifier.c | |||
@@ -29,7 +29,7 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) { | |||
29 | } | 29 | } |
30 | list_free_items_and_destroy(split); | 30 | list_free_items_and_destroy(split); |
31 | config->current_bar->modifier = mod; | 31 | config->current_bar->modifier = mod; |
32 | wlr_log(WLR_DEBUG, | 32 | sway_log(SWAY_DEBUG, |
33 | "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]); | 33 | "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]); |
34 | return cmd_results_new(CMD_SUCCESS, NULL); | 34 | return cmd_results_new(CMD_SUCCESS, NULL); |
35 | } | 35 | } |
diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c index 9ad10678..956c1959 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(WLR_DEBUG, "Adding bar: '%s' to output '%s'", | 45 | sway_log(SWAY_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); | 48 | return cmd_results_new(CMD_SUCCESS, NULL); |
diff --git a/sway/commands/bar/pango_markup.c b/sway/commands/bar/pango_markup.c index 0ffa41d9..b0958cf1 100644 --- a/sway/commands/bar/pango_markup.c +++ b/sway/commands/bar/pango_markup.c | |||
@@ -15,10 +15,10 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) { | |||
15 | config->current_bar->pango_markup | 15 | config->current_bar->pango_markup |
16 | = parse_boolean(argv[0], config->current_bar->pango_markup); | 16 | = parse_boolean(argv[0], config->current_bar->pango_markup); |
17 | if (config->current_bar->pango_markup) { | 17 | if (config->current_bar->pango_markup) { |
18 | wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s", | 18 | sway_log(SWAY_DEBUG, "Enabling pango markup for bar: %s", |
19 | config->current_bar->id); | 19 | config->current_bar->id); |
20 | } else { | 20 | } else { |
21 | wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s", | 21 | sway_log(SWAY_DEBUG, "Disabling pango markup for bar: %s", |
22 | config->current_bar->id); | 22 | config->current_bar->id); |
23 | } | 23 | } |
24 | return cmd_results_new(CMD_SUCCESS, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL); |
diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c index 2e3f79b4..4456d724 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" }; | 15 | char *valid[] = { "top", "bottom" }; |
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(WLR_DEBUG, "Setting bar position '%s' for bar: %s", | 18 | sway_log(SWAY_DEBUG, "Setting bar position '%s' for bar: %s", |
19 | argv[0], config->current_bar->id); | 19 | argv[0], config->current_bar->id); |
20 | free(config->current_bar->position); | 20 | free(config->current_bar->position); |
21 | config->current_bar->position = strdup(argv[0]); | 21 | config->current_bar->position = strdup(argv[0]); |
diff --git a/sway/commands/bar/separator_symbol.c b/sway/commands/bar/separator_symbol.c index 145cdea5..76e99b49 100644 --- a/sway/commands/bar/separator_symbol.c +++ b/sway/commands/bar/separator_symbol.c | |||
@@ -13,7 +13,7 @@ struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) { | |||
13 | } | 13 | } |
14 | free(config->current_bar->separator_symbol); | 14 | free(config->current_bar->separator_symbol); |
15 | config->current_bar->separator_symbol = strdup(argv[0]); | 15 | config->current_bar->separator_symbol = strdup(argv[0]); |
16 | wlr_log(WLR_DEBUG, "Settings separator_symbol '%s' for bar: %s", | 16 | sway_log(SWAY_DEBUG, "Settings separator_symbol '%s' for bar: %s", |
17 | config->current_bar->separator_symbol, config->current_bar->id); | 17 | config->current_bar->separator_symbol, config->current_bar->id); |
18 | return cmd_results_new(CMD_SUCCESS, NULL); | 18 | return cmd_results_new(CMD_SUCCESS, NULL); |
19 | } | 19 | } |
diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c index c379cc72..0b58e5fa 100644 --- a/sway/commands/bar/status_command.c +++ b/sway/commands/bar/status_command.c | |||
@@ -17,7 +17,7 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) { | |||
17 | char *new_command = join_args(argv, argc); | 17 | char *new_command = join_args(argv, argc); |
18 | if (strcmp(new_command, "-") != 0) { | 18 | if (strcmp(new_command, "-") != 0) { |
19 | config->current_bar->status_command = new_command; | 19 | config->current_bar->status_command = new_command; |
20 | wlr_log(WLR_DEBUG, "Feeding bar with status command: %s", | 20 | sway_log(SWAY_DEBUG, "Feeding bar with status command: %s", |
21 | config->current_bar->status_command); | 21 | config->current_bar->status_command); |
22 | } else { | 22 | } else { |
23 | free(new_command); | 23 | free(new_command); |
diff --git a/sway/commands/bar/status_edge_padding.c b/sway/commands/bar/status_edge_padding.c index 565ab9a9..75ef86f0 100644 --- a/sway/commands/bar/status_edge_padding.c +++ b/sway/commands/bar/status_edge_padding.c | |||
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_status_edge_padding(int argc, char **argv) { | |||
15 | "Padding must be a positive integer"); | 15 | "Padding must be a positive integer"); |
16 | } | 16 | } |
17 | config->current_bar->status_edge_padding = padding; | 17 | config->current_bar->status_edge_padding = padding; |
18 | wlr_log(WLR_DEBUG, "Status edge padding on bar %s: %d", | 18 | sway_log(SWAY_DEBUG, "Status edge padding on bar %s: %d", |
19 | config->current_bar->id, config->current_bar->status_edge_padding); | 19 | config->current_bar->id, config->current_bar->status_edge_padding); |
20 | return cmd_results_new(CMD_SUCCESS, NULL); | 20 | return cmd_results_new(CMD_SUCCESS, NULL); |
21 | } | 21 | } |
diff --git a/sway/commands/bar/status_padding.c b/sway/commands/bar/status_padding.c index 7a69a25d..0c65e516 100644 --- a/sway/commands/bar/status_padding.c +++ b/sway/commands/bar/status_padding.c | |||
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_status_padding(int argc, char **argv) { | |||
15 | "Padding must be a positive integer"); | 15 | "Padding must be a positive integer"); |
16 | } | 16 | } |
17 | config->current_bar->status_padding = padding; | 17 | config->current_bar->status_padding = padding; |
18 | wlr_log(WLR_DEBUG, "Status padding on bar %s: %d", | 18 | sway_log(SWAY_DEBUG, "Status padding on bar %s: %d", |
19 | config->current_bar->id, config->current_bar->status_padding); | 19 | config->current_bar->id, config->current_bar->status_padding); |
20 | return cmd_results_new(CMD_SUCCESS, NULL); | 20 | return cmd_results_new(CMD_SUCCESS, NULL); |
21 | } | 21 | } |
diff --git a/sway/commands/bar/strip_workspace_name.c b/sway/commands/bar/strip_workspace_name.c index b74afd6e..1aa39359 100644 --- a/sway/commands/bar/strip_workspace_name.c +++ b/sway/commands/bar/strip_workspace_name.c | |||
@@ -20,10 +20,10 @@ struct cmd_results *bar_cmd_strip_workspace_name(int argc, char **argv) { | |||
20 | if (config->current_bar->strip_workspace_name) { | 20 | if (config->current_bar->strip_workspace_name) { |
21 | config->current_bar->strip_workspace_numbers = false; | 21 | config->current_bar->strip_workspace_numbers = false; |
22 | 22 | ||
23 | wlr_log(WLR_DEBUG, "Stripping workspace name on bar: %s", | 23 | sway_log(SWAY_DEBUG, "Stripping workspace name on bar: %s", |
24 | config->current_bar->id); | 24 | config->current_bar->id); |
25 | } else { | 25 | } else { |
26 | wlr_log(WLR_DEBUG, "Enabling workspace name on bar: %s", | 26 | sway_log(SWAY_DEBUG, "Enabling workspace name on bar: %s", |
27 | config->current_bar->id); | 27 | config->current_bar->id); |
28 | } | 28 | } |
29 | 29 | ||
diff --git a/sway/commands/bar/strip_workspace_numbers.c b/sway/commands/bar/strip_workspace_numbers.c index 9c6ec228..56c4c4a1 100644 --- a/sway/commands/bar/strip_workspace_numbers.c +++ b/sway/commands/bar/strip_workspace_numbers.c | |||
@@ -20,10 +20,10 @@ struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) { | |||
20 | if (config->current_bar->strip_workspace_numbers) { | 20 | if (config->current_bar->strip_workspace_numbers) { |
21 | config->current_bar->strip_workspace_name = false; | 21 | config->current_bar->strip_workspace_name = false; |
22 | 22 | ||
23 | wlr_log(WLR_DEBUG, "Stripping workspace numbers on bar: %s", | 23 | sway_log(SWAY_DEBUG, "Stripping workspace numbers on bar: %s", |
24 | config->current_bar->id); | 24 | config->current_bar->id); |
25 | } else { | 25 | } else { |
26 | wlr_log(WLR_DEBUG, "Enabling workspace numbers on bar: %s", | 26 | sway_log(SWAY_DEBUG, "Enabling workspace numbers on bar: %s", |
27 | config->current_bar->id); | 27 | config->current_bar->id); |
28 | } | 28 | } |
29 | 29 | ||
diff --git a/sway/commands/bar/swaybar_command.c b/sway/commands/bar/swaybar_command.c index 6253e2b1..b54bafa9 100644 --- a/sway/commands/bar/swaybar_command.c +++ b/sway/commands/bar/swaybar_command.c | |||
@@ -13,7 +13,7 @@ struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) { | |||
13 | } | 13 | } |
14 | free(config->current_bar->swaybar_command); | 14 | free(config->current_bar->swaybar_command); |
15 | config->current_bar->swaybar_command = join_args(argv, argc); | 15 | config->current_bar->swaybar_command = join_args(argv, argc); |
16 | wlr_log(WLR_DEBUG, "Using custom swaybar command: %s", | 16 | sway_log(SWAY_DEBUG, "Using custom swaybar command: %s", |
17 | config->current_bar->swaybar_command); | 17 | config->current_bar->swaybar_command); |
18 | return cmd_results_new(CMD_SUCCESS, NULL); | 18 | return cmd_results_new(CMD_SUCCESS, NULL); |
19 | } | 19 | } |
diff --git a/sway/commands/bar/tray_bind.c b/sway/commands/bar/tray_bind.c index 48a15462..7fe67c42 100644 --- a/sway/commands/bar/tray_bind.c +++ b/sway/commands/bar/tray_bind.c | |||
@@ -67,7 +67,7 @@ static struct cmd_results *tray_bind(int argc, char **argv, bool code) { | |||
67 | other->command = binding->command; | 67 | other->command = binding->command; |
68 | free(binding); | 68 | free(binding); |
69 | binding = other; | 69 | binding = other; |
70 | wlr_log(WLR_DEBUG, | 70 | sway_log(SWAY_DEBUG, |
71 | "[bar %s] Updated tray binding for %u (%s) to %s", | 71 | "[bar %s] Updated tray binding for %u (%s) to %s", |
72 | config->current_bar->id, binding->button, name, | 72 | config->current_bar->id, binding->button, name, |
73 | binding->command); | 73 | binding->command); |
@@ -76,7 +76,7 @@ static struct cmd_results *tray_bind(int argc, char **argv, bool code) { | |||
76 | } | 76 | } |
77 | if (!overwritten) { | 77 | if (!overwritten) { |
78 | wl_list_insert(&config->current_bar->tray_bindings, &binding->link); | 78 | wl_list_insert(&config->current_bar->tray_bindings, &binding->link); |
79 | wlr_log(WLR_DEBUG, "[bar %s] Added tray binding for %u (%s) to %s", | 79 | sway_log(SWAY_DEBUG, "[bar %s] Added tray binding for %u (%s) to %s", |
80 | config->current_bar->id, binding->button, name, | 80 | config->current_bar->id, binding->button, name, |
81 | binding->command); | 81 | binding->command); |
82 | } | 82 | } |
diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c index d45c09c6..16e16f60 100644 --- a/sway/commands/bar/tray_output.c +++ b/sway/commands/bar/tray_output.c | |||
@@ -23,13 +23,13 @@ struct cmd_results *bar_cmd_tray_output(int argc, char **argv) { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | if (strcmp(argv[0], "none") == 0) { | 25 | if (strcmp(argv[0], "none") == 0) { |
26 | wlr_log(WLR_DEBUG, "Hiding tray on bar: %s", config->current_bar->id); | 26 | sway_log(SWAY_DEBUG, "Hiding tray on bar: %s", config->current_bar->id); |
27 | for (int i = 0; i < outputs->length; ++i) { | 27 | for (int i = 0; i < outputs->length; ++i) { |
28 | free(outputs->items[i]); | 28 | free(outputs->items[i]); |
29 | } | 29 | } |
30 | outputs->length = 0; | 30 | outputs->length = 0; |
31 | } else { | 31 | } else { |
32 | wlr_log(WLR_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], | 32 | sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], |
33 | config->current_bar->id); | 33 | config->current_bar->id); |
34 | } | 34 | } |
35 | list_add(outputs, strdup(argv[0])); | 35 | list_add(outputs, strdup(argv[0])); |
diff --git a/sway/commands/bar/tray_padding.c b/sway/commands/bar/tray_padding.c index 1e8b294b..f43cfe4f 100644 --- a/sway/commands/bar/tray_padding.c +++ b/sway/commands/bar/tray_padding.c | |||
@@ -32,7 +32,7 @@ struct cmd_results *bar_cmd_tray_padding(int argc, char **argv) { | |||
32 | "Expected 'tray_padding <px> [px]'"); | 32 | "Expected 'tray_padding <px> [px]'"); |
33 | } | 33 | } |
34 | 34 | ||
35 | wlr_log(WLR_DEBUG, "[Bar %s] Setting tray padding to %d", bar->id, padding); | 35 | sway_log(SWAY_DEBUG, "[Bar %s] Setting tray padding to %d", bar->id, padding); |
36 | config->current_bar->tray_padding = padding; | 36 | config->current_bar->tray_padding = padding; |
37 | return cmd_results_new(CMD_SUCCESS, NULL); | 37 | return cmd_results_new(CMD_SUCCESS, NULL); |
38 | #else | 38 | #else |
diff --git a/sway/commands/bar/workspace_buttons.c b/sway/commands/bar/workspace_buttons.c index 773e6357..792ef605 100644 --- a/sway/commands/bar/workspace_buttons.c +++ b/sway/commands/bar/workspace_buttons.c | |||
@@ -15,10 +15,10 @@ struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) { | |||
15 | config->current_bar->workspace_buttons = | 15 | config->current_bar->workspace_buttons = |
16 | parse_boolean(argv[0], config->current_bar->workspace_buttons); | 16 | parse_boolean(argv[0], config->current_bar->workspace_buttons); |
17 | if (config->current_bar->workspace_buttons) { | 17 | if (config->current_bar->workspace_buttons) { |
18 | wlr_log(WLR_DEBUG, "Enabling workspace buttons on bar: %s", | 18 | sway_log(SWAY_DEBUG, "Enabling workspace buttons on bar: %s", |
19 | config->current_bar->id); | 19 | config->current_bar->id); |
20 | } else { | 20 | } else { |
21 | wlr_log(WLR_DEBUG, "Disabling workspace buttons on bar: %s", | 21 | sway_log(SWAY_DEBUG, "Disabling workspace buttons on bar: %s", |
22 | config->current_bar->id); | 22 | config->current_bar->id); |
23 | } | 23 | } |
24 | return cmd_results_new(CMD_SUCCESS, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL); |
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c index 2f7bb090..decd238d 100644 --- a/sway/commands/bar/wrap_scroll.c +++ b/sway/commands/bar/wrap_scroll.c | |||
@@ -15,10 +15,10 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) { | |||
15 | config->current_bar->wrap_scroll = | 15 | config->current_bar->wrap_scroll = |
16 | parse_boolean(argv[0], config->current_bar->wrap_scroll); | 16 | parse_boolean(argv[0], config->current_bar->wrap_scroll); |
17 | if (config->current_bar->wrap_scroll) { | 17 | if (config->current_bar->wrap_scroll) { |
18 | wlr_log(WLR_DEBUG, "Enabling wrap scroll on bar: %s", | 18 | sway_log(SWAY_DEBUG, "Enabling wrap scroll on bar: %s", |
19 | config->current_bar->id); | 19 | config->current_bar->id); |
20 | } else { | 20 | } else { |
21 | wlr_log(WLR_DEBUG, "Disabling wrap scroll on bar: %s", | 21 | sway_log(SWAY_DEBUG, "Disabling wrap scroll on bar: %s", |
22 | config->current_bar->id); | 22 | config->current_bar->id); |
23 | } | 23 | } |
24 | return cmd_results_new(CMD_SUCCESS, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL); |
diff --git a/sway/commands/bind.c b/sway/commands/bind.c index b0493f7e..ce087fd0 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c | |||
@@ -291,7 +291,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv, | |||
291 | for (int i = 0; i < mode_bindings->length; ++i) { | 291 | for (int i = 0; i < mode_bindings->length; ++i) { |
292 | struct sway_binding *config_binding = mode_bindings->items[i]; | 292 | struct sway_binding *config_binding = mode_bindings->items[i]; |
293 | if (binding_key_compare(binding, config_binding)) { | 293 | if (binding_key_compare(binding, config_binding)) { |
294 | wlr_log(WLR_INFO, "Overwriting binding '%s' for device '%s' " | 294 | sway_log(SWAY_INFO, "Overwriting binding '%s' for device '%s' " |
295 | "from `%s` to `%s`", argv[0], binding->input, | 295 | "from `%s` to `%s`", argv[0], binding->input, |
296 | binding->command, config_binding->command); | 296 | binding->command, config_binding->command); |
297 | if (warn) { | 297 | if (warn) { |
@@ -310,7 +310,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv, | |||
310 | list_add(mode_bindings, binding); | 310 | list_add(mode_bindings, binding); |
311 | } | 311 | } |
312 | 312 | ||
313 | wlr_log(WLR_DEBUG, "%s - Bound %s to command `%s` for device '%s'", | 313 | sway_log(SWAY_DEBUG, "%s - Bound %s to command `%s` for device '%s'", |
314 | bindtype, argv[0], binding->command, binding->input); | 314 | bindtype, argv[0], binding->command, binding->input); |
315 | return cmd_results_new(CMD_SUCCESS, NULL); | 315 | return cmd_results_new(CMD_SUCCESS, NULL); |
316 | } | 316 | } |
@@ -327,14 +327,14 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) { | |||
327 | * Execute the command associated to a binding | 327 | * Execute the command associated to a binding |
328 | */ | 328 | */ |
329 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) { | 329 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) { |
330 | wlr_log(WLR_DEBUG, "running command for binding: %s", binding->command); | 330 | sway_log(SWAY_DEBUG, "running command for binding: %s", binding->command); |
331 | 331 | ||
332 | list_t *res_list = execute_command(binding->command, seat, NULL); | 332 | list_t *res_list = execute_command(binding->command, seat, NULL); |
333 | bool success = true; | 333 | bool success = true; |
334 | for (int i = 0; i < res_list->length; ++i) { | 334 | for (int i = 0; i < res_list->length; ++i) { |
335 | struct cmd_results *results = res_list->items[i]; | 335 | struct cmd_results *results = res_list->items[i]; |
336 | if (results->status != CMD_SUCCESS) { | 336 | if (results->status != CMD_SUCCESS) { |
337 | wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)", | 337 | sway_log(SWAY_DEBUG, "could not run command for binding: %s (%s)", |
338 | binding->command, results->error); | 338 | binding->command, results->error); |
339 | success = false; | 339 | success = false; |
340 | } | 340 | } |
diff --git a/sway/commands/client.c b/sway/commands/client.c index 10bfa519..f5c7d90f 100644 --- a/sway/commands/client.c +++ b/sway/commands/client.c | |||
@@ -114,6 +114,6 @@ struct cmd_results *cmd_client_urgent(int argc, char **argv) { | |||
114 | } | 114 | } |
115 | 115 | ||
116 | struct cmd_results *cmd_client_noop(int argc, char **argv) { | 116 | struct cmd_results *cmd_client_noop(int argc, char **argv) { |
117 | wlr_log(WLR_INFO, "Warning: %s is ignored by sway", argv[-1]); | 117 | sway_log(SWAY_INFO, "Warning: %s is ignored by sway", argv[-1]); |
118 | return cmd_results_new(CMD_SUCCESS, NULL); | 118 | return cmd_results_new(CMD_SUCCESS, NULL); |
119 | } | 119 | } |
diff --git a/sway/commands/exec.c b/sway/commands/exec.c index dc8d8aac..87d90716 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, NULL); | 8 | if (!config->active) return cmd_results_new(CMD_DEFER, 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(WLR_DEBUG, "Ignoring 'exec %s' due to reload", args); | 11 | sway_log(SWAY_DEBUG, "Ignoring 'exec %s' due to reload", args); |
12 | free(args); | 12 | free(args); |
13 | return cmd_results_new(CMD_SUCCESS, NULL); | 13 | return cmd_results_new(CMD_SUCCESS, NULL); |
14 | } | 14 | } |
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 1ed6c7e6..a5724295 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c | |||
@@ -24,7 +24,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
24 | 24 | ||
25 | char *tmp = NULL; | 25 | char *tmp = NULL; |
26 | if (strcmp(argv[0], "--no-startup-id") == 0) { | 26 | if (strcmp(argv[0], "--no-startup-id") == 0) { |
27 | wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored."); | 27 | sway_log(SWAY_INFO, "exec switch '--no-startup-id' not supported, ignored."); |
28 | --argc; ++argv; | 28 | --argc; ++argv; |
29 | if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { | 29 | if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { |
30 | return error; | 30 | return error; |
@@ -43,11 +43,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
43 | strncpy(cmd, tmp, sizeof(cmd) - 1); | 43 | strncpy(cmd, tmp, sizeof(cmd) - 1); |
44 | cmd[sizeof(cmd) - 1] = 0; | 44 | cmd[sizeof(cmd) - 1] = 0; |
45 | free(tmp); | 45 | free(tmp); |
46 | wlr_log(WLR_DEBUG, "Executing %s", cmd); | 46 | sway_log(SWAY_DEBUG, "Executing %s", cmd); |
47 | 47 | ||
48 | int fd[2]; | 48 | int fd[2]; |
49 | if (pipe(fd) != 0) { | 49 | if (pipe(fd) != 0) { |
50 | wlr_log(WLR_ERROR, "Unable to create pipe for fork"); | 50 | sway_log(SWAY_ERROR, "Unable to create pipe for fork"); |
51 | } | 51 | } |
52 | 52 | ||
53 | pid_t pid, child; | 53 | pid_t pid, child; |
@@ -84,7 +84,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
84 | // cleanup child process | 84 | // cleanup child process |
85 | waitpid(pid, NULL, 0); | 85 | waitpid(pid, NULL, 0); |
86 | if (child > 0) { | 86 | if (child > 0) { |
87 | wlr_log(WLR_DEBUG, "Child process created with pid %d", child); | 87 | sway_log(SWAY_DEBUG, "Child process created with pid %d", child); |
88 | root_record_workspace_pid(child); | 88 | root_record_workspace_pid(child); |
89 | } else { | 89 | } else { |
90 | return cmd_results_new(CMD_FAILURE, "Second fork() failed"); | 90 | return cmd_results_new(CMD_FAILURE, "Second fork() failed"); |
diff --git a/sway/commands/floating_minmax_size.c b/sway/commands/floating_minmax_size.c index 31c1e999..3a1d606a 100644 --- a/sway/commands/floating_minmax_size.c +++ b/sway/commands/floating_minmax_size.c | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #include <string.h> | 5 | #include <string.h> |
6 | #include <strings.h> | 6 | #include <strings.h> |
7 | #include <wlr/util/log.h> | ||
8 | #include "sway/commands.h" | 7 | #include "sway/commands.h" |
9 | #include "log.h" | 8 | #include "log.h" |
10 | 9 | ||
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 8564f3ff..e7680062 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -1,6 +1,5 @@ | |||
1 | #include <strings.h> | 1 | #include <strings.h> |
2 | #include <wlr/types/wlr_output_layout.h> | 2 | #include <wlr/types/wlr_output_layout.h> |
3 | #include <wlr/util/log.h> | ||
4 | #include "log.h" | 3 | #include "log.h" |
5 | #include "sway/commands.h" | 4 | #include "sway/commands.h" |
6 | #include "sway/input/input-manager.h" | 5 | #include "sway/input/input-manager.h" |
diff --git a/sway/commands/for_window.c b/sway/commands/for_window.c index f151575e..63cba099 100644 --- a/sway/commands/for_window.c +++ b/sway/commands/for_window.c | |||
@@ -23,7 +23,7 @@ struct cmd_results *cmd_for_window(int argc, char **argv) { | |||
23 | criteria->cmdlist = join_args(argv + 1, argc - 1); | 23 | criteria->cmdlist = join_args(argv + 1, argc - 1); |
24 | 24 | ||
25 | list_add(config->criteria, criteria); | 25 | list_add(config->criteria, criteria); |
26 | wlr_log(WLR_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist); | 26 | sway_log(SWAY_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist); |
27 | 27 | ||
28 | return cmd_results_new(CMD_SUCCESS, NULL); | 28 | return cmd_results_new(CMD_SUCCESS, NULL); |
29 | } | 29 | } |
diff --git a/sway/commands/input.c b/sway/commands/input.c index 1f77507a..b72bd76b 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c | |||
@@ -45,7 +45,7 @@ struct cmd_results *cmd_input(int argc, char **argv) { | |||
45 | return error; | 45 | return error; |
46 | } | 46 | } |
47 | 47 | ||
48 | wlr_log(WLR_DEBUG, "entering input block: %s", argv[0]); | 48 | sway_log(SWAY_DEBUG, "entering input block: %s", argv[0]); |
49 | 49 | ||
50 | config->handler_context.input_config = new_input_config(argv[0]); | 50 | config->handler_context.input_config = new_input_config(argv[0]); |
51 | if (!config->handler_context.input_config) { | 51 | if (!config->handler_context.input_config) { |
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c index c9200aa2..0879e2da 100644 --- a/sway/commands/input/xkb_layout.c +++ b/sway/commands/input/xkb_layout.c | |||
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) { | |||
16 | 16 | ||
17 | ic->xkb_layout = strdup(argv[0]); | 17 | ic->xkb_layout = strdup(argv[0]); |
18 | 18 | ||
19 | wlr_log(WLR_DEBUG, "set-xkb_layout for config: %s layout: %s", | 19 | sway_log(SWAY_DEBUG, "set-xkb_layout for config: %s layout: %s", |
20 | ic->identifier, ic->xkb_layout); | 20 | ic->identifier, ic->xkb_layout); |
21 | return cmd_results_new(CMD_SUCCESS, NULL); | 21 | return cmd_results_new(CMD_SUCCESS, NULL); |
22 | } | 22 | } |
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c index 763ae80e..9e384156 100644 --- a/sway/commands/input/xkb_model.c +++ b/sway/commands/input/xkb_model.c | |||
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) { | |||
16 | 16 | ||
17 | ic->xkb_model = strdup(argv[0]); | 17 | ic->xkb_model = strdup(argv[0]); |
18 | 18 | ||
19 | wlr_log(WLR_DEBUG, "set-xkb_model for config: %s model: %s", | 19 | sway_log(SWAY_DEBUG, "set-xkb_model for config: %s model: %s", |
20 | ic->identifier, ic->xkb_model); | 20 | ic->identifier, ic->xkb_model); |
21 | return cmd_results_new(CMD_SUCCESS, NULL); | 21 | return cmd_results_new(CMD_SUCCESS, NULL); |
22 | } | 22 | } |
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c index 1ff6e680..8197dd1d 100644 --- a/sway/commands/input/xkb_options.c +++ b/sway/commands/input/xkb_options.c | |||
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) { | |||
16 | 16 | ||
17 | ic->xkb_options = strdup(argv[0]); | 17 | ic->xkb_options = strdup(argv[0]); |
18 | 18 | ||
19 | wlr_log(WLR_DEBUG, "set-xkb_options for config: %s options: %s", | 19 | sway_log(SWAY_DEBUG, "set-xkb_options for config: %s options: %s", |
20 | ic->identifier, ic->xkb_options); | 20 | ic->identifier, ic->xkb_options); |
21 | return cmd_results_new(CMD_SUCCESS, NULL); | 21 | return cmd_results_new(CMD_SUCCESS, NULL); |
22 | } | 22 | } |
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c index 29172b24..01ccd06f 100644 --- a/sway/commands/input/xkb_rules.c +++ b/sway/commands/input/xkb_rules.c | |||
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) { | |||
16 | 16 | ||
17 | ic->xkb_rules = strdup(argv[0]); | 17 | ic->xkb_rules = strdup(argv[0]); |
18 | 18 | ||
19 | wlr_log(WLR_DEBUG, "set-xkb_rules for config: %s rules: %s", | 19 | sway_log(SWAY_DEBUG, "set-xkb_rules for config: %s rules: %s", |
20 | ic->identifier, ic->xkb_rules); | 20 | ic->identifier, ic->xkb_rules); |
21 | return cmd_results_new(CMD_SUCCESS, NULL); | 21 | return cmd_results_new(CMD_SUCCESS, NULL); |
22 | } | 22 | } |
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c index 9f3baed6..37c82fbd 100644 --- a/sway/commands/input/xkb_variant.c +++ b/sway/commands/input/xkb_variant.c | |||
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) { | |||
16 | 16 | ||
17 | ic->xkb_variant = strdup(argv[0]); | 17 | ic->xkb_variant = strdup(argv[0]); |
18 | 18 | ||
19 | wlr_log(WLR_DEBUG, "set-xkb_variant for config: %s variant: %s", | 19 | sway_log(SWAY_DEBUG, "set-xkb_variant for config: %s variant: %s", |
20 | ic->identifier, ic->xkb_variant); | 20 | ic->identifier, ic->xkb_variant); |
21 | return cmd_results_new(CMD_SUCCESS, NULL); | 21 | return cmd_results_new(CMD_SUCCESS, NULL); |
22 | } | 22 | } |
diff --git a/sway/commands/kill.c b/sway/commands/kill.c index 41daeb4e..f1e95e4b 100644 --- a/sway/commands/kill.c +++ b/sway/commands/kill.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #include <wlr/util/log.h> | ||
2 | #include "log.h" | 1 | #include "log.h" |
3 | #include "sway/input/input-manager.h" | 2 | #include "sway/input/input-manager.h" |
4 | #include "sway/input/seat.h" | 3 | #include "sway/input/seat.h" |
diff --git a/sway/commands/mode.c b/sway/commands/mode.c index 828d77e1..d424eb1c 100644 --- a/sway/commands/mode.c +++ b/sway/commands/mode.c | |||
@@ -62,7 +62,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) { | |||
62 | return error; | 62 | return error; |
63 | } | 63 | } |
64 | if ((config->reading && argc > 1) || (!config->reading && argc == 1)) { | 64 | if ((config->reading && argc > 1) || (!config->reading && argc == 1)) { |
65 | wlr_log(WLR_DEBUG, "Switching to mode `%s' (pango=%d)", | 65 | sway_log(SWAY_DEBUG, "Switching to mode `%s' (pango=%d)", |
66 | mode->name, mode->pango); | 66 | mode->name, mode->pango); |
67 | } | 67 | } |
68 | // Set current mode | 68 | // Set current mode |
diff --git a/sway/commands/move.c b/sway/commands/move.c index d4b55922..b22bb056 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <wlr/types/wlr_cursor.h> | 6 | #include <wlr/types/wlr_cursor.h> |
7 | #include <wlr/types/wlr_output.h> | 7 | #include <wlr/types/wlr_output.h> |
8 | #include <wlr/types/wlr_output_layout.h> | 8 | #include <wlr/types/wlr_output_layout.h> |
9 | #include <wlr/util/log.h> | ||
10 | #include "sway/commands.h" | 9 | #include "sway/commands.h" |
11 | #include "sway/input/cursor.h" | 10 | #include "sway/input/cursor.h" |
12 | #include "sway/input/seat.h" | 11 | #include "sway/input/seat.h" |
@@ -106,13 +105,13 @@ static void container_move_to_container_from_direction( | |||
106 | if (destination->view) { | 105 | if (destination->view) { |
107 | if (destination->parent == container->parent && | 106 | if (destination->parent == container->parent && |
108 | destination->workspace == container->workspace) { | 107 | destination->workspace == container->workspace) { |
109 | wlr_log(WLR_DEBUG, "Swapping siblings"); | 108 | sway_log(SWAY_DEBUG, "Swapping siblings"); |
110 | list_t *siblings = container_get_siblings(container); | 109 | list_t *siblings = container_get_siblings(container); |
111 | int container_index = list_find(siblings, container); | 110 | int container_index = list_find(siblings, container); |
112 | int destination_index = list_find(siblings, destination); | 111 | int destination_index = list_find(siblings, destination); |
113 | list_swap(siblings, container_index, destination_index); | 112 | list_swap(siblings, container_index, destination_index); |
114 | } else { | 113 | } else { |
115 | wlr_log(WLR_DEBUG, "Promoting to sibling of cousin"); | 114 | sway_log(SWAY_DEBUG, "Promoting to sibling of cousin"); |
116 | int offset = | 115 | int offset = |
117 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP; | 116 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP; |
118 | int index = container_sibling_index(destination) + offset; | 117 | int index = container_sibling_index(destination) + offset; |
@@ -128,7 +127,7 @@ static void container_move_to_container_from_direction( | |||
128 | } | 127 | } |
129 | 128 | ||
130 | if (is_parallel(destination->layout, move_dir)) { | 129 | if (is_parallel(destination->layout, move_dir)) { |
131 | wlr_log(WLR_DEBUG, "Reparenting container (parallel)"); | 130 | sway_log(SWAY_DEBUG, "Reparenting container (parallel)"); |
132 | int index = | 131 | int index = |
133 | move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? | 132 | move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? |
134 | 0 : destination->children->length; | 133 | 0 : destination->children->length; |
@@ -137,7 +136,7 @@ static void container_move_to_container_from_direction( | |||
137 | return; | 136 | return; |
138 | } | 137 | } |
139 | 138 | ||
140 | wlr_log(WLR_DEBUG, "Reparenting container (perpendicular)"); | 139 | sway_log(SWAY_DEBUG, "Reparenting container (perpendicular)"); |
141 | struct sway_node *focus_inactive = seat_get_active_tiling_child( | 140 | struct sway_node *focus_inactive = seat_get_active_tiling_child( |
142 | config->handler_context.seat, &destination->node); | 141 | config->handler_context.seat, &destination->node); |
143 | if (!focus_inactive || focus_inactive == &destination->node) { | 142 | if (!focus_inactive || focus_inactive == &destination->node) { |
@@ -157,7 +156,7 @@ static void container_move_to_workspace_from_direction( | |||
157 | container->width = container->height = 0; | 156 | container->width = container->height = 0; |
158 | 157 | ||
159 | if (is_parallel(workspace->layout, move_dir)) { | 158 | if (is_parallel(workspace->layout, move_dir)) { |
160 | wlr_log(WLR_DEBUG, "Reparenting container (parallel)"); | 159 | sway_log(SWAY_DEBUG, "Reparenting container (parallel)"); |
161 | int index = | 160 | int index = |
162 | move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? | 161 | move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? |
163 | 0 : workspace->tiling->length; | 162 | 0 : workspace->tiling->length; |
@@ -165,7 +164,7 @@ static void container_move_to_workspace_from_direction( | |||
165 | return; | 164 | return; |
166 | } | 165 | } |
167 | 166 | ||
168 | wlr_log(WLR_DEBUG, "Reparenting container (perpendicular)"); | 167 | sway_log(SWAY_DEBUG, "Reparenting container (perpendicular)"); |
169 | struct sway_container *focus_inactive = seat_get_focus_inactive_tiling( | 168 | struct sway_container *focus_inactive = seat_get_focus_inactive_tiling( |
170 | config->handler_context.seat, workspace); | 169 | config->handler_context.seat, workspace); |
171 | if (!focus_inactive) { | 170 | if (!focus_inactive) { |
@@ -362,7 +361,7 @@ static bool container_move_in_direction(struct sway_container *container, | |||
362 | container_move_to_workspace_from_direction(container, ws, move_dir); | 361 | container_move_to_workspace_from_direction(container, ws, move_dir); |
363 | return true; | 362 | return true; |
364 | } | 363 | } |
365 | wlr_log(WLR_DEBUG, "Hit edge of output, nowhere else to go"); | 364 | sway_log(SWAY_DEBUG, "Hit edge of output, nowhere else to go"); |
366 | return false; | 365 | return false; |
367 | } | 366 | } |
368 | 367 | ||
diff --git a/sway/commands/output.c b/sway/commands/output.c index 73dbb723..74ca9d0b 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c | |||
@@ -28,7 +28,7 @@ struct cmd_results *cmd_output(int argc, char **argv) { | |||
28 | 28 | ||
29 | struct output_config *output = new_output_config(argv[0]); | 29 | struct output_config *output = new_output_config(argv[0]); |
30 | if (!output) { | 30 | if (!output) { |
31 | wlr_log(WLR_ERROR, "Failed to allocate output config"); | 31 | sway_log(SWAY_ERROR, "Failed to allocate output config"); |
32 | return NULL; | 32 | return NULL; |
33 | } | 33 | } |
34 | argc--; argv++; | 34 | argc--; argv++; |
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c index 00038e67..affa04ea 100644 --- a/sway/commands/output/background.c +++ b/sway/commands/output/background.c | |||
@@ -79,7 +79,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
79 | src = join_args(p.we_wordv, p.we_wordc); | 79 | src = join_args(p.we_wordv, p.we_wordc); |
80 | wordfree(&p); | 80 | wordfree(&p); |
81 | if (!src) { | 81 | if (!src) { |
82 | wlr_log(WLR_ERROR, "Failed to duplicate string"); | 82 | sway_log(SWAY_ERROR, "Failed to duplicate string"); |
83 | return cmd_results_new(CMD_FAILURE, "Unable to allocate resource"); | 83 | return cmd_results_new(CMD_FAILURE, "Unable to allocate resource"); |
84 | } | 84 | } |
85 | 85 | ||
@@ -88,7 +88,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
88 | 88 | ||
89 | char *conf = strdup(config->current_config_path); | 89 | char *conf = strdup(config->current_config_path); |
90 | if (!conf) { | 90 | if (!conf) { |
91 | wlr_log(WLR_ERROR, "Failed to duplicate string"); | 91 | sway_log(SWAY_ERROR, "Failed to duplicate string"); |
92 | free(src); | 92 | free(src); |
93 | return cmd_results_new(CMD_FAILURE, | 93 | return cmd_results_new(CMD_FAILURE, |
94 | "Unable to allocate resources"); | 94 | "Unable to allocate resources"); |
@@ -100,7 +100,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
100 | if (!src) { | 100 | if (!src) { |
101 | free(rel_path); | 101 | free(rel_path); |
102 | free(conf); | 102 | free(conf); |
103 | wlr_log(WLR_ERROR, "Unable to allocate memory"); | 103 | sway_log(SWAY_ERROR, "Unable to allocate memory"); |
104 | return cmd_results_new(CMD_FAILURE, | 104 | return cmd_results_new(CMD_FAILURE, |
105 | "Unable to allocate resources"); | 105 | "Unable to allocate resources"); |
106 | } | 106 | } |
@@ -112,7 +112,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
112 | 112 | ||
113 | bool can_access = access(src, F_OK) != -1; | 113 | bool can_access = access(src, F_OK) != -1; |
114 | if (!can_access) { | 114 | if (!can_access) { |
115 | wlr_log(WLR_ERROR, "Unable to access background file '%s': %s", | 115 | sway_log(SWAY_ERROR, "Unable to access background file '%s': %s", |
116 | src, strerror(errno)); | 116 | src, strerror(errno)); |
117 | config_add_swaynag_warning("Unable to access background file '%s'", | 117 | config_add_swaynag_warning("Unable to access background file '%s'", |
118 | src); | 118 | src); |
diff --git a/sway/commands/reload.c b/sway/commands/reload.c index 6e7772e9..19ec065c 100644 --- a/sway/commands/reload.c +++ b/sway/commands/reload.c | |||
@@ -23,7 +23,7 @@ static void do_reload(void *data) { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | if (!load_main_config(config->current_config_path, true, false)) { | 25 | if (!load_main_config(config->current_config_path, true, false)) { |
26 | wlr_log(WLR_ERROR, "Error(s) reloading config"); | 26 | sway_log(SWAY_ERROR, "Error(s) reloading config"); |
27 | list_free_items_and_destroy(bar_ids); | 27 | list_free_items_and_destroy(bar_ids); |
28 | return; | 28 | return; |
29 | } | 29 | } |
diff --git a/sway/commands/rename.c b/sway/commands/rename.c index a68302c4..88377b09 100644 --- a/sway/commands/rename.c +++ b/sway/commands/rename.c | |||
@@ -88,7 +88,7 @@ struct cmd_results *cmd_rename(int argc, char **argv) { | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name); | 91 | sway_log(SWAY_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name); |
92 | free(workspace->name); | 92 | free(workspace->name); |
93 | workspace->name = new_name; | 93 | workspace->name = new_name; |
94 | 94 | ||
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index c88d2734..0e497239 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <strings.h> | 7 | #include <strings.h> |
8 | #include <wlr/util/edges.h> | 8 | #include <wlr/util/edges.h> |
9 | #include <wlr/util/log.h> | ||
10 | #include "sway/commands.h" | 9 | #include "sway/commands.h" |
11 | #include "sway/tree/arrange.h" | 10 | #include "sway/tree/arrange.h" |
12 | #include "sway/tree/view.h" | 11 | #include "sway/tree/view.h" |
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c index 1162d51f..805dbc0b 100644 --- a/sway/commands/scratchpad.c +++ b/sway/commands/scratchpad.c | |||
@@ -23,7 +23,7 @@ static void scratchpad_toggle_auto(void) { | |||
23 | // Check if the currently focused window is a scratchpad window and should | 23 | // Check if the currently focused window is a scratchpad window and should |
24 | // be hidden again. | 24 | // be hidden again. |
25 | if (focus && focus->scratchpad) { | 25 | if (focus && focus->scratchpad) { |
26 | wlr_log(WLR_DEBUG, "Focus is a scratchpad window - hiding %s", | 26 | sway_log(SWAY_DEBUG, "Focus is a scratchpad window - hiding %s", |
27 | focus->title); | 27 | focus->title); |
28 | root_scratchpad_hide(focus); | 28 | root_scratchpad_hide(focus); |
29 | return; | 29 | return; |
@@ -34,7 +34,7 @@ static void scratchpad_toggle_auto(void) { | |||
34 | for (int i = 0; i < ws->floating->length; ++i) { | 34 | for (int i = 0; i < ws->floating->length; ++i) { |
35 | struct sway_container *floater = ws->floating->items[i]; | 35 | struct sway_container *floater = ws->floating->items[i]; |
36 | if (floater->scratchpad && focus != floater) { | 36 | if (floater->scratchpad && focus != floater) { |
37 | wlr_log(WLR_DEBUG, | 37 | sway_log(SWAY_DEBUG, |
38 | "Focusing other scratchpad window (%s) in this workspace", | 38 | "Focusing other scratchpad window (%s) in this workspace", |
39 | floater->title); | 39 | floater->title); |
40 | root_scratchpad_show(floater); | 40 | root_scratchpad_show(floater); |
@@ -47,7 +47,7 @@ static void scratchpad_toggle_auto(void) { | |||
47 | for (int i = 0; i < root->scratchpad->length; ++i) { | 47 | for (int i = 0; i < root->scratchpad->length; ++i) { |
48 | struct sway_container *con = root->scratchpad->items[i]; | 48 | struct sway_container *con = root->scratchpad->items[i]; |
49 | if (con->parent) { | 49 | if (con->parent) { |
50 | wlr_log(WLR_DEBUG, | 50 | sway_log(SWAY_DEBUG, |
51 | "Moving a visible scratchpad window (%s) to this workspace", | 51 | "Moving a visible scratchpad window (%s) to this workspace", |
52 | con->title); | 52 | con->title); |
53 | root_scratchpad_show(con); | 53 | root_scratchpad_show(con); |
@@ -60,7 +60,7 @@ static void scratchpad_toggle_auto(void) { | |||
60 | return; | 60 | return; |
61 | } | 61 | } |
62 | struct sway_container *con = root->scratchpad->items[0]; | 62 | struct sway_container *con = root->scratchpad->items[0]; |
63 | wlr_log(WLR_DEBUG, "Showing %s from list", con->title); | 63 | sway_log(SWAY_DEBUG, "Showing %s from list", con->title); |
64 | root_scratchpad_show(con); | 64 | root_scratchpad_show(con); |
65 | } | 65 | } |
66 | 66 | ||
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index a8beb162..0d8d1116 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c | |||
@@ -1,6 +1,5 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <strings.h> | 2 | #include <strings.h> |
3 | #include <wlr/util/log.h> | ||
4 | #include "config.h" | 3 | #include "config.h" |
5 | #include "log.h" | 4 | #include "log.h" |
6 | #include "sway/commands.h" | 5 | #include "sway/commands.h" |
@@ -96,7 +95,7 @@ static void container_swap(struct sway_container *con1, | |||
96 | return; | 95 | return; |
97 | } | 96 | } |
98 | 97 | ||
99 | wlr_log(WLR_DEBUG, "Swapping containers %zu and %zu", | 98 | sway_log(SWAY_DEBUG, "Swapping containers %zu and %zu", |
100 | con1->node.id, con2->node.id); | 99 | con1->node.id, con2->node.id); |
101 | 100 | ||
102 | bool fs1 = con1->is_fullscreen; | 101 | bool fs1 = con1->is_fullscreen; |
diff --git a/sway/commands/swaybg_command.c b/sway/commands/swaybg_command.c index 91294bf4..92e9bdfd 100644 --- a/sway/commands/swaybg_command.c +++ b/sway/commands/swaybg_command.c | |||
@@ -15,7 +15,7 @@ struct cmd_results *cmd_swaybg_command(int argc, char **argv) { | |||
15 | char *new_command = join_args(argv, argc); | 15 | char *new_command = join_args(argv, argc); |
16 | if (strcmp(new_command, "-") != 0) { | 16 | if (strcmp(new_command, "-") != 0) { |
17 | config->swaybg_command = new_command; | 17 | config->swaybg_command = new_command; |
18 | wlr_log(WLR_DEBUG, "Using custom swaybg command: %s", | 18 | sway_log(SWAY_DEBUG, "Using custom swaybg command: %s", |
19 | config->swaybg_command); | 19 | config->swaybg_command); |
20 | } else { | 20 | } else { |
21 | free(new_command); | 21 | free(new_command); |
diff --git a/sway/commands/swaynag_command.c b/sway/commands/swaynag_command.c index b420f311..f851d223 100644 --- a/sway/commands/swaynag_command.c +++ b/sway/commands/swaynag_command.c | |||
@@ -15,7 +15,7 @@ struct cmd_results *cmd_swaynag_command(int argc, char **argv) { | |||
15 | char *new_command = join_args(argv, argc); | 15 | char *new_command = join_args(argv, argc); |
16 | if (strcmp(new_command, "-") != 0) { | 16 | if (strcmp(new_command, "-") != 0) { |
17 | config->swaynag_command = new_command; | 17 | config->swaynag_command = new_command; |
18 | wlr_log(WLR_DEBUG, "Using custom swaynag command: %s", | 18 | sway_log(SWAY_DEBUG, "Using custom swaynag command: %s", |
19 | config->swaynag_command); | 19 | config->swaynag_command); |
20 | } else { | 20 | } else { |
21 | free(new_command); | 21 | free(new_command); |
diff --git a/sway/commands/xwayland.c b/sway/commands/xwayland.c index c3f73f67..b72f3239 100644 --- a/sway/commands/xwayland.c +++ b/sway/commands/xwayland.c | |||
@@ -13,7 +13,7 @@ struct cmd_results *cmd_xwayland(int argc, char **argv) { | |||
13 | #ifdef HAVE_XWAYLAND | 13 | #ifdef HAVE_XWAYLAND |
14 | config->xwayland = parse_boolean(argv[0], config->xwayland); | 14 | config->xwayland = parse_boolean(argv[0], config->xwayland); |
15 | #else | 15 | #else |
16 | wlr_log(WLR_INFO, "Ignoring `xwayland` command, " | 16 | sway_log(SWAY_INFO, "Ignoring `xwayland` command, " |
17 | "sway hasn't been built with Xwayland support"); | 17 | "sway hasn't been built with Xwayland support"); |
18 | #endif | 18 | #endif |
19 | 19 | ||
diff --git a/sway/config.c b/sway/config.c index d5d36306..145b3be6 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -335,11 +335,11 @@ static char *get_config_path(void) { | |||
335 | static bool load_config(const char *path, struct sway_config *config, | 335 | static bool load_config(const char *path, struct sway_config *config, |
336 | struct swaynag_instance *swaynag) { | 336 | struct swaynag_instance *swaynag) { |
337 | if (path == NULL) { | 337 | if (path == NULL) { |
338 | wlr_log(WLR_ERROR, "Unable to find a config file!"); | 338 | sway_log(SWAY_ERROR, "Unable to find a config file!"); |
339 | return false; | 339 | return false; |
340 | } | 340 | } |
341 | 341 | ||
342 | wlr_log(WLR_INFO, "Loading config from %s", path); | 342 | sway_log(SWAY_INFO, "Loading config from %s", path); |
343 | 343 | ||
344 | struct stat sb; | 344 | struct stat sb; |
345 | if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { | 345 | if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { |
@@ -348,7 +348,7 @@ static bool load_config(const char *path, struct sway_config *config, | |||
348 | 348 | ||
349 | FILE *f = fopen(path, "r"); | 349 | FILE *f = fopen(path, "r"); |
350 | if (!f) { | 350 | if (!f) { |
351 | wlr_log(WLR_ERROR, "Unable to open %s for reading", path); | 351 | sway_log(SWAY_ERROR, "Unable to open %s for reading", path); |
352 | return false; | 352 | return false; |
353 | } | 353 | } |
354 | 354 | ||
@@ -356,7 +356,7 @@ static bool load_config(const char *path, struct sway_config *config, | |||
356 | fclose(f); | 356 | fclose(f); |
357 | 357 | ||
358 | if (!config_load_success) { | 358 | if (!config_load_success) { |
359 | wlr_log(WLR_ERROR, "Error(s) loading config!"); | 359 | sway_log(SWAY_ERROR, "Error(s) loading config!"); |
360 | } | 360 | } |
361 | 361 | ||
362 | return true; | 362 | return true; |
@@ -379,7 +379,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) { | |||
379 | config_defaults(config); | 379 | config_defaults(config); |
380 | config->validating = validating; | 380 | config->validating = validating; |
381 | if (is_active) { | 381 | if (is_active) { |
382 | wlr_log(WLR_DEBUG, "Performing configuration file %s", | 382 | sway_log(SWAY_DEBUG, "Performing configuration file %s", |
383 | validating ? "validation" : "reload"); | 383 | validating ? "validation" : "reload"); |
384 | config->reloading = true; | 384 | config->reloading = true; |
385 | config->active = true; | 385 | config->active = true; |
@@ -403,7 +403,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) { | |||
403 | /* | 403 | /* |
404 | DIR *dir = opendir(SYSCONFDIR "/sway/security.d"); | 404 | DIR *dir = opendir(SYSCONFDIR "/sway/security.d"); |
405 | if (!dir) { | 405 | if (!dir) { |
406 | wlr_log(WLR_ERROR, | 406 | sway_log(SWAY_ERROR, |
407 | "%s does not exist, sway will have no security configuration" | 407 | "%s does not exist, sway will have no security configuration" |
408 | " and will probably be broken", SYSCONFDIR "/sway/security.d"); | 408 | " and will probably be broken", SYSCONFDIR "/sway/security.d"); |
409 | } else { | 409 | } else { |
@@ -432,7 +432,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) { | |||
432 | if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || | 432 | if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || |
433 | (((s.st_mode & 0777) != 0644) && | 433 | (((s.st_mode & 0777) != 0644) && |
434 | (s.st_mode & 0777) != 0444)) { | 434 | (s.st_mode & 0777) != 0444)) { |
435 | wlr_log(WLR_ERROR, | 435 | sway_log(SWAY_ERROR, |
436 | "Refusing to load %s - it must be owned by root " | 436 | "Refusing to load %s - it must be owned by root " |
437 | "and mode 644 or 444", _path); | 437 | "and mode 644 or 444", _path); |
438 | success = false; | 438 | success = false; |
@@ -488,7 +488,7 @@ static bool load_include_config(const char *path, const char *parent_dir, | |||
488 | len = len + strlen(parent_dir) + 2; | 488 | len = len + strlen(parent_dir) + 2; |
489 | full_path = malloc(len * sizeof(char)); | 489 | full_path = malloc(len * sizeof(char)); |
490 | if (!full_path) { | 490 | if (!full_path) { |
491 | wlr_log(WLR_ERROR, | 491 | sway_log(SWAY_ERROR, |
492 | "Unable to allocate full path to included config"); | 492 | "Unable to allocate full path to included config"); |
493 | return false; | 493 | return false; |
494 | } | 494 | } |
@@ -501,7 +501,7 @@ static bool load_include_config(const char *path, const char *parent_dir, | |||
501 | free(full_path); | 501 | free(full_path); |
502 | 502 | ||
503 | if (real_path == NULL) { | 503 | if (real_path == NULL) { |
504 | wlr_log(WLR_DEBUG, "%s not found.", path); | 504 | sway_log(SWAY_DEBUG, "%s not found.", path); |
505 | return false; | 505 | return false; |
506 | } | 506 | } |
507 | 507 | ||
@@ -510,7 +510,7 @@ static bool load_include_config(const char *path, const char *parent_dir, | |||
510 | for (j = 0; j < config->config_chain->length; ++j) { | 510 | for (j = 0; j < config->config_chain->length; ++j) { |
511 | char *old_path = config->config_chain->items[j]; | 511 | char *old_path = config->config_chain->items[j]; |
512 | if (strcmp(real_path, old_path) == 0) { | 512 | if (strcmp(real_path, old_path) == 0) { |
513 | wlr_log(WLR_DEBUG, | 513 | sway_log(SWAY_DEBUG, |
514 | "%s already included once, won't be included again.", | 514 | "%s already included once, won't be included again.", |
515 | real_path); | 515 | real_path); |
516 | free(real_path); | 516 | free(real_path); |
@@ -565,7 +565,7 @@ bool load_include_configs(const char *path, struct sway_config *config, | |||
565 | // restore wd | 565 | // restore wd |
566 | if (chdir(wd) < 0) { | 566 | if (chdir(wd) < 0) { |
567 | free(wd); | 567 | free(wd); |
568 | wlr_log(WLR_ERROR, "failed to restore working directory"); | 568 | sway_log(SWAY_ERROR, "failed to restore working directory"); |
569 | return false; | 569 | return false; |
570 | } | 570 | } |
571 | 571 | ||
@@ -630,7 +630,7 @@ static char *expand_line(const char *block, const char *line, bool add_brace) { | |||
630 | + (add_brace ? 2 : 0) + 1; | 630 | + (add_brace ? 2 : 0) + 1; |
631 | char *expanded = calloc(1, size); | 631 | char *expanded = calloc(1, size); |
632 | if (!expanded) { | 632 | if (!expanded) { |
633 | wlr_log(WLR_ERROR, "Cannot allocate expanded line buffer"); | 633 | sway_log(SWAY_ERROR, "Cannot allocate expanded line buffer"); |
634 | return NULL; | 634 | return NULL; |
635 | } | 635 | } |
636 | snprintf(expanded, size, "%s%s%s%s", block ? block : "", | 636 | snprintf(expanded, size, "%s%s%s%s", block ? block : "", |
@@ -649,7 +649,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
649 | int ret_seek = fseek(file, 0, SEEK_END); | 649 | int ret_seek = fseek(file, 0, SEEK_END); |
650 | long ret_tell = ftell(file); | 650 | long ret_tell = ftell(file); |
651 | if (ret_seek == -1 || ret_tell == -1) { | 651 | if (ret_seek == -1 || ret_tell == -1) { |
652 | wlr_log(WLR_ERROR, "Unable to get size of config file"); | 652 | sway_log(SWAY_ERROR, "Unable to get size of config file"); |
653 | return false; | 653 | return false; |
654 | } | 654 | } |
655 | config_size = ret_tell; | 655 | config_size = ret_tell; |
@@ -657,7 +657,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
657 | 657 | ||
658 | config->current_config = this_config = calloc(1, config_size + 1); | 658 | config->current_config = this_config = calloc(1, config_size + 1); |
659 | if (this_config == NULL) { | 659 | if (this_config == NULL) { |
660 | wlr_log(WLR_ERROR, "Unable to allocate buffer for config contents"); | 660 | sway_log(SWAY_ERROR, "Unable to allocate buffer for config contents"); |
661 | return false; | 661 | return false; |
662 | } | 662 | } |
663 | } | 663 | } |
@@ -673,7 +673,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
673 | while ((nread = getline_with_cont(&line, &line_size, file, &nlines)) != -1) { | 673 | while ((nread = getline_with_cont(&line, &line_size, file, &nlines)) != -1) { |
674 | if (reading_main_config) { | 674 | if (reading_main_config) { |
675 | if (read + nread > config_size) { | 675 | if (read + nread > config_size) { |
676 | wlr_log(WLR_ERROR, "Config file changed during reading"); | 676 | sway_log(SWAY_ERROR, "Config file changed during reading"); |
677 | success = false; | 677 | success = false; |
678 | break; | 678 | break; |
679 | } | 679 | } |
@@ -687,7 +687,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
687 | } | 687 | } |
688 | 688 | ||
689 | line_number += nlines; | 689 | line_number += nlines; |
690 | wlr_log(WLR_DEBUG, "Read line %d: %s", line_number, line); | 690 | sway_log(SWAY_DEBUG, "Read line %d: %s", line_number, line); |
691 | 691 | ||
692 | strip_whitespace(line); | 692 | strip_whitespace(line); |
693 | if (!*line || line[0] == '#') { | 693 | if (!*line || line[0] == '#') { |
@@ -698,7 +698,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
698 | brace_detected = detect_brace(file); | 698 | brace_detected = detect_brace(file); |
699 | if (brace_detected > 0) { | 699 | if (brace_detected > 0) { |
700 | line_number += brace_detected; | 700 | line_number += brace_detected; |
701 | wlr_log(WLR_DEBUG, "Detected open brace on line %d", line_number); | 701 | sway_log(SWAY_DEBUG, "Detected open brace on line %d", line_number); |
702 | } | 702 | } |
703 | } | 703 | } |
704 | char *block = stack->length ? stack->items[0] : NULL; | 704 | char *block = stack->length ? stack->items[0] : NULL; |
@@ -720,7 +720,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
720 | switch(res->status) { | 720 | switch(res->status) { |
721 | case CMD_FAILURE: | 721 | case CMD_FAILURE: |
722 | case CMD_INVALID: | 722 | case CMD_INVALID: |
723 | wlr_log(WLR_ERROR, "Error on line %i '%s': %s (%s)", line_number, | 723 | sway_log(SWAY_ERROR, "Error on line %i '%s': %s (%s)", line_number, |
724 | line, res->error, config->current_config_path); | 724 | line, res->error, config->current_config_path); |
725 | if (!config->validating) { | 725 | if (!config->validating) { |
726 | swaynag_log(config->swaynag_command, swaynag, | 726 | swaynag_log(config->swaynag_command, swaynag, |
@@ -731,17 +731,17 @@ bool read_config(FILE *file, struct sway_config *config, | |||
731 | break; | 731 | break; |
732 | 732 | ||
733 | case CMD_DEFER: | 733 | case CMD_DEFER: |
734 | wlr_log(WLR_DEBUG, "Deferring command `%s'", line); | 734 | sway_log(SWAY_DEBUG, "Deferring command `%s'", line); |
735 | list_add(config->cmd_queue, strdup(expanded)); | 735 | list_add(config->cmd_queue, strdup(expanded)); |
736 | break; | 736 | break; |
737 | 737 | ||
738 | case CMD_BLOCK_COMMANDS: | 738 | case CMD_BLOCK_COMMANDS: |
739 | wlr_log(WLR_DEBUG, "Entering commands block"); | 739 | sway_log(SWAY_DEBUG, "Entering commands block"); |
740 | list_insert(stack, 0, "<commands>"); | 740 | list_insert(stack, 0, "<commands>"); |
741 | break; | 741 | break; |
742 | 742 | ||
743 | case CMD_BLOCK: | 743 | case CMD_BLOCK: |
744 | wlr_log(WLR_DEBUG, "Entering block '%s'", new_block); | 744 | sway_log(SWAY_DEBUG, "Entering block '%s'", new_block); |
745 | list_insert(stack, 0, strdup(new_block)); | 745 | list_insert(stack, 0, strdup(new_block)); |
746 | if (strcmp(new_block, "bar") == 0) { | 746 | if (strcmp(new_block, "bar") == 0) { |
747 | config->current_bar = NULL; | 747 | config->current_bar = NULL; |
@@ -750,7 +750,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
750 | 750 | ||
751 | case CMD_BLOCK_END: | 751 | case CMD_BLOCK_END: |
752 | if (!block) { | 752 | if (!block) { |
753 | wlr_log(WLR_DEBUG, "Unmatched '}' on line %i", line_number); | 753 | sway_log(SWAY_DEBUG, "Unmatched '}' on line %i", line_number); |
754 | success = false; | 754 | success = false; |
755 | break; | 755 | break; |
756 | } | 756 | } |
@@ -758,7 +758,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
758 | config->current_bar = NULL; | 758 | config->current_bar = NULL; |
759 | } | 759 | } |
760 | 760 | ||
761 | wlr_log(WLR_DEBUG, "Exiting block '%s'", block); | 761 | sway_log(SWAY_DEBUG, "Exiting block '%s'", block); |
762 | list_del(stack, 0); | 762 | list_del(stack, 0); |
763 | free(block); | 763 | free(block); |
764 | memset(&config->handler_context, 0, | 764 | memset(&config->handler_context, 0, |
@@ -786,7 +786,7 @@ void config_add_swaynag_warning(char *fmt, ...) { | |||
786 | 786 | ||
787 | char *temp = malloc(length + 1); | 787 | char *temp = malloc(length + 1); |
788 | if (!temp) { | 788 | if (!temp) { |
789 | wlr_log(WLR_ERROR, "Failed to allocate buffer for warning."); | 789 | sway_log(SWAY_ERROR, "Failed to allocate buffer for warning."); |
790 | return; | 790 | return; |
791 | } | 791 | } |
792 | 792 | ||
@@ -828,7 +828,7 @@ char *do_var_replacement(char *str) { | |||
828 | int vvlen = strlen(var->value); | 828 | int vvlen = strlen(var->value); |
829 | char *newstr = malloc(strlen(str) - vnlen + vvlen + 1); | 829 | char *newstr = malloc(strlen(str) - vnlen + vvlen + 1); |
830 | if (!newstr) { | 830 | if (!newstr) { |
831 | wlr_log(WLR_ERROR, | 831 | sway_log(SWAY_ERROR, |
832 | "Unable to allocate replacement " | 832 | "Unable to allocate replacement " |
833 | "during variable expansion"); | 833 | "during variable expansion"); |
834 | break; | 834 | break; |
diff --git a/sway/config/bar.c b/sway/config/bar.c index b1aa2313..0fdac5d8 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c | |||
@@ -19,10 +19,10 @@ | |||
19 | #include "util.h" | 19 | #include "util.h" |
20 | 20 | ||
21 | static void terminate_swaybar(pid_t pid) { | 21 | static void terminate_swaybar(pid_t pid) { |
22 | wlr_log(WLR_DEBUG, "Terminating swaybar %d", pid); | 22 | sway_log(SWAY_DEBUG, "Terminating swaybar %d", pid); |
23 | int ret = kill(-pid, SIGTERM); | 23 | int ret = kill(-pid, SIGTERM); |
24 | if (ret != 0) { | 24 | if (ret != 0) { |
25 | wlr_log_errno(WLR_ERROR, "Unable to terminate swaybar %d", pid); | 25 | sway_log_errno(SWAY_ERROR, "Unable to terminate swaybar %d", pid); |
26 | } else { | 26 | } else { |
27 | int status; | 27 | int status; |
28 | waitpid(pid, &status, 0); | 28 | waitpid(pid, &status, 0); |
@@ -194,7 +194,7 @@ static void invoke_swaybar(struct bar_config *bar) { | |||
194 | // Pipe to communicate errors | 194 | // Pipe to communicate errors |
195 | int filedes[2]; | 195 | int filedes[2]; |
196 | if (pipe(filedes) == -1) { | 196 | if (pipe(filedes) == -1) { |
197 | wlr_log(WLR_ERROR, "Pipe setup failed! Cannot fork into bar"); | 197 | sway_log(SWAY_ERROR, "Pipe setup failed! Cannot fork into bar"); |
198 | return; | 198 | return; |
199 | } | 199 | } |
200 | 200 | ||
@@ -227,17 +227,17 @@ static void invoke_swaybar(struct bar_config *bar) { | |||
227 | execvp(cmd[0], cmd); | 227 | execvp(cmd[0], cmd); |
228 | exit(1); | 228 | exit(1); |
229 | } | 229 | } |
230 | wlr_log(WLR_DEBUG, "Spawned swaybar %d", bar->pid); | 230 | sway_log(SWAY_DEBUG, "Spawned swaybar %d", bar->pid); |
231 | close(filedes[0]); | 231 | close(filedes[0]); |
232 | size_t len; | 232 | size_t len; |
233 | if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { | 233 | if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { |
234 | char *buf = malloc(len); | 234 | char *buf = malloc(len); |
235 | if(!buf) { | 235 | if(!buf) { |
236 | wlr_log(WLR_ERROR, "Cannot allocate error string"); | 236 | sway_log(SWAY_ERROR, "Cannot allocate error string"); |
237 | return; | 237 | return; |
238 | } | 238 | } |
239 | if (read(filedes[1], buf, len)) { | 239 | if (read(filedes[1], buf, len)) { |
240 | wlr_log(WLR_ERROR, "%s", buf); | 240 | sway_log(SWAY_ERROR, "%s", buf); |
241 | } | 241 | } |
242 | free(buf); | 242 | free(buf); |
243 | } | 243 | } |
@@ -248,7 +248,7 @@ void load_swaybar(struct bar_config *bar) { | |||
248 | if (bar->pid != 0) { | 248 | if (bar->pid != 0) { |
249 | terminate_swaybar(bar->pid); | 249 | terminate_swaybar(bar->pid); |
250 | } | 250 | } |
251 | wlr_log(WLR_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); | 251 | sway_log(SWAY_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); |
252 | invoke_swaybar(bar); | 252 | invoke_swaybar(bar); |
253 | } | 253 | } |
254 | 254 | ||
diff --git a/sway/config/input.c b/sway/config/input.c index d649d34d..63c28635 100644 --- a/sway/config/input.c +++ b/sway/config/input.c | |||
@@ -8,13 +8,13 @@ | |||
8 | struct input_config *new_input_config(const char* identifier) { | 8 | struct 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(WLR_DEBUG, "Unable to allocate input config"); | 11 | sway_log(SWAY_DEBUG, "Unable to allocate input config"); |
12 | return NULL; | 12 | return NULL; |
13 | } | 13 | } |
14 | wlr_log(WLR_DEBUG, "new_input_config(%s)", identifier); | 14 | sway_log(SWAY_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(WLR_DEBUG, "Unable to allocate input config"); | 17 | sway_log(SWAY_DEBUG, "Unable to allocate input config"); |
18 | return NULL; | 18 | return NULL; |
19 | } | 19 | } |
20 | 20 | ||
@@ -136,7 +136,7 @@ static void merge_wildcard_on_all(struct input_config *wildcard) { | |||
136 | for (int i = 0; i < config->input_configs->length; i++) { | 136 | for (int i = 0; i < config->input_configs->length; i++) { |
137 | struct input_config *ic = config->input_configs->items[i]; | 137 | struct input_config *ic = config->input_configs->items[i]; |
138 | if (strcmp(wildcard->identifier, ic->identifier) != 0) { | 138 | if (strcmp(wildcard->identifier, ic->identifier) != 0) { |
139 | wlr_log(WLR_DEBUG, "Merging input * config on %s", ic->identifier); | 139 | sway_log(SWAY_DEBUG, "Merging input * config on %s", ic->identifier); |
140 | merge_input_config(ic, wildcard); | 140 | merge_input_config(ic, wildcard); |
141 | } | 141 | } |
142 | } | 142 | } |
@@ -151,16 +151,16 @@ struct input_config *store_input_config(struct input_config *ic) { | |||
151 | int i = list_seq_find(config->input_configs, input_identifier_cmp, | 151 | int i = list_seq_find(config->input_configs, input_identifier_cmp, |
152 | ic->identifier); | 152 | ic->identifier); |
153 | if (i >= 0) { | 153 | if (i >= 0) { |
154 | wlr_log(WLR_DEBUG, "Merging on top of existing input config"); | 154 | sway_log(SWAY_DEBUG, "Merging on top of existing input config"); |
155 | struct input_config *current = config->input_configs->items[i]; | 155 | struct input_config *current = config->input_configs->items[i]; |
156 | merge_input_config(current, ic); | 156 | merge_input_config(current, ic); |
157 | free_input_config(ic); | 157 | free_input_config(ic); |
158 | ic = current; | 158 | ic = current; |
159 | } else if (!wildcard) { | 159 | } else if (!wildcard) { |
160 | wlr_log(WLR_DEBUG, "Adding non-wildcard input config"); | 160 | sway_log(SWAY_DEBUG, "Adding non-wildcard input config"); |
161 | i = list_seq_find(config->input_configs, input_identifier_cmp, "*"); | 161 | i = list_seq_find(config->input_configs, input_identifier_cmp, "*"); |
162 | if (i >= 0) { | 162 | if (i >= 0) { |
163 | wlr_log(WLR_DEBUG, "Merging on top of input * config"); | 163 | sway_log(SWAY_DEBUG, "Merging on top of input * config"); |
164 | struct input_config *current = new_input_config(ic->identifier); | 164 | struct input_config *current = new_input_config(ic->identifier); |
165 | merge_input_config(current, config->input_configs->items[i]); | 165 | merge_input_config(current, config->input_configs->items[i]); |
166 | merge_input_config(current, ic); | 166 | merge_input_config(current, ic); |
@@ -170,11 +170,11 @@ struct input_config *store_input_config(struct input_config *ic) { | |||
170 | list_add(config->input_configs, ic); | 170 | list_add(config->input_configs, ic); |
171 | } else { | 171 | } else { |
172 | // New wildcard config. Just add it | 172 | // New wildcard config. Just add it |
173 | wlr_log(WLR_DEBUG, "Adding input * config"); | 173 | sway_log(SWAY_DEBUG, "Adding input * config"); |
174 | list_add(config->input_configs, ic); | 174 | list_add(config->input_configs, ic); |
175 | } | 175 | } |
176 | 176 | ||
177 | wlr_log(WLR_DEBUG, "Config stored for input %s", ic->identifier); | 177 | sway_log(SWAY_DEBUG, "Config stored for input %s", ic->identifier); |
178 | 178 | ||
179 | return ic; | 179 | return ic; |
180 | } | 180 | } |
diff --git a/sway/config/output.c b/sway/config/output.c index 8f59c863..ec833ffe 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -91,7 +91,7 @@ static void merge_wildcard_on_all(struct output_config *wildcard) { | |||
91 | for (int i = 0; i < config->output_configs->length; i++) { | 91 | for (int i = 0; i < config->output_configs->length; i++) { |
92 | struct output_config *oc = config->output_configs->items[i]; | 92 | struct output_config *oc = config->output_configs->items[i]; |
93 | if (strcmp(wildcard->name, oc->name) != 0) { | 93 | if (strcmp(wildcard->name, oc->name) != 0) { |
94 | wlr_log(WLR_DEBUG, "Merging output * config on %s", oc->name); | 94 | sway_log(SWAY_DEBUG, "Merging output * config on %s", oc->name); |
95 | merge_output_config(oc, wildcard); | 95 | merge_output_config(oc, wildcard); |
96 | } | 96 | } |
97 | } | 97 | } |
@@ -105,16 +105,16 @@ struct output_config *store_output_config(struct output_config *oc) { | |||
105 | 105 | ||
106 | int i = list_seq_find(config->output_configs, output_name_cmp, oc->name); | 106 | int i = list_seq_find(config->output_configs, output_name_cmp, oc->name); |
107 | if (i >= 0) { | 107 | if (i >= 0) { |
108 | wlr_log(WLR_DEBUG, "Merging on top of existing output config"); | 108 | sway_log(SWAY_DEBUG, "Merging on top of existing output config"); |
109 | struct output_config *current = config->output_configs->items[i]; | 109 | struct output_config *current = config->output_configs->items[i]; |
110 | merge_output_config(current, oc); | 110 | merge_output_config(current, oc); |
111 | free_output_config(oc); | 111 | free_output_config(oc); |
112 | oc = current; | 112 | oc = current; |
113 | } else if (!wildcard) { | 113 | } else if (!wildcard) { |
114 | wlr_log(WLR_DEBUG, "Adding non-wildcard output config"); | 114 | sway_log(SWAY_DEBUG, "Adding non-wildcard output config"); |
115 | i = list_seq_find(config->output_configs, output_name_cmp, "*"); | 115 | i = list_seq_find(config->output_configs, output_name_cmp, "*"); |
116 | if (i >= 0) { | 116 | if (i >= 0) { |
117 | wlr_log(WLR_DEBUG, "Merging on top of output * config"); | 117 | sway_log(SWAY_DEBUG, "Merging on top of output * config"); |
118 | struct output_config *current = new_output_config(oc->name); | 118 | struct output_config *current = new_output_config(oc->name); |
119 | merge_output_config(current, config->output_configs->items[i]); | 119 | merge_output_config(current, config->output_configs->items[i]); |
120 | merge_output_config(current, oc); | 120 | merge_output_config(current, oc); |
@@ -124,11 +124,11 @@ struct output_config *store_output_config(struct output_config *oc) { | |||
124 | list_add(config->output_configs, oc); | 124 | list_add(config->output_configs, oc); |
125 | } else { | 125 | } else { |
126 | // New wildcard config. Just add it | 126 | // New wildcard config. Just add it |
127 | wlr_log(WLR_DEBUG, "Adding output * config"); | 127 | sway_log(SWAY_DEBUG, "Adding output * config"); |
128 | list_add(config->output_configs, oc); | 128 | list_add(config->output_configs, oc); |
129 | } | 129 | } |
130 | 130 | ||
131 | wlr_log(WLR_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " | 131 | sway_log(SWAY_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " |
132 | "position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)", | 132 | "position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)", |
133 | oc->name, oc->enabled, oc->width, oc->height, oc->refresh_rate, | 133 | oc->name, oc->enabled, oc->width, oc->height, oc->refresh_rate, |
134 | oc->x, oc->y, oc->scale, oc->transform, oc->background, | 134 | oc->x, oc->y, oc->scale, oc->transform, oc->background, |
@@ -141,7 +141,7 @@ static bool set_mode(struct wlr_output *output, int width, int height, | |||
141 | float refresh_rate) { | 141 | float refresh_rate) { |
142 | int mhz = (int)(refresh_rate * 1000); | 142 | int mhz = (int)(refresh_rate * 1000); |
143 | if (wl_list_empty(&output->modes)) { | 143 | if (wl_list_empty(&output->modes)) { |
144 | wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name); | 144 | sway_log(SWAY_DEBUG, "Assigning custom mode to %s", output->name); |
145 | return wlr_output_set_custom_mode(output, width, height, mhz); | 145 | return wlr_output_set_custom_mode(output, width, height, mhz); |
146 | } | 146 | } |
147 | 147 | ||
@@ -156,11 +156,11 @@ static bool set_mode(struct wlr_output *output, int width, int height, | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | if (!best) { | 158 | if (!best) { |
159 | wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name); | 159 | sway_log(SWAY_ERROR, "Configured mode for %s not available", output->name); |
160 | wlr_log(WLR_INFO, "Picking default mode instead"); | 160 | sway_log(SWAY_INFO, "Picking default mode instead"); |
161 | best = wl_container_of(output->modes.prev, mode, link); | 161 | best = wl_container_of(output->modes.prev, mode, link); |
162 | } else { | 162 | } else { |
163 | wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); | 163 | sway_log(SWAY_DEBUG, "Assigning configured mode to %s", output->name); |
164 | } | 164 | } |
165 | return wlr_output_set_mode(output, best); | 165 | return wlr_output_set_mode(output, best); |
166 | } | 166 | } |
@@ -168,7 +168,7 @@ static bool set_mode(struct wlr_output *output, int width, int height, | |||
168 | void terminate_swaybg(pid_t pid) { | 168 | void terminate_swaybg(pid_t pid) { |
169 | int ret = kill(pid, SIGTERM); | 169 | int ret = kill(pid, SIGTERM); |
170 | if (ret != 0) { | 170 | if (ret != 0) { |
171 | wlr_log(WLR_ERROR, "Unable to terminate swaybg [pid: %d]", pid); | 171 | sway_log(SWAY_ERROR, "Unable to terminate swaybg [pid: %d]", pid); |
172 | } else { | 172 | } else { |
173 | int status; | 173 | int status; |
174 | waitpid(pid, &status, 0); | 174 | waitpid(pid, &status, 0); |
@@ -197,7 +197,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
197 | 197 | ||
198 | bool modeset_success; | 198 | bool modeset_success; |
199 | if (oc && oc->width > 0 && oc->height > 0) { | 199 | if (oc && oc->width > 0 && oc->height > 0) { |
200 | wlr_log(WLR_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, | 200 | sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, |
201 | oc->height, oc->refresh_rate); | 201 | oc->height, oc->refresh_rate); |
202 | modeset_success = | 202 | modeset_success = |
203 | set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); | 203 | set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); |
@@ -213,22 +213,22 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
213 | // Failed to modeset, maybe the output is missing a CRTC. Leave the | 213 | // Failed to modeset, maybe the output is missing a CRTC. Leave the |
214 | // output disabled for now and try again when the output gets the mode | 214 | // output disabled for now and try again when the output gets the mode |
215 | // we asked for. | 215 | // we asked for. |
216 | wlr_log(WLR_ERROR, "Failed to modeset output %s", wlr_output->name); | 216 | sway_log(SWAY_ERROR, "Failed to modeset output %s", wlr_output->name); |
217 | return false; | 217 | return false; |
218 | } | 218 | } |
219 | 219 | ||
220 | if (oc && oc->scale > 0) { | 220 | if (oc && oc->scale > 0) { |
221 | wlr_log(WLR_DEBUG, "Set %s scale to %f", oc->name, oc->scale); | 221 | sway_log(SWAY_DEBUG, "Set %s scale to %f", oc->name, oc->scale); |
222 | wlr_output_set_scale(wlr_output, oc->scale); | 222 | wlr_output_set_scale(wlr_output, oc->scale); |
223 | } | 223 | } |
224 | if (oc && oc->transform >= 0) { | 224 | if (oc && oc->transform >= 0) { |
225 | wlr_log(WLR_DEBUG, "Set %s transform to %d", oc->name, oc->transform); | 225 | sway_log(SWAY_DEBUG, "Set %s transform to %d", oc->name, oc->transform); |
226 | wlr_output_set_transform(wlr_output, oc->transform); | 226 | wlr_output_set_transform(wlr_output, oc->transform); |
227 | } | 227 | } |
228 | 228 | ||
229 | // Find position for it | 229 | // Find position for it |
230 | if (oc && (oc->x != -1 || oc->y != -1)) { | 230 | if (oc && (oc->x != -1 || oc->y != -1)) { |
231 | wlr_log(WLR_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); | 231 | sway_log(SWAY_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); |
232 | wlr_output_layout_add(root->output_layout, wlr_output, oc->x, oc->y); | 232 | wlr_output_layout_add(root->output_layout, wlr_output, oc->x, oc->y); |
233 | } else { | 233 | } else { |
234 | wlr_output_layout_add_auto(root->output_layout, wlr_output); | 234 | wlr_output_layout_add_auto(root->output_layout, wlr_output); |
@@ -238,7 +238,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
238 | terminate_swaybg(output->bg_pid); | 238 | terminate_swaybg(output->bg_pid); |
239 | } | 239 | } |
240 | if (oc && oc->background && config->swaybg_command) { | 240 | if (oc && oc->background && config->swaybg_command) { |
241 | wlr_log(WLR_DEBUG, "Setting background for output %s to %s", | 241 | sway_log(SWAY_DEBUG, "Setting background for output %s to %s", |
242 | wlr_output->name, oc->background); | 242 | wlr_output->name, oc->background); |
243 | 243 | ||
244 | char *const cmd[] = { | 244 | char *const cmd[] = { |
@@ -252,21 +252,21 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
252 | 252 | ||
253 | output->bg_pid = fork(); | 253 | output->bg_pid = fork(); |
254 | if (output->bg_pid < 0) { | 254 | if (output->bg_pid < 0) { |
255 | wlr_log_errno(WLR_ERROR, "fork failed"); | 255 | sway_log_errno(SWAY_ERROR, "fork failed"); |
256 | } else if (output->bg_pid == 0) { | 256 | } else if (output->bg_pid == 0) { |
257 | execvp(cmd[0], cmd); | 257 | execvp(cmd[0], cmd); |
258 | wlr_log_errno(WLR_ERROR, "Failed to execute swaybg"); | 258 | sway_log_errno(SWAY_ERROR, "Failed to execute swaybg"); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
262 | if (oc) { | 262 | if (oc) { |
263 | switch (oc->dpms_state) { | 263 | switch (oc->dpms_state) { |
264 | case DPMS_ON: | 264 | case DPMS_ON: |
265 | wlr_log(WLR_DEBUG, "Turning on screen"); | 265 | sway_log(SWAY_DEBUG, "Turning on screen"); |
266 | wlr_output_enable(wlr_output, true); | 266 | wlr_output_enable(wlr_output, true); |
267 | break; | 267 | break; |
268 | case DPMS_OFF: | 268 | case DPMS_OFF: |
269 | wlr_log(WLR_DEBUG, "Turning off screen"); | 269 | sway_log(SWAY_DEBUG, "Turning off screen"); |
270 | wlr_output_enable(wlr_output, false); | 270 | wlr_output_enable(wlr_output, false); |
271 | break; | 271 | break; |
272 | case DPMS_IGNORE: | 272 | case DPMS_IGNORE: |
@@ -325,7 +325,7 @@ static struct output_config *get_output_config(char *identifier, | |||
325 | merge_output_config(result, oc_name); | 325 | merge_output_config(result, oc_name); |
326 | merge_output_config(result, oc_id); | 326 | merge_output_config(result, oc_id); |
327 | 327 | ||
328 | wlr_log(WLR_DEBUG, "Generated output config \"%s\" (enabled: %d)" | 328 | sway_log(SWAY_DEBUG, "Generated output config \"%s\" (enabled: %d)" |
329 | " (%dx%d@%fHz position %d,%d scale %f transform %d) (bg %s %s)" | 329 | " (%dx%d@%fHz position %d,%d scale %f transform %d) (bg %s %s)" |
330 | " (dpms %d)", result->name, result->enabled, result->width, | 330 | " (dpms %d)", result->name, result->enabled, result->width, |
331 | result->height, result->refresh_rate, result->x, result->y, | 331 | result->height, result->refresh_rate, result->x, result->y, |
diff --git a/sway/config/seat.c b/sway/config/seat.c index d7316c68..92dc42e3 100644 --- a/sway/config/seat.c +++ b/sway/config/seat.c | |||
@@ -7,7 +7,7 @@ | |||
7 | struct seat_config *new_seat_config(const char* name) { | 7 | struct 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(WLR_DEBUG, "Unable to allocate seat config"); | 10 | sway_log(SWAY_DEBUG, "Unable to allocate seat config"); |
11 | return NULL; | 11 | return NULL; |
12 | } | 12 | } |
13 | 13 | ||
@@ -34,7 +34,7 @@ static void merge_wildcard_on_all(struct seat_config *wildcard) { | |||
34 | for (int i = 0; i < config->seat_configs->length; i++) { | 34 | for (int i = 0; i < config->seat_configs->length; i++) { |
35 | struct seat_config *sc = config->seat_configs->items[i]; | 35 | struct seat_config *sc = config->seat_configs->items[i]; |
36 | if (strcmp(wildcard->name, sc->name) != 0) { | 36 | if (strcmp(wildcard->name, sc->name) != 0) { |
37 | wlr_log(WLR_DEBUG, "Merging seat * config on %s", sc->name); | 37 | sway_log(SWAY_DEBUG, "Merging seat * config on %s", sc->name); |
38 | merge_seat_config(sc, wildcard); | 38 | merge_seat_config(sc, wildcard); |
39 | } | 39 | } |
40 | } | 40 | } |
@@ -48,16 +48,16 @@ struct seat_config *store_seat_config(struct seat_config *sc) { | |||
48 | 48 | ||
49 | int i = list_seq_find(config->seat_configs, seat_name_cmp, sc->name); | 49 | int i = list_seq_find(config->seat_configs, seat_name_cmp, sc->name); |
50 | if (i >= 0) { | 50 | if (i >= 0) { |
51 | wlr_log(WLR_DEBUG, "Merging on top of existing seat config"); | 51 | sway_log(SWAY_DEBUG, "Merging on top of existing seat config"); |
52 | struct seat_config *current = config->seat_configs->items[i]; | 52 | struct seat_config *current = config->seat_configs->items[i]; |
53 | merge_seat_config(current, sc); | 53 | merge_seat_config(current, sc); |
54 | free_seat_config(sc); | 54 | free_seat_config(sc); |
55 | sc = current; | 55 | sc = current; |
56 | } else if (!wildcard) { | 56 | } else if (!wildcard) { |
57 | wlr_log(WLR_DEBUG, "Adding non-wildcard seat config"); | 57 | sway_log(SWAY_DEBUG, "Adding non-wildcard seat config"); |
58 | i = list_seq_find(config->seat_configs, seat_name_cmp, "*"); | 58 | i = list_seq_find(config->seat_configs, seat_name_cmp, "*"); |
59 | if (i >= 0) { | 59 | if (i >= 0) { |
60 | wlr_log(WLR_DEBUG, "Merging on top of seat * config"); | 60 | sway_log(SWAY_DEBUG, "Merging on top of seat * config"); |
61 | struct seat_config *current = new_seat_config(sc->name); | 61 | struct seat_config *current = new_seat_config(sc->name); |
62 | merge_seat_config(current, config->seat_configs->items[i]); | 62 | merge_seat_config(current, config->seat_configs->items[i]); |
63 | merge_seat_config(current, sc); | 63 | merge_seat_config(current, sc); |
@@ -67,11 +67,11 @@ struct seat_config *store_seat_config(struct seat_config *sc) { | |||
67 | list_add(config->seat_configs, sc); | 67 | list_add(config->seat_configs, sc); |
68 | } else { | 68 | } else { |
69 | // New wildcard config. Just add it | 69 | // New wildcard config. Just add it |
70 | wlr_log(WLR_DEBUG, "Adding seat * config"); | 70 | sway_log(SWAY_DEBUG, "Adding seat * config"); |
71 | list_add(config->seat_configs, sc); | 71 | list_add(config->seat_configs, sc); |
72 | } | 72 | } |
73 | 73 | ||
74 | wlr_log(WLR_DEBUG, "Config stored for seat %s", sc->name); | 74 | sway_log(SWAY_DEBUG, "Config stored for seat %s", sc->name); |
75 | 75 | ||
76 | return sc; | 76 | return sc; |
77 | } | 77 | } |
@@ -80,7 +80,7 @@ struct seat_attachment_config *seat_attachment_config_new(void) { | |||
80 | struct seat_attachment_config *attachment = | 80 | struct seat_attachment_config *attachment = |
81 | calloc(1, sizeof(struct seat_attachment_config)); | 81 | calloc(1, sizeof(struct seat_attachment_config)); |
82 | if (!attachment) { | 82 | if (!attachment) { |
83 | wlr_log(WLR_DEBUG, "cannot allocate attachment config"); | 83 | sway_log(SWAY_DEBUG, "cannot allocate attachment config"); |
84 | return NULL; | 84 | return NULL; |
85 | } | 85 | } |
86 | return attachment; | 86 | return attachment; |
diff --git a/sway/criteria.c b/sway/criteria.c index 54583b04..59a923f9 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -626,7 +626,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) { | |||
626 | } | 626 | } |
627 | unescape(value); | 627 | unescape(value); |
628 | } | 628 | } |
629 | wlr_log(WLR_DEBUG, "Found pair: %s=%s", name, value); | 629 | sway_log(SWAY_DEBUG, "Found pair: %s=%s", name, value); |
630 | if (!parse_token(criteria, name, value)) { | 630 | if (!parse_token(criteria, name, value)) { |
631 | *error_arg = error; | 631 | *error_arg = error; |
632 | goto cleanup; | 632 | goto cleanup; |
diff --git a/sway/debug-tree.c b/sway/debug-tree.c index b3266241..0444bb3f 100644 --- a/sway/debug-tree.c +++ b/sway/debug-tree.c | |||
@@ -1,7 +1,6 @@ | |||
1 | #include <pango/pangocairo.h> | 1 | #include <pango/pangocairo.h> |
2 | #include <wlr/backend.h> | 2 | #include <wlr/backend.h> |
3 | #include <wlr/render/wlr_texture.h> | 3 | #include <wlr/render/wlr_texture.h> |
4 | #include <wlr/util/log.h> | ||
5 | #include "config.h" | 4 | #include "config.h" |
6 | #include "sway/debug.h" | 5 | #include "sway/debug.h" |
7 | #include "sway/input/input-manager.h" | 6 | #include "sway/input/input-manager.h" |
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c index 17d4242b..87b4ef43 100644 --- a/sway/desktop/idle_inhibit_v1.c +++ b/sway/desktop/idle_inhibit_v1.c | |||
@@ -9,7 +9,7 @@ | |||
9 | static void handle_destroy(struct wl_listener *listener, void *data) { | 9 | static 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(WLR_DEBUG, "Sway idle inhibitor destroyed"); | 12 | sway_log(SWAY_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(WLR_DEBUG, "New sway idle inhibitor"); | 23 | sway_log(SWAY_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 ab05778d..a870bb9a 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <wlr/types/wlr_layer_shell_v1.h> | 6 | #include <wlr/types/wlr_layer_shell_v1.h> |
7 | #include <wlr/types/wlr_output_damage.h> | 7 | #include <wlr/types/wlr_output_damage.h> |
8 | #include <wlr/types/wlr_output.h> | 8 | #include <wlr/types/wlr_output.h> |
9 | #include <wlr/util/log.h> | ||
10 | #include "sway/desktop/transaction.h" | 9 | #include "sway/desktop/transaction.h" |
11 | #include "sway/input/input-manager.h" | 10 | #include "sway/input/input-manager.h" |
12 | #include "sway/input/seat.h" | 11 | #include "sway/input/seat.h" |
@@ -175,7 +174,7 @@ void arrange_layers(struct sway_output *output) { | |||
175 | 174 | ||
176 | if (memcmp(&usable_area, &output->usable_area, | 175 | if (memcmp(&usable_area, &output->usable_area, |
177 | sizeof(struct wlr_box)) != 0) { | 176 | sizeof(struct wlr_box)) != 0) { |
178 | wlr_log(WLR_DEBUG, "Usable area changed, rearranging output"); | 177 | sway_log(SWAY_DEBUG, "Usable area changed, rearranging output"); |
179 | memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); | 178 | memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); |
180 | arrange_output(output); | 179 | arrange_output(output); |
181 | } | 180 | } |
@@ -308,7 +307,7 @@ static void unmap(struct sway_layer_surface *sway_layer) { | |||
308 | static void handle_destroy(struct wl_listener *listener, void *data) { | 307 | static void handle_destroy(struct wl_listener *listener, void *data) { |
309 | struct sway_layer_surface *sway_layer = | 308 | struct sway_layer_surface *sway_layer = |
310 | wl_container_of(listener, sway_layer, destroy); | 309 | wl_container_of(listener, sway_layer, destroy); |
311 | wlr_log(WLR_DEBUG, "Layer surface destroyed (%s)", | 310 | sway_log(SWAY_DEBUG, "Layer surface destroyed (%s)", |
312 | sway_layer->layer_surface->namespace); | 311 | sway_layer->layer_surface->namespace); |
313 | if (sway_layer->layer_surface->mapped) { | 312 | if (sway_layer->layer_surface->mapped) { |
314 | unmap(sway_layer); | 313 | unmap(sway_layer); |
@@ -357,7 +356,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
357 | struct wlr_layer_surface_v1 *layer_surface = data; | 356 | struct wlr_layer_surface_v1 *layer_surface = data; |
358 | struct sway_server *server = | 357 | struct sway_server *server = |
359 | wl_container_of(listener, server, layer_shell_surface); | 358 | wl_container_of(listener, server, layer_shell_surface); |
360 | wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d " | 359 | sway_log(SWAY_DEBUG, "new layer surface: namespace %s layer %d anchor %d " |
361 | "size %dx%d margin %d,%d,%d,%d", | 360 | "size %dx%d margin %d,%d,%d,%d", |
362 | layer_surface->namespace, layer_surface->layer, layer_surface->layer, | 361 | layer_surface->namespace, layer_surface->layer, layer_surface->layer, |
363 | layer_surface->client_pending.desired_width, | 362 | layer_surface->client_pending.desired_width, |
@@ -380,7 +379,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
380 | } | 379 | } |
381 | if (!output) { | 380 | if (!output) { |
382 | if (!root->outputs->length) { | 381 | if (!root->outputs->length) { |
383 | wlr_log(WLR_ERROR, | 382 | sway_log(SWAY_ERROR, |
384 | "no output to auto-assign layer surface '%s' to", | 383 | "no output to auto-assign layer surface '%s' to", |
385 | layer_surface->namespace); | 384 | layer_surface->namespace); |
386 | wlr_layer_surface_v1_close(layer_surface); | 385 | wlr_layer_surface_v1_close(layer_surface); |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 646b6d70..edf77fbc 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -510,7 +510,7 @@ static void handle_mode(struct wl_listener *listener, void *data) { | |||
510 | // We want to enable this output, but it didn't work last time, | 510 | // We want to enable this output, but it didn't work last time, |
511 | // possibly because we hadn't enough CRTCs. Try again now that the | 511 | // possibly because we hadn't enough CRTCs. Try again now that the |
512 | // output has a mode. | 512 | // output has a mode. |
513 | wlr_log(WLR_DEBUG, "Output %s has gained a CRTC, " | 513 | sway_log(SWAY_DEBUG, "Output %s has gained a CRTC, " |
514 | "trying to enable it", output->wlr_output->name); | 514 | "trying to enable it", output->wlr_output->name); |
515 | apply_output_config(oc, output); | 515 | apply_output_config(oc, output); |
516 | } | 516 | } |
@@ -580,7 +580,7 @@ static void handle_present(struct wl_listener *listener, void *data) { | |||
580 | void handle_new_output(struct wl_listener *listener, void *data) { | 580 | void handle_new_output(struct wl_listener *listener, void *data) { |
581 | struct sway_server *server = wl_container_of(listener, server, new_output); | 581 | struct sway_server *server = wl_container_of(listener, server, new_output); |
582 | struct wlr_output *wlr_output = data; | 582 | struct wlr_output *wlr_output = data; |
583 | wlr_log(WLR_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); | 583 | sway_log(SWAY_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); |
584 | 584 | ||
585 | struct sway_output *output = output_create(wlr_output); | 585 | struct sway_output *output = output_create(wlr_output); |
586 | if (!output) { | 586 | if (!output) { |
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 1cdd7c6d..55cf1c5e 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -260,14 +260,14 @@ static void apply_container_state(struct sway_container *container, | |||
260 | * Apply a transaction to the "current" state of the tree. | 260 | * Apply a transaction to the "current" state of the tree. |
261 | */ | 261 | */ |
262 | static void transaction_apply(struct sway_transaction *transaction) { | 262 | static void transaction_apply(struct sway_transaction *transaction) { |
263 | wlr_log(WLR_DEBUG, "Applying transaction %p", transaction); | 263 | sway_log(SWAY_DEBUG, "Applying transaction %p", transaction); |
264 | if (debug.txn_timings) { | 264 | if (debug.txn_timings) { |
265 | struct timespec now; | 265 | struct timespec now; |
266 | clock_gettime(CLOCK_MONOTONIC, &now); | 266 | clock_gettime(CLOCK_MONOTONIC, &now); |
267 | struct timespec *commit = &transaction->commit_time; | 267 | struct timespec *commit = &transaction->commit_time; |
268 | float ms = (now.tv_sec - commit->tv_sec) * 1000 + | 268 | float ms = (now.tv_sec - commit->tv_sec) * 1000 + |
269 | (now.tv_nsec - commit->tv_nsec) / 1000000.0; | 269 | (now.tv_nsec - commit->tv_nsec) / 1000000.0; |
270 | wlr_log(WLR_DEBUG, "Transaction %p: %.1fms waiting " | 270 | sway_log(SWAY_DEBUG, "Transaction %p: %.1fms waiting " |
271 | "(%.1f frames if 60Hz)", transaction, ms, ms / (1000.0f / 60)); | 271 | "(%.1f frames if 60Hz)", transaction, ms, ms / (1000.0f / 60)); |
272 | } | 272 | } |
273 | 273 | ||
@@ -363,7 +363,7 @@ static void transaction_progress_queue(void) { | |||
363 | 363 | ||
364 | static int handle_timeout(void *data) { | 364 | static int handle_timeout(void *data) { |
365 | struct sway_transaction *transaction = data; | 365 | struct sway_transaction *transaction = data; |
366 | wlr_log(WLR_DEBUG, "Transaction %p timed out (%zi waiting)", | 366 | sway_log(SWAY_DEBUG, "Transaction %p timed out (%zi waiting)", |
367 | transaction, transaction->num_waiting); | 367 | transaction, transaction->num_waiting); |
368 | transaction->num_waiting = 0; | 368 | transaction->num_waiting = 0; |
369 | transaction_progress_queue(); | 369 | transaction_progress_queue(); |
@@ -398,7 +398,7 @@ static bool should_configure(struct sway_node *node, | |||
398 | } | 398 | } |
399 | 399 | ||
400 | static void transaction_commit(struct sway_transaction *transaction) { | 400 | static void transaction_commit(struct sway_transaction *transaction) { |
401 | wlr_log(WLR_DEBUG, "Transaction %p committing with %i instructions", | 401 | sway_log(SWAY_DEBUG, "Transaction %p committing with %i instructions", |
402 | transaction, transaction->instructions->length); | 402 | transaction, transaction->instructions->length); |
403 | transaction->num_waiting = 0; | 403 | transaction->num_waiting = 0; |
404 | for (int i = 0; i < transaction->instructions->length; ++i) { | 404 | for (int i = 0; i < transaction->instructions->length; ++i) { |
@@ -449,7 +449,7 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
449 | wl_event_source_timer_update(transaction->timer, | 449 | wl_event_source_timer_update(transaction->timer, |
450 | server.txn_timeout_ms); | 450 | server.txn_timeout_ms); |
451 | } else { | 451 | } else { |
452 | wlr_log(WLR_ERROR, "Unable to create transaction timer (%s). " | 452 | sway_log(SWAY_ERROR, "Unable to create transaction timer (%s). " |
453 | "Some imperfect frames might be rendered.", | 453 | "Some imperfect frames might be rendered.", |
454 | strerror(errno)); | 454 | strerror(errno)); |
455 | transaction->num_waiting = 0; | 455 | transaction->num_waiting = 0; |
@@ -472,7 +472,7 @@ static void set_instruction_ready( | |||
472 | struct timespec *start = &transaction->commit_time; | 472 | struct timespec *start = &transaction->commit_time; |
473 | float ms = (now.tv_sec - start->tv_sec) * 1000 + | 473 | float ms = (now.tv_sec - start->tv_sec) * 1000 + |
474 | (now.tv_nsec - start->tv_nsec) / 1000000.0; | 474 | (now.tv_nsec - start->tv_nsec) / 1000000.0; |
475 | wlr_log(WLR_DEBUG, "Transaction %p: %zi/%zi ready in %.1fms (%s)", | 475 | sway_log(SWAY_DEBUG, "Transaction %p: %zi/%zi ready in %.1fms (%s)", |
476 | transaction, | 476 | transaction, |
477 | transaction->num_configures - transaction->num_waiting + 1, | 477 | transaction->num_configures - transaction->num_waiting + 1, |
478 | transaction->num_configures, ms, | 478 | transaction->num_configures, ms, |
@@ -481,7 +481,7 @@ static void set_instruction_ready( | |||
481 | 481 | ||
482 | // If the transaction has timed out then its num_waiting will be 0 already. | 482 | // If the transaction has timed out then its num_waiting will be 0 already. |
483 | if (transaction->num_waiting > 0 && --transaction->num_waiting == 0) { | 483 | if (transaction->num_waiting > 0 && --transaction->num_waiting == 0) { |
484 | wlr_log(WLR_DEBUG, "Transaction %p is ready", transaction); | 484 | sway_log(SWAY_DEBUG, "Transaction %p is ready", transaction); |
485 | wl_event_source_timer_update(transaction->timer, 0); | 485 | wl_event_source_timer_update(transaction->timer, 0); |
486 | } | 486 | } |
487 | 487 | ||
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 7da86136..b4ac3a68 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -485,11 +485,11 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { | |||
485 | struct wlr_xdg_surface *xdg_surface = data; | 485 | struct wlr_xdg_surface *xdg_surface = data; |
486 | 486 | ||
487 | if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { | 487 | if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { |
488 | wlr_log(WLR_DEBUG, "New xdg_shell popup"); | 488 | sway_log(SWAY_DEBUG, "New xdg_shell popup"); |
489 | return; | 489 | return; |
490 | } | 490 | } |
491 | 491 | ||
492 | wlr_log(WLR_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'", | 492 | sway_log(SWAY_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'", |
493 | xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); | 493 | xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); |
494 | wlr_xdg_surface_ping(xdg_surface); | 494 | wlr_xdg_surface_ping(xdg_surface); |
495 | 495 | ||
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 9f6741c8..553d532d 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -469,11 +469,11 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { | |||
469 | struct wlr_xdg_surface_v6 *xdg_surface = data; | 469 | struct wlr_xdg_surface_v6 *xdg_surface = data; |
470 | 470 | ||
471 | if (xdg_surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { | 471 | if (xdg_surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { |
472 | wlr_log(WLR_DEBUG, "New xdg_shell_v6 popup"); | 472 | sway_log(SWAY_DEBUG, "New xdg_shell_v6 popup"); |
473 | return; | 473 | return; |
474 | } | 474 | } |
475 | 475 | ||
476 | wlr_log(WLR_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'", | 476 | sway_log(SWAY_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'", |
477 | xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); | 477 | xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); |
478 | wlr_xdg_surface_v6_ping(xdg_surface); | 478 | wlr_xdg_surface_v6_ping(xdg_surface); |
479 | 479 | ||
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 080f6c41..8dcf4bd6 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -118,7 +118,7 @@ static struct sway_xwayland_unmanaged *create_unmanaged( | |||
118 | struct sway_xwayland_unmanaged *surface = | 118 | struct sway_xwayland_unmanaged *surface = |
119 | calloc(1, sizeof(struct sway_xwayland_unmanaged)); | 119 | calloc(1, sizeof(struct sway_xwayland_unmanaged)); |
120 | if (surface == NULL) { | 120 | if (surface == NULL) { |
121 | wlr_log(WLR_ERROR, "Allocation failed"); | 121 | sway_log(SWAY_ERROR, "Allocation failed"); |
122 | return NULL; | 122 | return NULL; |
123 | } | 123 | } |
124 | 124 | ||
@@ -578,12 +578,12 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
578 | struct wlr_xwayland_surface *xsurface = data; | 578 | struct wlr_xwayland_surface *xsurface = data; |
579 | 579 | ||
580 | if (xsurface->override_redirect) { | 580 | if (xsurface->override_redirect) { |
581 | wlr_log(WLR_DEBUG, "New xwayland unmanaged surface"); | 581 | sway_log(SWAY_DEBUG, "New xwayland unmanaged surface"); |
582 | create_unmanaged(xsurface); | 582 | create_unmanaged(xsurface); |
583 | return; | 583 | return; |
584 | } | 584 | } |
585 | 585 | ||
586 | wlr_log(WLR_DEBUG, "New xwayland surface title='%s' class='%s'", | 586 | sway_log(SWAY_DEBUG, "New xwayland surface title='%s' class='%s'", |
587 | xsurface->title, xsurface->class); | 587 | xsurface->title, xsurface->class); |
588 | 588 | ||
589 | struct sway_xwayland_view *xwayland_view = | 589 | struct sway_xwayland_view *xwayland_view = |
@@ -655,7 +655,7 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) { | |||
655 | xcb_connection_t *xcb_conn = xcb_connect(NULL, NULL); | 655 | xcb_connection_t *xcb_conn = xcb_connect(NULL, NULL); |
656 | int err = xcb_connection_has_error(xcb_conn); | 656 | int err = xcb_connection_has_error(xcb_conn); |
657 | if (err) { | 657 | if (err) { |
658 | wlr_log(WLR_ERROR, "XCB connect failed: %d", err); | 658 | sway_log(SWAY_ERROR, "XCB connect failed: %d", err); |
659 | return; | 659 | return; |
660 | } | 660 | } |
661 | 661 | ||
@@ -674,7 +674,7 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) { | |||
674 | free(reply); | 674 | free(reply); |
675 | 675 | ||
676 | if (error != NULL) { | 676 | if (error != NULL) { |
677 | wlr_log(WLR_ERROR, "could not resolve atom %s, X11 error code %d", | 677 | sway_log(SWAY_ERROR, "could not resolve atom %s, X11 error code %d", |
678 | atom_map[i], error->error_code); | 678 | atom_map[i], error->error_code); |
679 | free(error); | 679 | free(error); |
680 | break; | 680 | break; |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 35683f06..bf9bf2da 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -713,7 +713,7 @@ static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) { | |||
713 | case WLR_AXIS_ORIENTATION_HORIZONTAL: | 713 | case WLR_AXIS_ORIENTATION_HORIZONTAL: |
714 | return event->delta < 0 ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT; | 714 | return event->delta < 0 ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT; |
715 | default: | 715 | default: |
716 | wlr_log(WLR_DEBUG, "Unknown axis orientation"); | 716 | sway_log(SWAY_DEBUG, "Unknown axis orientation"); |
717 | return 0; | 717 | return 0; |
718 | } | 718 | } |
719 | } | 719 | } |
@@ -1004,7 +1004,7 @@ static void handle_request_set_cursor(struct wl_listener *listener, | |||
1004 | // TODO: check cursor mode | 1004 | // TODO: check cursor mode |
1005 | if (focused_client == NULL || | 1005 | if (focused_client == NULL || |
1006 | event->seat_client->client != focused_client) { | 1006 | event->seat_client->client != focused_client) { |
1007 | wlr_log(WLR_DEBUG, "denying request to set cursor from unfocused client"); | 1007 | sway_log(SWAY_DEBUG, "denying request to set cursor from unfocused client"); |
1008 | return; | 1008 | return; |
1009 | } | 1009 | } |
1010 | 1010 | ||
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 9fff5f48..2b4a99d4 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -62,7 +62,7 @@ char *input_device_get_identifier(struct wlr_input_device *device) { | |||
62 | int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; | 62 | int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; |
63 | char *identifier = malloc(len); | 63 | char *identifier = malloc(len); |
64 | if (!identifier) { | 64 | if (!identifier) { |
65 | wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); | 65 | sway_log(SWAY_ERROR, "Unable to allocate unique input device name"); |
66 | return NULL; | 66 | return NULL; |
67 | } | 67 | } |
68 | 68 | ||
@@ -98,7 +98,7 @@ static bool input_has_seat_fallback_configuration(void) { | |||
98 | void input_manager_verify_fallback_seat(void) { | 98 | void input_manager_verify_fallback_seat(void) { |
99 | struct sway_seat *seat = NULL; | 99 | struct sway_seat *seat = NULL; |
100 | if (!input_has_seat_fallback_configuration()) { | 100 | if (!input_has_seat_fallback_configuration()) { |
101 | wlr_log(WLR_DEBUG, "no fallback seat config - creating default"); | 101 | sway_log(SWAY_DEBUG, "no fallback seat config - creating default"); |
102 | seat = input_manager_get_default_seat(); | 102 | seat = input_manager_get_default_seat(); |
103 | struct seat_config *sc = new_seat_config(seat->wlr_seat->name); | 103 | struct seat_config *sc = new_seat_config(seat->wlr_seat->name); |
104 | sc->fallback = true; | 104 | sc->fallback = true; |
@@ -124,11 +124,11 @@ static void input_manager_libinput_config_keyboard( | |||
124 | } | 124 | } |
125 | 125 | ||
126 | libinput_device = wlr_libinput_get_device_handle(wlr_device); | 126 | libinput_device = wlr_libinput_get_device_handle(wlr_device); |
127 | wlr_log(WLR_DEBUG, "input_manager_libinput_config_keyboard(%s)", | 127 | sway_log(SWAY_DEBUG, "input_manager_libinput_config_keyboard(%s)", |
128 | ic->identifier); | 128 | ic->identifier); |
129 | 129 | ||
130 | if (ic->send_events != INT_MIN) { | 130 | if (ic->send_events != INT_MIN) { |
131 | wlr_log(WLR_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)", | 131 | sway_log(SWAY_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)", |
132 | ic->identifier, ic->send_events); | 132 | ic->identifier, ic->send_events); |
133 | log_libinput_config_status(libinput_device_config_send_events_set_mode( | 133 | log_libinput_config_status(libinput_device_config_send_events_set_mode( |
134 | libinput_device, ic->send_events)); | 134 | libinput_device, ic->send_events)); |
@@ -148,7 +148,7 @@ static void input_manager_libinput_reset_keyboard( | |||
148 | 148 | ||
149 | uint32_t send_events = | 149 | uint32_t send_events = |
150 | libinput_device_config_send_events_get_default_mode(libinput_device); | 150 | libinput_device_config_send_events_get_default_mode(libinput_device); |
151 | wlr_log(WLR_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)", | 151 | sway_log(SWAY_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)", |
152 | input_device->identifier, send_events); | 152 | input_device->identifier, send_events); |
153 | log_libinput_config_status(libinput_device_config_send_events_set_mode( | 153 | log_libinput_config_status(libinput_device_config_send_events_set_mode( |
154 | libinput_device, send_events)); | 154 | libinput_device, send_events)); |
@@ -165,11 +165,11 @@ static void input_manager_libinput_config_touch( | |||
165 | } | 165 | } |
166 | 166 | ||
167 | libinput_device = wlr_libinput_get_device_handle(wlr_device); | 167 | libinput_device = wlr_libinput_get_device_handle(wlr_device); |
168 | wlr_log(WLR_DEBUG, "input_manager_libinput_config_touch(%s)", | 168 | sway_log(SWAY_DEBUG, "input_manager_libinput_config_touch(%s)", |
169 | ic->identifier); | 169 | ic->identifier); |
170 | 170 | ||
171 | if (ic->send_events != INT_MIN) { | 171 | if (ic->send_events != INT_MIN) { |
172 | wlr_log(WLR_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)", | 172 | sway_log(SWAY_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)", |
173 | ic->identifier, ic->send_events); | 173 | ic->identifier, ic->send_events); |
174 | log_libinput_config_status(libinput_device_config_send_events_set_mode( | 174 | log_libinput_config_status(libinput_device_config_send_events_set_mode( |
175 | libinput_device, ic->send_events)); | 175 | libinput_device, ic->send_events)); |
@@ -189,7 +189,7 @@ static void input_manager_libinput_reset_touch( | |||
189 | 189 | ||
190 | uint32_t send_events = | 190 | uint32_t send_events = |
191 | libinput_device_config_send_events_get_default_mode(libinput_device); | 191 | libinput_device_config_send_events_get_default_mode(libinput_device); |
192 | wlr_log(WLR_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)", | 192 | sway_log(SWAY_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)", |
193 | input_device->identifier, send_events); | 193 | input_device->identifier, send_events); |
194 | log_libinput_config_status(libinput_device_config_send_events_set_mode( | 194 | log_libinput_config_status(libinput_device_config_send_events_set_mode( |
195 | libinput_device, send_events)); | 195 | libinput_device, send_events)); |
@@ -206,30 +206,30 @@ static void input_manager_libinput_config_pointer( | |||
206 | } | 206 | } |
207 | 207 | ||
208 | libinput_device = wlr_libinput_get_device_handle(wlr_device); | 208 | libinput_device = wlr_libinput_get_device_handle(wlr_device); |
209 | wlr_log(WLR_DEBUG, "input_manager_libinput_config_pointer(%s)", | 209 | sway_log(SWAY_DEBUG, "input_manager_libinput_config_pointer(%s)", |
210 | ic->identifier); | 210 | ic->identifier); |
211 | 211 | ||
212 | if (ic->accel_profile != INT_MIN) { | 212 | if (ic->accel_profile != INT_MIN) { |
213 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", | 213 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", |
214 | ic->identifier, ic->accel_profile); | 214 | ic->identifier, ic->accel_profile); |
215 | log_libinput_config_status(libinput_device_config_accel_set_profile( | 215 | log_libinput_config_status(libinput_device_config_accel_set_profile( |
216 | libinput_device, ic->accel_profile)); | 216 | libinput_device, ic->accel_profile)); |
217 | } | 217 | } |
218 | if (ic->click_method != INT_MIN) { | 218 | if (ic->click_method != INT_MIN) { |
219 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", | 219 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", |
220 | ic->identifier, ic->click_method); | 220 | ic->identifier, ic->click_method); |
221 | log_libinput_config_status(libinput_device_config_click_set_method( | 221 | log_libinput_config_status(libinput_device_config_click_set_method( |
222 | libinput_device, ic->click_method)); | 222 | libinput_device, ic->click_method)); |
223 | } | 223 | } |
224 | if (ic->drag != INT_MIN) { | 224 | if (ic->drag != INT_MIN) { |
225 | wlr_log(WLR_DEBUG, | 225 | sway_log(SWAY_DEBUG, |
226 | "libinput_config_pointer(%s) tap_set_drag_enabled(%d)", | 226 | "libinput_config_pointer(%s) tap_set_drag_enabled(%d)", |
227 | ic->identifier, ic->drag); | 227 | ic->identifier, ic->drag); |
228 | log_libinput_config_status(libinput_device_config_tap_set_drag_enabled( | 228 | log_libinput_config_status(libinput_device_config_tap_set_drag_enabled( |
229 | libinput_device, ic->drag)); | 229 | libinput_device, ic->drag)); |
230 | } | 230 | } |
231 | if (ic->drag_lock != INT_MIN) { | 231 | if (ic->drag_lock != INT_MIN) { |
232 | wlr_log(WLR_DEBUG, | 232 | sway_log(SWAY_DEBUG, |
233 | "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", | 233 | "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", |
234 | ic->identifier, ic->drag_lock); | 234 | ic->identifier, ic->drag_lock); |
235 | log_libinput_config_status( | 235 | log_libinput_config_status( |
@@ -237,20 +237,20 @@ static void input_manager_libinput_config_pointer( | |||
237 | libinput_device, ic->drag_lock)); | 237 | libinput_device, ic->drag_lock)); |
238 | } | 238 | } |
239 | if (ic->dwt != INT_MIN) { | 239 | if (ic->dwt != INT_MIN) { |
240 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", | 240 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", |
241 | ic->identifier, ic->dwt); | 241 | ic->identifier, ic->dwt); |
242 | log_libinput_config_status(libinput_device_config_dwt_set_enabled( | 242 | log_libinput_config_status(libinput_device_config_dwt_set_enabled( |
243 | libinput_device, ic->dwt)); | 243 | libinput_device, ic->dwt)); |
244 | } | 244 | } |
245 | if (ic->left_handed != INT_MIN) { | 245 | if (ic->left_handed != INT_MIN) { |
246 | wlr_log(WLR_DEBUG, | 246 | sway_log(SWAY_DEBUG, |
247 | "libinput_config_pointer(%s) left_handed_set_enabled(%d)", | 247 | "libinput_config_pointer(%s) left_handed_set_enabled(%d)", |
248 | ic->identifier, ic->left_handed); | 248 | ic->identifier, ic->left_handed); |
249 | log_libinput_config_status(libinput_device_config_left_handed_set( | 249 | log_libinput_config_status(libinput_device_config_left_handed_set( |
250 | libinput_device, ic->left_handed)); | 250 | libinput_device, ic->left_handed)); |
251 | } | 251 | } |
252 | if (ic->middle_emulation != INT_MIN) { | 252 | if (ic->middle_emulation != INT_MIN) { |
253 | wlr_log(WLR_DEBUG, | 253 | sway_log(SWAY_DEBUG, |
254 | "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", | 254 | "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", |
255 | ic->identifier, ic->middle_emulation); | 255 | ic->identifier, ic->middle_emulation); |
256 | log_libinput_config_status( | 256 | log_libinput_config_status( |
@@ -258,7 +258,7 @@ static void input_manager_libinput_config_pointer( | |||
258 | libinput_device, ic->middle_emulation)); | 258 | libinput_device, ic->middle_emulation)); |
259 | } | 259 | } |
260 | if (ic->natural_scroll != INT_MIN) { | 260 | if (ic->natural_scroll != INT_MIN) { |
261 | wlr_log(WLR_DEBUG, | 261 | sway_log(SWAY_DEBUG, |
262 | "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", | 262 | "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", |
263 | ic->identifier, ic->natural_scroll); | 263 | ic->identifier, ic->natural_scroll); |
264 | log_libinput_config_status( | 264 | log_libinput_config_status( |
@@ -266,37 +266,37 @@ static void input_manager_libinput_config_pointer( | |||
266 | libinput_device, ic->natural_scroll)); | 266 | libinput_device, ic->natural_scroll)); |
267 | } | 267 | } |
268 | if (ic->pointer_accel != FLT_MIN) { | 268 | if (ic->pointer_accel != FLT_MIN) { |
269 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", | 269 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", |
270 | ic->identifier, ic->pointer_accel); | 270 | ic->identifier, ic->pointer_accel); |
271 | log_libinput_config_status(libinput_device_config_accel_set_speed( | 271 | log_libinput_config_status(libinput_device_config_accel_set_speed( |
272 | libinput_device, ic->pointer_accel)); | 272 | libinput_device, ic->pointer_accel)); |
273 | } | 273 | } |
274 | if (ic->scroll_button != INT_MIN) { | 274 | if (ic->scroll_button != INT_MIN) { |
275 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_button(%d)", | 275 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) scroll_set_button(%d)", |
276 | ic->identifier, ic->scroll_button); | 276 | ic->identifier, ic->scroll_button); |
277 | log_libinput_config_status(libinput_device_config_scroll_set_button( | 277 | log_libinput_config_status(libinput_device_config_scroll_set_button( |
278 | libinput_device, ic->scroll_button)); | 278 | libinput_device, ic->scroll_button)); |
279 | } | 279 | } |
280 | if (ic->scroll_method != INT_MIN) { | 280 | if (ic->scroll_method != INT_MIN) { |
281 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", | 281 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", |
282 | ic->identifier, ic->scroll_method); | 282 | ic->identifier, ic->scroll_method); |
283 | log_libinput_config_status(libinput_device_config_scroll_set_method( | 283 | log_libinput_config_status(libinput_device_config_scroll_set_method( |
284 | libinput_device, ic->scroll_method)); | 284 | libinput_device, ic->scroll_method)); |
285 | } | 285 | } |
286 | if (ic->send_events != INT_MIN) { | 286 | if (ic->send_events != INT_MIN) { |
287 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", | 287 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", |
288 | ic->identifier, ic->send_events); | 288 | ic->identifier, ic->send_events); |
289 | log_libinput_config_status(libinput_device_config_send_events_set_mode( | 289 | log_libinput_config_status(libinput_device_config_send_events_set_mode( |
290 | libinput_device, ic->send_events)); | 290 | libinput_device, ic->send_events)); |
291 | } | 291 | } |
292 | if (ic->tap != INT_MIN) { | 292 | if (ic->tap != INT_MIN) { |
293 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", | 293 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", |
294 | ic->identifier, ic->tap); | 294 | ic->identifier, ic->tap); |
295 | log_libinput_config_status(libinput_device_config_tap_set_enabled( | 295 | log_libinput_config_status(libinput_device_config_tap_set_enabled( |
296 | libinput_device, ic->tap)); | 296 | libinput_device, ic->tap)); |
297 | } | 297 | } |
298 | if (ic->tap_button_map != INT_MIN) { | 298 | if (ic->tap_button_map != INT_MIN) { |
299 | wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)", | 299 | sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)", |
300 | ic->identifier, ic->tap_button_map); | 300 | ic->identifier, ic->tap_button_map); |
301 | log_libinput_config_status(libinput_device_config_tap_set_button_map( | 301 | log_libinput_config_status(libinput_device_config_tap_set_button_map( |
302 | libinput_device, ic->tap_button_map)); | 302 | libinput_device, ic->tap_button_map)); |
@@ -316,21 +316,21 @@ static void input_manager_libinput_reset_pointer( | |||
316 | 316 | ||
317 | enum libinput_config_accel_profile accel_profile = | 317 | enum libinput_config_accel_profile accel_profile = |
318 | libinput_device_config_accel_get_default_profile(libinput_device); | 318 | libinput_device_config_accel_get_default_profile(libinput_device); |
319 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)", | 319 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)", |
320 | input_device->identifier, accel_profile); | 320 | input_device->identifier, accel_profile); |
321 | log_libinput_config_status(libinput_device_config_accel_set_profile( | 321 | log_libinput_config_status(libinput_device_config_accel_set_profile( |
322 | libinput_device, accel_profile)); | 322 | libinput_device, accel_profile)); |
323 | 323 | ||
324 | enum libinput_config_click_method click_method = | 324 | enum libinput_config_click_method click_method = |
325 | libinput_device_config_click_get_default_method(libinput_device); | 325 | libinput_device_config_click_get_default_method(libinput_device); |
326 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)", | 326 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)", |
327 | input_device->identifier, click_method); | 327 | input_device->identifier, click_method); |
328 | log_libinput_config_status(libinput_device_config_click_set_method( | 328 | log_libinput_config_status(libinput_device_config_click_set_method( |
329 | libinput_device, click_method)); | 329 | libinput_device, click_method)); |
330 | 330 | ||
331 | enum libinput_config_drag_state drag = | 331 | enum libinput_config_drag_state drag = |
332 | libinput_device_config_tap_get_default_drag_enabled(libinput_device); | 332 | libinput_device_config_tap_get_default_drag_enabled(libinput_device); |
333 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)", | 333 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)", |
334 | input_device->identifier, drag); | 334 | input_device->identifier, drag); |
335 | log_libinput_config_status(libinput_device_config_tap_set_drag_enabled( | 335 | log_libinput_config_status(libinput_device_config_tap_set_drag_enabled( |
336 | libinput_device, drag)); | 336 | libinput_device, drag)); |
@@ -338,7 +338,7 @@ static void input_manager_libinput_reset_pointer( | |||
338 | enum libinput_config_drag_lock_state drag_lock = | 338 | enum libinput_config_drag_lock_state drag_lock = |
339 | libinput_device_config_tap_get_default_drag_lock_enabled( | 339 | libinput_device_config_tap_get_default_drag_lock_enabled( |
340 | libinput_device); | 340 | libinput_device); |
341 | wlr_log(WLR_DEBUG, | 341 | sway_log(SWAY_DEBUG, |
342 | "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)", | 342 | "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)", |
343 | input_device->identifier, drag_lock); | 343 | input_device->identifier, drag_lock); |
344 | log_libinput_config_status( | 344 | log_libinput_config_status( |
@@ -347,14 +347,14 @@ static void input_manager_libinput_reset_pointer( | |||
347 | 347 | ||
348 | enum libinput_config_dwt_state dwt = | 348 | enum libinput_config_dwt_state dwt = |
349 | libinput_device_config_dwt_get_default_enabled(libinput_device); | 349 | libinput_device_config_dwt_get_default_enabled(libinput_device); |
350 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)", | 350 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)", |
351 | input_device->identifier, dwt); | 351 | input_device->identifier, dwt); |
352 | log_libinput_config_status(libinput_device_config_dwt_set_enabled( | 352 | log_libinput_config_status(libinput_device_config_dwt_set_enabled( |
353 | libinput_device, dwt)); | 353 | libinput_device, dwt)); |
354 | 354 | ||
355 | int left_handed = | 355 | int left_handed = |
356 | libinput_device_config_left_handed_get_default(libinput_device); | 356 | libinput_device_config_left_handed_get_default(libinput_device); |
357 | wlr_log(WLR_DEBUG, | 357 | sway_log(SWAY_DEBUG, |
358 | "libinput_reset_pointer(%s) left_handed_set_enabled(%d)", | 358 | "libinput_reset_pointer(%s) left_handed_set_enabled(%d)", |
359 | input_device->identifier, left_handed); | 359 | input_device->identifier, left_handed); |
360 | log_libinput_config_status(libinput_device_config_left_handed_set( | 360 | log_libinput_config_status(libinput_device_config_left_handed_set( |
@@ -363,7 +363,7 @@ static void input_manager_libinput_reset_pointer( | |||
363 | enum libinput_config_middle_emulation_state middle_emulation = | 363 | enum libinput_config_middle_emulation_state middle_emulation = |
364 | libinput_device_config_middle_emulation_get_default_enabled( | 364 | libinput_device_config_middle_emulation_get_default_enabled( |
365 | libinput_device); | 365 | libinput_device); |
366 | wlr_log(WLR_DEBUG, | 366 | sway_log(SWAY_DEBUG, |
367 | "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)", | 367 | "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)", |
368 | input_device->identifier, middle_emulation); | 368 | input_device->identifier, middle_emulation); |
369 | log_libinput_config_status( | 369 | log_libinput_config_status( |
@@ -373,7 +373,7 @@ static void input_manager_libinput_reset_pointer( | |||
373 | int natural_scroll = | 373 | int natural_scroll = |
374 | libinput_device_config_scroll_get_default_natural_scroll_enabled( | 374 | libinput_device_config_scroll_get_default_natural_scroll_enabled( |
375 | libinput_device); | 375 | libinput_device); |
376 | wlr_log(WLR_DEBUG, | 376 | sway_log(SWAY_DEBUG, |
377 | "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)", | 377 | "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)", |
378 | input_device->identifier, natural_scroll); | 378 | input_device->identifier, natural_scroll); |
379 | log_libinput_config_status( | 379 | log_libinput_config_status( |
@@ -382,42 +382,42 @@ static void input_manager_libinput_reset_pointer( | |||
382 | 382 | ||
383 | double pointer_accel = | 383 | double pointer_accel = |
384 | libinput_device_config_accel_get_default_speed(libinput_device); | 384 | libinput_device_config_accel_get_default_speed(libinput_device); |
385 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)", | 385 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)", |
386 | input_device->identifier, pointer_accel); | 386 | input_device->identifier, pointer_accel); |
387 | log_libinput_config_status(libinput_device_config_accel_set_speed( | 387 | log_libinput_config_status(libinput_device_config_accel_set_speed( |
388 | libinput_device, pointer_accel)); | 388 | libinput_device, pointer_accel)); |
389 | 389 | ||
390 | uint32_t scroll_button = | 390 | uint32_t scroll_button = |
391 | libinput_device_config_scroll_get_default_button(libinput_device); | 391 | libinput_device_config_scroll_get_default_button(libinput_device); |
392 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)", | 392 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)", |
393 | input_device->identifier, scroll_button); | 393 | input_device->identifier, scroll_button); |
394 | log_libinput_config_status(libinput_device_config_scroll_set_button( | 394 | log_libinput_config_status(libinput_device_config_scroll_set_button( |
395 | libinput_device, scroll_button)); | 395 | libinput_device, scroll_button)); |
396 | 396 | ||
397 | enum libinput_config_scroll_method scroll_method = | 397 | enum libinput_config_scroll_method scroll_method = |
398 | libinput_device_config_scroll_get_default_method(libinput_device); | 398 | libinput_device_config_scroll_get_default_method(libinput_device); |
399 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)", | 399 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)", |
400 | input_device->identifier, scroll_method); | 400 | input_device->identifier, scroll_method); |
401 | log_libinput_config_status(libinput_device_config_scroll_set_method( | 401 | log_libinput_config_status(libinput_device_config_scroll_set_method( |
402 | libinput_device, scroll_method)); | 402 | libinput_device, scroll_method)); |
403 | 403 | ||
404 | uint32_t send_events = | 404 | uint32_t send_events = |
405 | libinput_device_config_send_events_get_default_mode(libinput_device); | 405 | libinput_device_config_send_events_get_default_mode(libinput_device); |
406 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)", | 406 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)", |
407 | input_device->identifier, send_events); | 407 | input_device->identifier, send_events); |
408 | log_libinput_config_status(libinput_device_config_send_events_set_mode( | 408 | log_libinput_config_status(libinput_device_config_send_events_set_mode( |
409 | libinput_device, send_events)); | 409 | libinput_device, send_events)); |
410 | 410 | ||
411 | enum libinput_config_tap_state tap = | 411 | enum libinput_config_tap_state tap = |
412 | libinput_device_config_tap_get_default_enabled(libinput_device); | 412 | libinput_device_config_tap_get_default_enabled(libinput_device); |
413 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)", | 413 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)", |
414 | input_device->identifier, tap); | 414 | input_device->identifier, tap); |
415 | log_libinput_config_status(libinput_device_config_tap_set_enabled( | 415 | log_libinput_config_status(libinput_device_config_tap_set_enabled( |
416 | libinput_device, tap)); | 416 | libinput_device, tap)); |
417 | 417 | ||
418 | enum libinput_config_tap_button_map tap_button_map = | 418 | enum libinput_config_tap_button_map tap_button_map = |
419 | libinput_device_config_tap_get_button_map(libinput_device); | 419 | libinput_device_config_tap_get_button_map(libinput_device); |
420 | wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)", | 420 | sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)", |
421 | input_device->identifier, tap_button_map); | 421 | input_device->identifier, tap_button_map); |
422 | log_libinput_config_status(libinput_device_config_tap_set_button_map( | 422 | log_libinput_config_status(libinput_device_config_tap_set_button_map( |
423 | libinput_device, tap_button_map)); | 423 | libinput_device, tap_button_map)); |
@@ -432,7 +432,7 @@ static void handle_device_destroy(struct wl_listener *listener, void *data) { | |||
432 | return; | 432 | return; |
433 | } | 433 | } |
434 | 434 | ||
435 | wlr_log(WLR_DEBUG, "removing device: '%s'", | 435 | sway_log(SWAY_DEBUG, "removing device: '%s'", |
436 | input_device->identifier); | 436 | input_device->identifier); |
437 | 437 | ||
438 | struct sway_seat *seat = NULL; | 438 | struct sway_seat *seat = NULL; |
@@ -462,7 +462,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
462 | input_device->identifier = input_device_get_identifier(device); | 462 | input_device->identifier = input_device_get_identifier(device); |
463 | wl_list_insert(&input->devices, &input_device->link); | 463 | wl_list_insert(&input->devices, &input_device->link); |
464 | 464 | ||
465 | wlr_log(WLR_DEBUG, "adding device: '%s'", | 465 | sway_log(SWAY_DEBUG, "adding device: '%s'", |
466 | input_device->identifier); | 466 | input_device->identifier); |
467 | 467 | ||
468 | if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER || | 468 | if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER || |
@@ -504,7 +504,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
504 | } | 504 | } |
505 | 505 | ||
506 | if (!added) { | 506 | if (!added) { |
507 | wlr_log(WLR_DEBUG, | 507 | sway_log(SWAY_DEBUG, |
508 | "device '%s' is not configured on any seats", | 508 | "device '%s' is not configured on any seats", |
509 | input_device->identifier); | 509 | input_device->identifier); |
510 | } | 510 | } |
@@ -554,7 +554,7 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) { | |||
554 | input_device->identifier = input_device_get_identifier(device); | 554 | input_device->identifier = input_device_get_identifier(device); |
555 | wl_list_insert(&input_manager->devices, &input_device->link); | 555 | wl_list_insert(&input_manager->devices, &input_device->link); |
556 | 556 | ||
557 | wlr_log(WLR_DEBUG, "adding virtual keyboard: '%s'", | 557 | sway_log(SWAY_DEBUG, "adding virtual keyboard: '%s'", |
558 | input_device->identifier); | 558 | input_device->identifier); |
559 | 559 | ||
560 | wl_signal_add(&device->events.destroy, &input_device->device_destroy); | 560 | wl_signal_add(&device->events.destroy, &input_device->device_destroy); |
@@ -660,7 +660,7 @@ void input_manager_reset_all_inputs() { | |||
660 | 660 | ||
661 | 661 | ||
662 | void input_manager_apply_seat_config(struct seat_config *seat_config) { | 662 | void input_manager_apply_seat_config(struct seat_config *seat_config) { |
663 | wlr_log(WLR_DEBUG, "applying seat config for seat %s", seat_config->name); | 663 | sway_log(SWAY_DEBUG, "applying seat config for seat %s", seat_config->name); |
664 | if (strcmp(seat_config->name, "*") == 0) { | 664 | if (strcmp(seat_config->name, "*") == 0) { |
665 | struct sway_seat *seat = NULL; | 665 | struct sway_seat *seat = NULL; |
666 | wl_list_for_each(seat, &server.input->seats, link) { | 666 | wl_list_for_each(seat, &server.input->seats, link) { |
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 2ea796a9..c1fc60f7 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -126,7 +126,7 @@ static void get_active_binding(const struct sway_shortcut_state *state, | |||
126 | 126 | ||
127 | if (*current_binding && *current_binding != binding && | 127 | if (*current_binding && *current_binding != binding && |
128 | strcmp((*current_binding)->input, binding->input) == 0) { | 128 | strcmp((*current_binding)->input, binding->input) == 0) { |
129 | wlr_log(WLR_DEBUG, "encountered duplicate bindings %d and %d", | 129 | sway_log(SWAY_DEBUG, "encountered duplicate bindings %d and %d", |
130 | (*current_binding)->order, binding->order); | 130 | (*current_binding)->order, binding->order); |
131 | } else if (!*current_binding || | 131 | } else if (!*current_binding || |
132 | strcmp((*current_binding)->input, "*") == 0) { | 132 | strcmp((*current_binding)->input, "*") == 0) { |
@@ -219,7 +219,7 @@ void sway_keyboard_disarm_key_repeat(struct sway_keyboard *keyboard) { | |||
219 | } | 219 | } |
220 | keyboard->repeat_binding = NULL; | 220 | keyboard->repeat_binding = NULL; |
221 | if (wl_event_source_timer_update(keyboard->key_repeat_source, 0) < 0) { | 221 | if (wl_event_source_timer_update(keyboard->key_repeat_source, 0) < 0) { |
222 | wlr_log(WLR_DEBUG, "failed to disarm key repeat timer"); | 222 | sway_log(SWAY_DEBUG, "failed to disarm key repeat timer"); |
223 | } | 223 | } |
224 | } | 224 | } |
225 | 225 | ||
@@ -313,7 +313,7 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) { | |||
313 | keyboard->repeat_binding = binding; | 313 | keyboard->repeat_binding = binding; |
314 | if (wl_event_source_timer_update(keyboard->key_repeat_source, | 314 | if (wl_event_source_timer_update(keyboard->key_repeat_source, |
315 | wlr_device->keyboard->repeat_info.delay) < 0) { | 315 | wlr_device->keyboard->repeat_info.delay) < 0) { |
316 | wlr_log(WLR_DEBUG, "failed to set key repeat timer"); | 316 | sway_log(SWAY_DEBUG, "failed to set key repeat timer"); |
317 | } | 317 | } |
318 | } else if (keyboard->repeat_binding) { | 318 | } else if (keyboard->repeat_binding) { |
319 | sway_keyboard_disarm_key_repeat(keyboard); | 319 | sway_keyboard_disarm_key_repeat(keyboard); |
@@ -356,7 +356,7 @@ static int handle_keyboard_repeat(void *data) { | |||
356 | // We queue the next event first, as the command might cancel it | 356 | // We queue the next event first, as the command might cancel it |
357 | if (wl_event_source_timer_update(keyboard->key_repeat_source, | 357 | if (wl_event_source_timer_update(keyboard->key_repeat_source, |
358 | 1000 / wlr_device->repeat_info.rate) < 0) { | 358 | 1000 / wlr_device->repeat_info.rate) < 0) { |
359 | wlr_log(WLR_DEBUG, "failed to update key repeat timer"); | 359 | sway_log(SWAY_DEBUG, "failed to update key repeat timer"); |
360 | } | 360 | } |
361 | } | 361 | } |
362 | 362 | ||
@@ -460,7 +460,7 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
460 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); | 460 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); |
461 | 461 | ||
462 | if (!keymap) { | 462 | if (!keymap) { |
463 | wlr_log(WLR_DEBUG, "cannot configure keyboard: keymap does not exist"); | 463 | sway_log(SWAY_DEBUG, "cannot configure keyboard: keymap does not exist"); |
464 | xkb_context_unref(context); | 464 | xkb_context_unref(context); |
465 | return; | 465 | return; |
466 | } | 466 | } |
diff --git a/sway/input/seat.c b/sway/input/seat.c index a66a8198..82e0e754 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -62,7 +62,7 @@ static void seat_node_destroy(struct sway_seat_node *seat_node) { | |||
62 | static void seat_send_activate(struct sway_node *node, struct sway_seat *seat) { | 62 | static void seat_send_activate(struct sway_node *node, struct sway_seat *seat) { |
63 | if (node_is_view(node)) { | 63 | if (node_is_view(node)) { |
64 | if (!seat_is_input_allowed(seat, node->sway_container->view->surface)) { | 64 | if (!seat_is_input_allowed(seat, node->sway_container->view->surface)) { |
65 | wlr_log(WLR_DEBUG, "Refusing to set focus, input is inhibited"); | 65 | sway_log(SWAY_DEBUG, "Refusing to set focus, input is inhibited"); |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | view_set_activated(node->sway_container->view, true); | 68 | view_set_activated(node->sway_container->view, true); |
@@ -208,7 +208,7 @@ static struct sway_seat_node *seat_node_from_node( | |||
208 | 208 | ||
209 | seat_node = calloc(1, sizeof(struct sway_seat_node)); | 209 | seat_node = calloc(1, sizeof(struct sway_seat_node)); |
210 | if (seat_node == NULL) { | 210 | if (seat_node == NULL) { |
211 | wlr_log(WLR_ERROR, "could not allocate seat node"); | 211 | sway_log(SWAY_ERROR, "could not allocate seat node"); |
212 | return NULL; | 212 | return NULL; |
213 | } | 213 | } |
214 | 214 | ||
@@ -289,7 +289,7 @@ static void handle_new_drag_icon(struct wl_listener *listener, void *data) { | |||
289 | 289 | ||
290 | struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon)); | 290 | struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon)); |
291 | if (icon == NULL) { | 291 | if (icon == NULL) { |
292 | wlr_log(WLR_ERROR, "Allocation failed"); | 292 | sway_log(SWAY_ERROR, "Allocation failed"); |
293 | return; | 293 | return; |
294 | } | 294 | } |
295 | icon->seat = seat; | 295 | icon->seat = seat; |
@@ -407,7 +407,7 @@ static void seat_update_capabilities(struct sway_seat *seat) { | |||
407 | 407 | ||
408 | static void seat_reset_input_config(struct sway_seat *seat, | 408 | static void seat_reset_input_config(struct sway_seat *seat, |
409 | struct sway_seat_device *sway_device) { | 409 | struct sway_seat_device *sway_device) { |
410 | wlr_log(WLR_DEBUG, "Resetting output mapping for input device %s", | 410 | sway_log(SWAY_DEBUG, "Resetting output mapping for input device %s", |
411 | sway_device->input_device->identifier); | 411 | sway_device->input_device->identifier); |
412 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 412 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |
413 | sway_device->input_device->wlr_device, NULL); | 413 | sway_device->input_device->wlr_device, NULL); |
@@ -420,7 +420,7 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
420 | struct input_config *ic = input_device_get_config( | 420 | struct input_config *ic = input_device_get_config( |
421 | sway_device->input_device); | 421 | sway_device->input_device); |
422 | if (ic != NULL) { | 422 | if (ic != NULL) { |
423 | wlr_log(WLR_DEBUG, "Applying input config to %s", | 423 | sway_log(SWAY_DEBUG, "Applying input config to %s", |
424 | sway_device->input_device->identifier); | 424 | sway_device->input_device->identifier); |
425 | 425 | ||
426 | mapped_to_output = ic->mapped_to_output; | 426 | mapped_to_output = ic->mapped_to_output; |
@@ -430,19 +430,19 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
430 | mapped_to_output = sway_device->input_device->wlr_device->output_name; | 430 | mapped_to_output = sway_device->input_device->wlr_device->output_name; |
431 | } | 431 | } |
432 | if (mapped_to_output != NULL) { | 432 | if (mapped_to_output != NULL) { |
433 | wlr_log(WLR_DEBUG, "Mapping input device %s to output %s", | 433 | sway_log(SWAY_DEBUG, "Mapping input device %s to output %s", |
434 | sway_device->input_device->identifier, mapped_to_output); | 434 | sway_device->input_device->identifier, mapped_to_output); |
435 | if (strcmp("*", mapped_to_output) == 0) { | 435 | if (strcmp("*", mapped_to_output) == 0) { |
436 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 436 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |
437 | sway_device->input_device->wlr_device, NULL); | 437 | sway_device->input_device->wlr_device, NULL); |
438 | wlr_log(WLR_DEBUG, "Reset output mapping"); | 438 | sway_log(SWAY_DEBUG, "Reset output mapping"); |
439 | return; | 439 | return; |
440 | } | 440 | } |
441 | struct sway_output *output = output_by_name_or_id(mapped_to_output); | 441 | struct sway_output *output = output_by_name_or_id(mapped_to_output); |
442 | if (output) { | 442 | if (output) { |
443 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 443 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |
444 | sway_device->input_device->wlr_device, output->wlr_output); | 444 | sway_device->input_device->wlr_device, output->wlr_output); |
445 | wlr_log(WLR_DEBUG, "Mapped to output %s", output->wlr_output->name); | 445 | sway_log(SWAY_DEBUG, "Mapped to output %s", output->wlr_output->name); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | } | 448 | } |
@@ -522,10 +522,10 @@ void seat_configure_device(struct sway_seat *seat, | |||
522 | seat_configure_tablet_tool(seat, seat_device); | 522 | seat_configure_tablet_tool(seat, seat_device); |
523 | break; | 523 | break; |
524 | case WLR_INPUT_DEVICE_TABLET_PAD: | 524 | case WLR_INPUT_DEVICE_TABLET_PAD: |
525 | wlr_log(WLR_DEBUG, "TODO: configure tablet pad"); | 525 | sway_log(SWAY_DEBUG, "TODO: configure tablet pad"); |
526 | break; | 526 | break; |
527 | case WLR_INPUT_DEVICE_SWITCH: | 527 | case WLR_INPUT_DEVICE_SWITCH: |
528 | wlr_log(WLR_DEBUG, "TODO: configure switch device"); | 528 | sway_log(SWAY_DEBUG, "TODO: configure switch device"); |
529 | break; | 529 | break; |
530 | } | 530 | } |
531 | } | 531 | } |
@@ -552,10 +552,10 @@ void seat_reset_device(struct sway_seat *seat, | |||
552 | seat_reset_input_config(seat, seat_device); | 552 | seat_reset_input_config(seat, seat_device); |
553 | break; | 553 | break; |
554 | case WLR_INPUT_DEVICE_TABLET_PAD: | 554 | case WLR_INPUT_DEVICE_TABLET_PAD: |
555 | wlr_log(WLR_DEBUG, "TODO: reset tablet pad"); | 555 | sway_log(SWAY_DEBUG, "TODO: reset tablet pad"); |
556 | break; | 556 | break; |
557 | case WLR_INPUT_DEVICE_SWITCH: | 557 | case WLR_INPUT_DEVICE_SWITCH: |
558 | wlr_log(WLR_DEBUG, "TODO: reset switch device"); | 558 | sway_log(SWAY_DEBUG, "TODO: reset switch device"); |
559 | break; | 559 | break; |
560 | } | 560 | } |
561 | } | 561 | } |
@@ -570,11 +570,11 @@ void seat_add_device(struct sway_seat *seat, | |||
570 | struct sway_seat_device *seat_device = | 570 | struct sway_seat_device *seat_device = |
571 | calloc(1, sizeof(struct sway_seat_device)); | 571 | calloc(1, sizeof(struct sway_seat_device)); |
572 | if (!seat_device) { | 572 | if (!seat_device) { |
573 | wlr_log(WLR_DEBUG, "could not allocate seat device"); | 573 | sway_log(SWAY_DEBUG, "could not allocate seat device"); |
574 | return; | 574 | return; |
575 | } | 575 | } |
576 | 576 | ||
577 | wlr_log(WLR_DEBUG, "adding device %s to seat %s", | 577 | sway_log(SWAY_DEBUG, "adding device %s to seat %s", |
578 | input_device->identifier, seat->wlr_seat->name); | 578 | input_device->identifier, seat->wlr_seat->name); |
579 | 579 | ||
580 | seat_device->sway_seat = seat; | 580 | seat_device->sway_seat = seat; |
@@ -594,7 +594,7 @@ void seat_remove_device(struct sway_seat *seat, | |||
594 | return; | 594 | return; |
595 | } | 595 | } |
596 | 596 | ||
597 | wlr_log(WLR_DEBUG, "removing device %s from seat %s", | 597 | sway_log(SWAY_DEBUG, "removing device %s from seat %s", |
598 | input_device->identifier, seat->wlr_seat->name); | 598 | input_device->identifier, seat->wlr_seat->name); |
599 | 599 | ||
600 | seat_device_destroy(seat_device); | 600 | seat_device_destroy(seat_device); |
@@ -790,7 +790,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { | |||
790 | wl_event_source_timer_update(view->urgent_timer, | 790 | wl_event_source_timer_update(view->urgent_timer, |
791 | config->urgent_timeout); | 791 | config->urgent_timeout); |
792 | } else { | 792 | } else { |
793 | wlr_log(WLR_ERROR, "Unable to create urgency timer (%s)", | 793 | sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)", |
794 | strerror(errno)); | 794 | strerror(errno)); |
795 | handle_urgent_timeout(view); | 795 | handle_urgent_timeout(view); |
796 | } | 796 | } |
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 9a033a4b..82e144b7 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -147,32 +147,32 @@ struct sockaddr_un *ipc_user_sockaddr(void) { | |||
147 | int ipc_handle_connection(int fd, uint32_t mask, void *data) { | 147 | int ipc_handle_connection(int fd, uint32_t mask, void *data) { |
148 | (void) fd; | 148 | (void) fd; |
149 | struct sway_server *server = data; | 149 | struct sway_server *server = data; |
150 | wlr_log(WLR_DEBUG, "Event on IPC listening socket"); | 150 | sway_log(SWAY_DEBUG, "Event on IPC listening socket"); |
151 | assert(mask == WL_EVENT_READABLE); | 151 | assert(mask == WL_EVENT_READABLE); |
152 | 152 | ||
153 | int client_fd = accept(ipc_socket, NULL, NULL); | 153 | int client_fd = accept(ipc_socket, NULL, NULL); |
154 | if (client_fd == -1) { | 154 | if (client_fd == -1) { |
155 | wlr_log_errno(WLR_ERROR, "Unable to accept IPC client connection"); | 155 | sway_log_errno(SWAY_ERROR, "Unable to accept IPC client connection"); |
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | int flags; | 159 | int flags; |
160 | if ((flags = fcntl(client_fd, F_GETFD)) == -1 | 160 | if ((flags = fcntl(client_fd, F_GETFD)) == -1 |
161 | || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { | 161 | || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { |
162 | wlr_log_errno(WLR_ERROR, "Unable to set CLOEXEC on IPC client socket"); | 162 | sway_log_errno(SWAY_ERROR, "Unable to set CLOEXEC on IPC client socket"); |
163 | close(client_fd); | 163 | close(client_fd); |
164 | return 0; | 164 | return 0; |
165 | } | 165 | } |
166 | if ((flags = fcntl(client_fd, F_GETFL)) == -1 | 166 | if ((flags = fcntl(client_fd, F_GETFL)) == -1 |
167 | || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { | 167 | || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { |
168 | wlr_log_errno(WLR_ERROR, "Unable to set NONBLOCK on IPC client socket"); | 168 | sway_log_errno(SWAY_ERROR, "Unable to set NONBLOCK on IPC client socket"); |
169 | close(client_fd); | 169 | close(client_fd); |
170 | return 0; | 170 | return 0; |
171 | } | 171 | } |
172 | 172 | ||
173 | struct ipc_client *client = malloc(sizeof(struct ipc_client)); | 173 | struct ipc_client *client = malloc(sizeof(struct ipc_client)); |
174 | if (!client) { | 174 | if (!client) { |
175 | wlr_log(WLR_ERROR, "Unable to allocate ipc client"); | 175 | sway_log(SWAY_ERROR, "Unable to allocate ipc client"); |
176 | close(client_fd); | 176 | close(client_fd); |
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
@@ -188,12 +188,12 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { | |||
188 | client->write_buffer_len = 0; | 188 | client->write_buffer_len = 0; |
189 | client->write_buffer = malloc(client->write_buffer_size); | 189 | client->write_buffer = malloc(client->write_buffer_size); |
190 | if (!client->write_buffer) { | 190 | if (!client->write_buffer) { |
191 | wlr_log(WLR_ERROR, "Unable to allocate ipc client write buffer"); | 191 | sway_log(SWAY_ERROR, "Unable to allocate ipc client write buffer"); |
192 | close(client_fd); | 192 | close(client_fd); |
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | 195 | ||
196 | wlr_log(WLR_DEBUG, "New client: fd %d", client_fd); | 196 | sway_log(SWAY_DEBUG, "New client: fd %d", client_fd); |
197 | list_add(ipc_client_list, client); | 197 | list_add(ipc_client_list, client); |
198 | return 0; | 198 | return 0; |
199 | } | 199 | } |
@@ -202,22 +202,22 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { | |||
202 | struct ipc_client *client = data; | 202 | struct ipc_client *client = data; |
203 | 203 | ||
204 | if (mask & WL_EVENT_ERROR) { | 204 | if (mask & WL_EVENT_ERROR) { |
205 | wlr_log(WLR_ERROR, "IPC Client socket error, removing client"); | 205 | sway_log(SWAY_ERROR, "IPC Client socket error, removing client"); |
206 | ipc_client_disconnect(client); | 206 | ipc_client_disconnect(client); |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | 209 | ||
210 | if (mask & WL_EVENT_HANGUP) { | 210 | if (mask & WL_EVENT_HANGUP) { |
211 | wlr_log(WLR_DEBUG, "Client %d hung up", client->fd); | 211 | sway_log(SWAY_DEBUG, "Client %d hung up", client->fd); |
212 | ipc_client_disconnect(client); | 212 | ipc_client_disconnect(client); |
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | 215 | ||
216 | wlr_log(WLR_DEBUG, "Client %d readable", client->fd); | 216 | sway_log(SWAY_DEBUG, "Client %d readable", client->fd); |
217 | 217 | ||
218 | int read_available; | 218 | int read_available; |
219 | if (ioctl(client_fd, FIONREAD, &read_available) == -1) { | 219 | if (ioctl(client_fd, FIONREAD, &read_available) == -1) { |
220 | wlr_log_errno(WLR_INFO, "Unable to read IPC socket buffer size"); | 220 | sway_log_errno(SWAY_INFO, "Unable to read IPC socket buffer size"); |
221 | ipc_client_disconnect(client); | 221 | ipc_client_disconnect(client); |
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
@@ -239,13 +239,13 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { | |||
239 | // Should be fully available, because read_available >= IPC_HEADER_SIZE | 239 | // Should be fully available, because read_available >= IPC_HEADER_SIZE |
240 | ssize_t received = recv(client_fd, buf, IPC_HEADER_SIZE, 0); | 240 | ssize_t received = recv(client_fd, buf, IPC_HEADER_SIZE, 0); |
241 | if (received == -1) { | 241 | if (received == -1) { |
242 | wlr_log_errno(WLR_INFO, "Unable to receive header from IPC client"); | 242 | sway_log_errno(SWAY_INFO, "Unable to receive header from IPC client"); |
243 | ipc_client_disconnect(client); | 243 | ipc_client_disconnect(client); |
244 | return 0; | 244 | return 0; |
245 | } | 245 | } |
246 | 246 | ||
247 | if (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) { | 247 | if (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) { |
248 | wlr_log(WLR_DEBUG, "IPC header check failed"); | 248 | sway_log(SWAY_DEBUG, "IPC header check failed"); |
249 | ipc_client_disconnect(client); | 249 | ipc_client_disconnect(client); |
250 | return 0; | 250 | return 0; |
251 | } | 251 | } |
@@ -279,7 +279,7 @@ static void ipc_send_event(const char *json_string, enum ipc_command_type event) | |||
279 | } | 279 | } |
280 | client->current_command = event; | 280 | client->current_command = event; |
281 | if (!ipc_send_reply(client, json_string, (uint32_t) strlen(json_string))) { | 281 | if (!ipc_send_reply(client, json_string, (uint32_t) strlen(json_string))) { |
282 | wlr_log_errno(WLR_INFO, "Unable to send reply to IPC client"); | 282 | sway_log_errno(SWAY_INFO, "Unable to send reply to IPC client"); |
283 | /* ipc_send_reply destroys client on error, which also | 283 | /* ipc_send_reply destroys client on error, which also |
284 | * removes it from the list, so we need to process | 284 | * removes it from the list, so we need to process |
285 | * current index again */ | 285 | * current index again */ |
@@ -293,7 +293,7 @@ void ipc_event_workspace(struct sway_workspace *old, | |||
293 | if (!ipc_has_event_listeners(IPC_EVENT_WORKSPACE)) { | 293 | if (!ipc_has_event_listeners(IPC_EVENT_WORKSPACE)) { |
294 | return; | 294 | return; |
295 | } | 295 | } |
296 | wlr_log(WLR_DEBUG, "Sending workspace::%s event", change); | 296 | sway_log(SWAY_DEBUG, "Sending workspace::%s event", change); |
297 | json_object *obj = json_object_new_object(); | 297 | json_object *obj = json_object_new_object(); |
298 | json_object_object_add(obj, "change", json_object_new_string(change)); | 298 | json_object_object_add(obj, "change", json_object_new_string(change)); |
299 | if (old) { | 299 | if (old) { |
@@ -319,7 +319,7 @@ void ipc_event_window(struct sway_container *window, const char *change) { | |||
319 | if (!ipc_has_event_listeners(IPC_EVENT_WINDOW)) { | 319 | if (!ipc_has_event_listeners(IPC_EVENT_WINDOW)) { |
320 | return; | 320 | return; |
321 | } | 321 | } |
322 | wlr_log(WLR_DEBUG, "Sending window::%s event", change); | 322 | sway_log(SWAY_DEBUG, "Sending window::%s event", change); |
323 | json_object *obj = json_object_new_object(); | 323 | json_object *obj = json_object_new_object(); |
324 | json_object_object_add(obj, "change", json_object_new_string(change)); | 324 | json_object_object_add(obj, "change", json_object_new_string(change)); |
325 | json_object_object_add(obj, "container", | 325 | json_object_object_add(obj, "container", |
@@ -334,7 +334,7 @@ void ipc_event_barconfig_update(struct bar_config *bar) { | |||
334 | if (!ipc_has_event_listeners(IPC_EVENT_BARCONFIG_UPDATE)) { | 334 | if (!ipc_has_event_listeners(IPC_EVENT_BARCONFIG_UPDATE)) { |
335 | return; | 335 | return; |
336 | } | 336 | } |
337 | wlr_log(WLR_DEBUG, "Sending barconfig_update event"); | 337 | sway_log(SWAY_DEBUG, "Sending barconfig_update event"); |
338 | json_object *json = ipc_json_describe_bar_config(bar); | 338 | json_object *json = ipc_json_describe_bar_config(bar); |
339 | 339 | ||
340 | const char *json_string = json_object_to_json_string(json); | 340 | const char *json_string = json_object_to_json_string(json); |
@@ -346,7 +346,7 @@ void ipc_event_bar_state_update(struct bar_config *bar) { | |||
346 | if (!ipc_has_event_listeners(IPC_EVENT_BAR_STATE_UPDATE)) { | 346 | if (!ipc_has_event_listeners(IPC_EVENT_BAR_STATE_UPDATE)) { |
347 | return; | 347 | return; |
348 | } | 348 | } |
349 | wlr_log(WLR_DEBUG, "Sending bar_state_update event"); | 349 | sway_log(SWAY_DEBUG, "Sending bar_state_update event"); |
350 | 350 | ||
351 | json_object *json = json_object_new_object(); | 351 | json_object *json = json_object_new_object(); |
352 | json_object_object_add(json, "id", json_object_new_string(bar->id)); | 352 | json_object_object_add(json, "id", json_object_new_string(bar->id)); |
@@ -362,7 +362,7 @@ void ipc_event_mode(const char *mode, bool pango) { | |||
362 | if (!ipc_has_event_listeners(IPC_EVENT_MODE)) { | 362 | if (!ipc_has_event_listeners(IPC_EVENT_MODE)) { |
363 | return; | 363 | return; |
364 | } | 364 | } |
365 | wlr_log(WLR_DEBUG, "Sending mode::%s event", mode); | 365 | sway_log(SWAY_DEBUG, "Sending mode::%s event", mode); |
366 | json_object *obj = json_object_new_object(); | 366 | json_object *obj = json_object_new_object(); |
367 | json_object_object_add(obj, "change", json_object_new_string(mode)); | 367 | json_object_object_add(obj, "change", json_object_new_string(mode)); |
368 | json_object_object_add(obj, "pango_markup", | 368 | json_object_object_add(obj, "pango_markup", |
@@ -377,7 +377,7 @@ void ipc_event_shutdown(const char *reason) { | |||
377 | if (!ipc_has_event_listeners(IPC_EVENT_SHUTDOWN)) { | 377 | if (!ipc_has_event_listeners(IPC_EVENT_SHUTDOWN)) { |
378 | return; | 378 | return; |
379 | } | 379 | } |
380 | wlr_log(WLR_DEBUG, "Sending shutdown::%s event", reason); | 380 | sway_log(SWAY_DEBUG, "Sending shutdown::%s event", reason); |
381 | 381 | ||
382 | json_object *json = json_object_new_object(); | 382 | json_object *json = json_object_new_object(); |
383 | json_object_object_add(json, "change", json_object_new_string(reason)); | 383 | json_object_object_add(json, "change", json_object_new_string(reason)); |
@@ -391,7 +391,7 @@ void ipc_event_binding(struct sway_binding *binding) { | |||
391 | if (!ipc_has_event_listeners(IPC_EVENT_BINDING)) { | 391 | if (!ipc_has_event_listeners(IPC_EVENT_BINDING)) { |
392 | return; | 392 | return; |
393 | } | 393 | } |
394 | wlr_log(WLR_DEBUG, "Sending binding event"); | 394 | sway_log(SWAY_DEBUG, "Sending binding event"); |
395 | 395 | ||
396 | json_object *json_binding = json_object_new_object(); | 396 | json_object *json_binding = json_object_new_object(); |
397 | json_object_object_add(json_binding, "command", json_object_new_string(binding->command)); | 397 | json_object_object_add(json_binding, "command", json_object_new_string(binding->command)); |
@@ -464,7 +464,7 @@ static void ipc_event_tick(const char *payload) { | |||
464 | if (!ipc_has_event_listeners(IPC_EVENT_TICK)) { | 464 | if (!ipc_has_event_listeners(IPC_EVENT_TICK)) { |
465 | return; | 465 | return; |
466 | } | 466 | } |
467 | wlr_log(WLR_DEBUG, "Sending tick event"); | 467 | sway_log(SWAY_DEBUG, "Sending tick event"); |
468 | 468 | ||
469 | json_object *json = json_object_new_object(); | 469 | json_object *json = json_object_new_object(); |
470 | json_object_object_add(json, "first", json_object_new_boolean(false)); | 470 | json_object_object_add(json, "first", json_object_new_boolean(false)); |
@@ -479,13 +479,13 @@ int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { | |||
479 | struct ipc_client *client = data; | 479 | struct ipc_client *client = data; |
480 | 480 | ||
481 | if (mask & WL_EVENT_ERROR) { | 481 | if (mask & WL_EVENT_ERROR) { |
482 | wlr_log(WLR_ERROR, "IPC Client socket error, removing client"); | 482 | sway_log(SWAY_ERROR, "IPC Client socket error, removing client"); |
483 | ipc_client_disconnect(client); | 483 | ipc_client_disconnect(client); |
484 | return 0; | 484 | return 0; |
485 | } | 485 | } |
486 | 486 | ||
487 | if (mask & WL_EVENT_HANGUP) { | 487 | if (mask & WL_EVENT_HANGUP) { |
488 | wlr_log(WLR_DEBUG, "Client %d hung up", client->fd); | 488 | sway_log(SWAY_DEBUG, "Client %d hung up", client->fd); |
489 | ipc_client_disconnect(client); | 489 | ipc_client_disconnect(client); |
490 | return 0; | 490 | return 0; |
491 | } | 491 | } |
@@ -494,14 +494,14 @@ int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { | |||
494 | return 0; | 494 | return 0; |
495 | } | 495 | } |
496 | 496 | ||
497 | wlr_log(WLR_DEBUG, "Client %d writable", client->fd); | 497 | sway_log(SWAY_DEBUG, "Client %d writable", client->fd); |
498 | 498 | ||
499 | ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); | 499 | ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); |
500 | 500 | ||
501 | if (written == -1 && errno == EAGAIN) { | 501 | if (written == -1 && errno == EAGAIN) { |
502 | return 0; | 502 | return 0; |
503 | } else if (written == -1) { | 503 | } else if (written == -1) { |
504 | wlr_log_errno(WLR_INFO, "Unable to send data from queue to IPC client"); | 504 | sway_log_errno(SWAY_INFO, "Unable to send data from queue to IPC client"); |
505 | ipc_client_disconnect(client); | 505 | ipc_client_disconnect(client); |
506 | return 0; | 506 | return 0; |
507 | } | 507 | } |
@@ -524,7 +524,7 @@ void ipc_client_disconnect(struct ipc_client *client) { | |||
524 | 524 | ||
525 | shutdown(client->fd, SHUT_RDWR); | 525 | shutdown(client->fd, SHUT_RDWR); |
526 | 526 | ||
527 | wlr_log(WLR_INFO, "IPC Client %d disconnected", client->fd); | 527 | sway_log(SWAY_INFO, "IPC Client %d disconnected", client->fd); |
528 | wl_event_source_remove(client->event_source); | 528 | wl_event_source_remove(client->event_source); |
529 | if (client->writable_event_source) { | 529 | if (client->writable_event_source) { |
530 | wl_event_source_remove(client->writable_event_source); | 530 | wl_event_source_remove(client->writable_event_source); |
@@ -573,7 +573,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
573 | 573 | ||
574 | char *buf = malloc(client->payload_length + 1); | 574 | char *buf = malloc(client->payload_length + 1); |
575 | if (!buf) { | 575 | if (!buf) { |
576 | wlr_log_errno(WLR_INFO, "Unable to allocate IPC payload"); | 576 | sway_log_errno(SWAY_INFO, "Unable to allocate IPC payload"); |
577 | ipc_client_disconnect(client); | 577 | ipc_client_disconnect(client); |
578 | return; | 578 | return; |
579 | } | 579 | } |
@@ -582,7 +582,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
582 | ssize_t received = recv(client->fd, buf, client->payload_length, 0); | 582 | ssize_t received = recv(client->fd, buf, client->payload_length, 0); |
583 | if (received == -1) | 583 | if (received == -1) |
584 | { | 584 | { |
585 | wlr_log_errno(WLR_INFO, "Unable to receive payload from IPC client"); | 585 | sway_log_errno(SWAY_INFO, "Unable to receive payload from IPC client"); |
586 | ipc_client_disconnect(client); | 586 | ipc_client_disconnect(client); |
587 | free(buf); | 587 | free(buf); |
588 | return; | 588 | return; |
@@ -667,7 +667,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
667 | if (request == NULL || !json_object_is_type(request, json_type_array)) { | 667 | if (request == NULL || !json_object_is_type(request, json_type_array)) { |
668 | const char msg[] = "{\"success\": false}"; | 668 | const char msg[] = "{\"success\": false}"; |
669 | client_valid = ipc_send_reply(client, msg, strlen(msg)); | 669 | client_valid = ipc_send_reply(client, msg, strlen(msg)); |
670 | wlr_log(WLR_INFO, "Failed to parse subscribe request"); | 670 | sway_log(SWAY_INFO, "Failed to parse subscribe request"); |
671 | goto exit_cleanup; | 671 | goto exit_cleanup; |
672 | } | 672 | } |
673 | 673 | ||
@@ -696,7 +696,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
696 | const char msg[] = "{\"success\": false}"; | 696 | const char msg[] = "{\"success\": false}"; |
697 | client_valid = ipc_send_reply(client, msg, strlen(msg)); | 697 | client_valid = ipc_send_reply(client, msg, strlen(msg)); |
698 | json_object_put(request); | 698 | json_object_put(request); |
699 | wlr_log(WLR_INFO, "Unsupported event type in subscribe request"); | 699 | sway_log(SWAY_INFO, "Unsupported event type in subscribe request"); |
700 | goto exit_cleanup; | 700 | goto exit_cleanup; |
701 | } | 701 | } |
702 | } | 702 | } |
@@ -845,7 +845,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
845 | } | 845 | } |
846 | 846 | ||
847 | default: | 847 | default: |
848 | wlr_log(WLR_INFO, "Unknown IPC command type %i", client->current_command); | 848 | sway_log(SWAY_INFO, "Unknown IPC command type %i", client->current_command); |
849 | goto exit_cleanup; | 849 | goto exit_cleanup; |
850 | } | 850 | } |
851 | 851 | ||
@@ -873,14 +873,14 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay | |||
873 | } | 873 | } |
874 | 874 | ||
875 | if (client->write_buffer_size > 4e6) { // 4 MB | 875 | if (client->write_buffer_size > 4e6) { // 4 MB |
876 | wlr_log(WLR_ERROR, "Client write buffer too big, disconnecting client"); | 876 | sway_log(SWAY_ERROR, "Client write buffer too big, disconnecting client"); |
877 | ipc_client_disconnect(client); | 877 | ipc_client_disconnect(client); |
878 | return false; | 878 | return false; |
879 | } | 879 | } |
880 | 880 | ||
881 | char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); | 881 | char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); |
882 | if (!new_buffer) { | 882 | if (!new_buffer) { |
883 | wlr_log(WLR_ERROR, "Unable to reallocate ipc client write buffer"); | 883 | sway_log(SWAY_ERROR, "Unable to reallocate ipc client write buffer"); |
884 | ipc_client_disconnect(client); | 884 | ipc_client_disconnect(client); |
885 | return false; | 885 | return false; |
886 | } | 886 | } |
@@ -897,6 +897,6 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay | |||
897 | ipc_client_handle_writable, client); | 897 | ipc_client_handle_writable, client); |
898 | } | 898 | } |
899 | 899 | ||
900 | wlr_log(WLR_DEBUG, "Added IPC reply to client %d queue: %s", client->fd, payload); | 900 | sway_log(SWAY_DEBUG, "Added IPC reply to client %d queue: %s", client->fd, payload); |
901 | return true; | 901 | return true; |
902 | } | 902 | } |
diff --git a/sway/main.c b/sway/main.c index 6e2f16db..4a92b25a 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -94,10 +94,10 @@ void detect_proprietary(int allow_unsupported_gpu) { | |||
94 | while (getline(&line, &line_size, f) != -1) { | 94 | while (getline(&line, &line_size, f) != -1) { |
95 | if (strstr(line, "nvidia")) { | 95 | if (strstr(line, "nvidia")) { |
96 | if (allow_unsupported_gpu) { | 96 | if (allow_unsupported_gpu) { |
97 | wlr_log(WLR_ERROR, | 97 | sway_log(SWAY_ERROR, |
98 | "!!! Proprietary Nvidia drivers are in use !!!"); | 98 | "!!! Proprietary Nvidia drivers are in use !!!"); |
99 | } else { | 99 | } else { |
100 | wlr_log(WLR_ERROR, | 100 | sway_log(SWAY_ERROR, |
101 | "Proprietary Nvidia drivers are NOT supported. " | 101 | "Proprietary Nvidia drivers are NOT supported. " |
102 | "Use Nouveau. To launch sway anyway, launch with " | 102 | "Use Nouveau. To launch sway anyway, launch with " |
103 | "--my-next-gpu-wont-be-nvidia and DO NOT report issues."); | 103 | "--my-next-gpu-wont-be-nvidia and DO NOT report issues."); |
@@ -107,10 +107,10 @@ void detect_proprietary(int allow_unsupported_gpu) { | |||
107 | } | 107 | } |
108 | if (strstr(line, "fglrx")) { | 108 | if (strstr(line, "fglrx")) { |
109 | if (allow_unsupported_gpu) { | 109 | if (allow_unsupported_gpu) { |
110 | wlr_log(WLR_ERROR, | 110 | sway_log(SWAY_ERROR, |
111 | "!!! Proprietary AMD drivers are in use !!!"); | 111 | "!!! Proprietary AMD drivers are in use !!!"); |
112 | } else { | 112 | } else { |
113 | wlr_log(WLR_ERROR, "Proprietary AMD drivers do NOT support " | 113 | sway_log(SWAY_ERROR, "Proprietary AMD drivers do NOT support " |
114 | "Wayland. Use radeon. To try anyway, launch sway with " | 114 | "Wayland. Use radeon. To try anyway, launch sway with " |
115 | "--unsupported-gpu and DO NOT report issues."); | 115 | "--unsupported-gpu and DO NOT report issues."); |
116 | exit(EXIT_FAILURE); | 116 | exit(EXIT_FAILURE); |
@@ -141,7 +141,7 @@ static void log_env(void) { | |||
141 | "SWAYSOCK" | 141 | "SWAYSOCK" |
142 | }; | 142 | }; |
143 | for (size_t i = 0; i < sizeof(log_vars) / sizeof(char *); ++i) { | 143 | for (size_t i = 0; i < sizeof(log_vars) / sizeof(char *); ++i) { |
144 | wlr_log(WLR_INFO, "%s=%s", log_vars[i], getenv(log_vars[i])); | 144 | sway_log(SWAY_INFO, "%s=%s", log_vars[i], getenv(log_vars[i])); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
@@ -153,7 +153,7 @@ static void log_file(FILE *f) { | |||
153 | if (line[nread - 1] == '\n') { | 153 | if (line[nread - 1] == '\n') { |
154 | line[nread - 1] = '\0'; | 154 | line[nread - 1] = '\0'; |
155 | } | 155 | } |
156 | wlr_log(WLR_INFO, "%s", line); | 156 | sway_log(SWAY_INFO, "%s", line); |
157 | } | 157 | } |
158 | free(line); | 158 | free(line); |
159 | } | 159 | } |
@@ -169,7 +169,7 @@ static void log_distro(void) { | |||
169 | for (size_t i = 0; i < sizeof(paths) / sizeof(char *); ++i) { | 169 | for (size_t i = 0; i < sizeof(paths) / sizeof(char *); ++i) { |
170 | FILE *f = fopen(paths[i], "r"); | 170 | FILE *f = fopen(paths[i], "r"); |
171 | if (f) { | 171 | if (f) { |
172 | wlr_log(WLR_INFO, "Contents of %s:", paths[i]); | 172 | sway_log(SWAY_INFO, "Contents of %s:", paths[i]); |
173 | log_file(f); | 173 | log_file(f); |
174 | fclose(f); | 174 | fclose(f); |
175 | } | 175 | } |
@@ -179,7 +179,7 @@ static void log_distro(void) { | |||
179 | static void log_kernel(void) { | 179 | static void log_kernel(void) { |
180 | FILE *f = popen("uname -a", "r"); | 180 | FILE *f = popen("uname -a", "r"); |
181 | if (!f) { | 181 | if (!f) { |
182 | wlr_log(WLR_INFO, "Unable to determine kernel version"); | 182 | sway_log(SWAY_INFO, "Unable to determine kernel version"); |
183 | return; | 183 | return; |
184 | } | 184 | } |
185 | log_file(f); | 185 | log_file(f); |
@@ -190,16 +190,16 @@ static void log_kernel(void) { | |||
190 | static bool drop_permissions(void) { | 190 | static bool drop_permissions(void) { |
191 | if (getuid() != geteuid() || getgid() != getegid()) { | 191 | if (getuid() != geteuid() || getgid() != getegid()) { |
192 | if (setgid(getgid()) != 0) { | 192 | if (setgid(getgid()) != 0) { |
193 | wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); | 193 | sway_log(SWAY_ERROR, "Unable to drop root, refusing to start"); |
194 | return false; | 194 | return false; |
195 | } | 195 | } |
196 | if (setuid(getuid()) != 0) { | 196 | if (setuid(getuid()) != 0) { |
197 | wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); | 197 | sway_log(SWAY_ERROR, "Unable to drop root, refusing to start"); |
198 | return false; | 198 | return false; |
199 | } | 199 | } |
200 | } | 200 | } |
201 | if (setuid(0) != -1) { | 201 | if (setuid(0) != -1) { |
202 | wlr_log(WLR_ERROR, "Unable to drop root (we shouldn't be able to " | 202 | sway_log(SWAY_ERROR, "Unable to drop root (we shouldn't be able to " |
203 | "restore it after setuid), refusing to start"); | 203 | "restore it after setuid), refusing to start"); |
204 | return false; | 204 | return false; |
205 | } | 205 | } |
@@ -303,17 +303,22 @@ int main(int argc, char **argv) { | |||
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | // As the 'callback' function for wlr_log is equivalent to that for | ||
307 | // sway, we do not need to override it. | ||
306 | if (debug) { | 308 | if (debug) { |
309 | sway_log_init(SWAY_DEBUG, sway_terminate); | ||
307 | wlr_log_init(WLR_DEBUG, NULL); | 310 | wlr_log_init(WLR_DEBUG, NULL); |
308 | } else if (verbose || validate) { | 311 | } else if (verbose || validate) { |
312 | sway_log_init(SWAY_INFO, sway_terminate); | ||
309 | wlr_log_init(WLR_INFO, NULL); | 313 | wlr_log_init(WLR_INFO, NULL); |
310 | } else { | 314 | } else { |
315 | sway_log_init(SWAY_ERROR, sway_terminate); | ||
311 | wlr_log_init(WLR_ERROR, NULL); | 316 | wlr_log_init(WLR_ERROR, NULL); |
312 | } | 317 | } |
313 | 318 | ||
314 | if (optind < argc) { // Behave as IPC client | 319 | if (optind < argc) { // Behave as IPC client |
315 | if (optind != 1) { | 320 | if (optind != 1) { |
316 | wlr_log(WLR_ERROR, "Don't use options with the IPC client"); | 321 | sway_log(SWAY_ERROR, "Don't use options with the IPC client"); |
317 | exit(EXIT_FAILURE); | 322 | exit(EXIT_FAILURE); |
318 | } | 323 | } |
319 | if (!drop_permissions()) { | 324 | if (!drop_permissions()) { |
@@ -321,7 +326,7 @@ int main(int argc, char **argv) { | |||
321 | } | 326 | } |
322 | char *socket_path = getenv("SWAYSOCK"); | 327 | char *socket_path = getenv("SWAYSOCK"); |
323 | if (!socket_path) { | 328 | if (!socket_path) { |
324 | wlr_log(WLR_ERROR, "Unable to retrieve socket path"); | 329 | sway_log(SWAY_ERROR, "Unable to retrieve socket path"); |
325 | exit(EXIT_FAILURE); | 330 | exit(EXIT_FAILURE); |
326 | } | 331 | } |
327 | char *command = join_args(argv + optind, argc - optind); | 332 | char *command = join_args(argv + optind, argc - optind); |
@@ -349,7 +354,7 @@ int main(int argc, char **argv) { | |||
349 | // prevent ipc from crashing sway | 354 | // prevent ipc from crashing sway |
350 | signal(SIGPIPE, SIG_IGN); | 355 | signal(SIGPIPE, SIG_IGN); |
351 | 356 | ||
352 | wlr_log(WLR_INFO, "Starting sway version " SWAY_VERSION); | 357 | sway_log(SWAY_INFO, "Starting sway version " SWAY_VERSION); |
353 | 358 | ||
354 | root = root_create(); | 359 | root = root_create(); |
355 | 360 | ||
@@ -383,14 +388,14 @@ int main(int argc, char **argv) { | |||
383 | config->active = true; | 388 | config->active = true; |
384 | load_swaybars(); | 389 | load_swaybars(); |
385 | // Execute commands until there are none left | 390 | // Execute commands until there are none left |
386 | wlr_log(WLR_DEBUG, "Running deferred commands"); | 391 | sway_log(SWAY_DEBUG, "Running deferred commands"); |
387 | while (config->cmd_queue->length) { | 392 | while (config->cmd_queue->length) { |
388 | char *line = config->cmd_queue->items[0]; | 393 | char *line = config->cmd_queue->items[0]; |
389 | list_t *res_list = execute_command(line, NULL, NULL); | 394 | list_t *res_list = execute_command(line, NULL, NULL); |
390 | for (int i = 0; i < res_list->length; ++i) { | 395 | for (int i = 0; i < res_list->length; ++i) { |
391 | struct cmd_results *res = res_list->items[i]; | 396 | struct cmd_results *res = res_list->items[i]; |
392 | if (res->status != CMD_SUCCESS) { | 397 | if (res->status != CMD_SUCCESS) { |
393 | wlr_log(WLR_ERROR, "Error on line '%s': %s", line, res->error); | 398 | sway_log(SWAY_ERROR, "Error on line '%s': %s", line, res->error); |
394 | } | 399 | } |
395 | free_cmd_results(res); | 400 | free_cmd_results(res); |
396 | } | 401 | } |
@@ -408,7 +413,7 @@ int main(int argc, char **argv) { | |||
408 | server_run(&server); | 413 | server_run(&server); |
409 | } | 414 | } |
410 | 415 | ||
411 | wlr_log(WLR_INFO, "Shutting down sway"); | 416 | sway_log(SWAY_INFO, "Shutting down sway"); |
412 | 417 | ||
413 | server_fini(&server); | 418 | server_fini(&server); |
414 | root_destroy(root); | 419 | root_destroy(root); |
diff --git a/sway/server.c b/sway/server.c index 0529cab1..5ae9bb01 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -19,9 +19,9 @@ | |||
19 | #include <wlr/types/wlr_xcursor_manager.h> | 19 | #include <wlr/types/wlr_xcursor_manager.h> |
20 | #include <wlr/types/wlr_xdg_decoration_v1.h> | 20 | #include <wlr/types/wlr_xdg_decoration_v1.h> |
21 | #include <wlr/types/wlr_xdg_output_v1.h> | 21 | #include <wlr/types/wlr_xdg_output_v1.h> |
22 | #include <wlr/util/log.h> | ||
23 | #include "config.h" | 22 | #include "config.h" |
24 | #include "list.h" | 23 | #include "list.h" |
24 | #include "log.h" | ||
25 | #include "sway/config.h" | 25 | #include "sway/config.h" |
26 | #include "sway/desktop/idle_inhibit_v1.h" | 26 | #include "sway/desktop/idle_inhibit_v1.h" |
27 | #include "sway/input/input-manager.h" | 27 | #include "sway/input/input-manager.h" |
@@ -32,20 +32,20 @@ | |||
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | bool server_privileged_prepare(struct sway_server *server) { | 34 | bool server_privileged_prepare(struct sway_server *server) { |
35 | wlr_log(WLR_DEBUG, "Preparing Wayland server initialization"); | 35 | sway_log(SWAY_DEBUG, "Preparing Wayland server initialization"); |
36 | server->wl_display = wl_display_create(); | 36 | server->wl_display = wl_display_create(); |
37 | server->wl_event_loop = wl_display_get_event_loop(server->wl_display); | 37 | server->wl_event_loop = wl_display_get_event_loop(server->wl_display); |
38 | server->backend = wlr_backend_autocreate(server->wl_display, NULL); | 38 | server->backend = wlr_backend_autocreate(server->wl_display, NULL); |
39 | 39 | ||
40 | if (!server->backend) { | 40 | if (!server->backend) { |
41 | wlr_log(WLR_ERROR, "Unable to create backend"); | 41 | sway_log(SWAY_ERROR, "Unable to create backend"); |
42 | return false; | 42 | return false; |
43 | } | 43 | } |
44 | return true; | 44 | return true; |
45 | } | 45 | } |
46 | 46 | ||
47 | bool server_init(struct sway_server *server) { | 47 | bool server_init(struct sway_server *server) { |
48 | wlr_log(WLR_DEBUG, "Initializing Wayland server"); | 48 | sway_log(SWAY_DEBUG, "Initializing Wayland server"); |
49 | 49 | ||
50 | struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend); | 50 | struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend); |
51 | assert(renderer); | 51 | assert(renderer); |
@@ -111,7 +111,7 @@ bool server_init(struct sway_server *server) { | |||
111 | 111 | ||
112 | server->socket = wl_display_add_socket_auto(server->wl_display); | 112 | server->socket = wl_display_add_socket_auto(server->wl_display); |
113 | if (!server->socket) { | 113 | if (!server->socket) { |
114 | wlr_log(WLR_ERROR, "Unable to open wayland socket"); | 114 | sway_log(SWAY_ERROR, "Unable to open wayland socket"); |
115 | wlr_backend_destroy(server->backend); | 115 | wlr_backend_destroy(server->backend); |
116 | return false; | 116 | return false; |
117 | } | 117 | } |
@@ -155,7 +155,7 @@ bool server_start(struct sway_server *server) { | |||
155 | 155 | ||
156 | #if HAVE_XWAYLAND | 156 | #if HAVE_XWAYLAND |
157 | if (config->xwayland) { | 157 | if (config->xwayland) { |
158 | wlr_log(WLR_DEBUG, "Initializing Xwayland"); | 158 | sway_log(SWAY_DEBUG, "Initializing Xwayland"); |
159 | server->xwayland.wlr_xwayland = | 159 | server->xwayland.wlr_xwayland = |
160 | wlr_xwayland_create(server->wl_display, server->compositor, true); | 160 | wlr_xwayland_create(server->wl_display, server->compositor, true); |
161 | wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface, | 161 | wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface, |
@@ -179,10 +179,10 @@ bool server_start(struct sway_server *server) { | |||
179 | } | 179 | } |
180 | #endif | 180 | #endif |
181 | 181 | ||
182 | wlr_log(WLR_INFO, "Starting backend on wayland display '%s'", | 182 | sway_log(SWAY_INFO, "Starting backend on wayland display '%s'", |
183 | server->socket); | 183 | server->socket); |
184 | if (!wlr_backend_start(server->backend)) { | 184 | if (!wlr_backend_start(server->backend)) { |
185 | wlr_log(WLR_ERROR, "Failed to start backend"); | 185 | sway_log(SWAY_ERROR, "Failed to start backend"); |
186 | wlr_backend_destroy(server->backend); | 186 | wlr_backend_destroy(server->backend); |
187 | return false; | 187 | return false; |
188 | } | 188 | } |
@@ -190,7 +190,7 @@ bool server_start(struct sway_server *server) { | |||
190 | } | 190 | } |
191 | 191 | ||
192 | void server_run(struct sway_server *server) { | 192 | void server_run(struct sway_server *server) { |
193 | wlr_log(WLR_INFO, "Running compositor on wayland display '%s'", | 193 | sway_log(SWAY_INFO, "Running compositor on wayland display '%s'", |
194 | server->socket); | 194 | server->socket); |
195 | wl_display_run(server->wl_display); | 195 | wl_display_run(server->wl_display); |
196 | } | 196 | } |
diff --git a/sway/swaynag.c b/sway/swaynag.c index 38e74b88..49027f5d 100644 --- a/sway/swaynag.c +++ b/sway/swaynag.c | |||
@@ -17,7 +17,7 @@ bool swaynag_spawn(const char *swaynag_command, | |||
17 | 17 | ||
18 | if (swaynag->detailed) { | 18 | if (swaynag->detailed) { |
19 | if (pipe(swaynag->fd) != 0) { | 19 | if (pipe(swaynag->fd) != 0) { |
20 | wlr_log(WLR_ERROR, "Failed to create pipe for swaynag"); | 20 | sway_log(SWAY_ERROR, "Failed to create pipe for swaynag"); |
21 | return false; | 21 | return false; |
22 | } | 22 | } |
23 | fcntl(swaynag->fd[1], F_SETFD, FD_CLOEXEC); | 23 | fcntl(swaynag->fd[1], F_SETFD, FD_CLOEXEC); |
@@ -37,7 +37,7 @@ bool swaynag_spawn(const char *swaynag_command, | |||
37 | execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); | 37 | execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); |
38 | _exit(0); | 38 | _exit(0); |
39 | } else if (pid < 0) { | 39 | } else if (pid < 0) { |
40 | wlr_log(WLR_ERROR, "Failed to create fork for swaynag"); | 40 | sway_log(SWAY_ERROR, "Failed to create fork for swaynag"); |
41 | if (swaynag->detailed) { | 41 | if (swaynag->detailed) { |
42 | close(swaynag->fd[0]); | 42 | close(swaynag->fd[0]); |
43 | close(swaynag->fd[1]); | 43 | close(swaynag->fd[1]); |
@@ -67,7 +67,7 @@ void swaynag_log(const char *swaynag_command, struct swaynag_instance *swaynag, | |||
67 | } | 67 | } |
68 | 68 | ||
69 | if (!swaynag->detailed) { | 69 | if (!swaynag->detailed) { |
70 | wlr_log(WLR_ERROR, "Attempting to write to non-detailed swaynag inst"); | 70 | sway_log(SWAY_ERROR, "Attempting to write to non-detailed swaynag inst"); |
71 | return; | 71 | return; |
72 | } | 72 | } |
73 | 73 | ||
@@ -82,7 +82,7 @@ void swaynag_log(const char *swaynag_command, struct swaynag_instance *swaynag, | |||
82 | 82 | ||
83 | char *temp = malloc(length + 1); | 83 | char *temp = malloc(length + 1); |
84 | if (!temp) { | 84 | if (!temp) { |
85 | wlr_log(WLR_ERROR, "Failed to allocate buffer for swaynag log entry."); | 85 | sway_log(SWAY_ERROR, "Failed to allocate buffer for swaynag log entry."); |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | 88 | ||
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index 852d53bf..f78d95a4 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c | |||
@@ -35,7 +35,7 @@ static void apply_horiz_layout(list_t *children, struct wlr_box *parent) { | |||
35 | double scale = parent->width / total_width; | 35 | double scale = parent->width / total_width; |
36 | 36 | ||
37 | // Resize windows | 37 | // Resize windows |
38 | wlr_log(WLR_DEBUG, "Arranging %p horizontally", parent); | 38 | sway_log(SWAY_DEBUG, "Arranging %p horizontally", parent); |
39 | double child_x = parent->x; | 39 | double child_x = parent->x; |
40 | for (int i = 0; i < children->length; ++i) { | 40 | for (int i = 0; i < children->length; ++i) { |
41 | struct sway_container *child = children->items[i]; | 41 | struct sway_container *child = children->items[i]; |
@@ -75,7 +75,7 @@ static void apply_vert_layout(list_t *children, struct wlr_box *parent) { | |||
75 | double scale = parent->height / total_height; | 75 | double scale = parent->height / total_height; |
76 | 76 | ||
77 | // Resize | 77 | // Resize |
78 | wlr_log(WLR_DEBUG, "Arranging %p vertically", parent); | 78 | sway_log(SWAY_DEBUG, "Arranging %p vertically", parent); |
79 | double child_y = parent->y; | 79 | double child_y = parent->y; |
80 | for (int i = 0; i < children->length; ++i) { | 80 | for (int i = 0; i < children->length; ++i) { |
81 | struct sway_container *child = children->items[i]; | 81 | struct sway_container *child = children->items[i]; |
@@ -186,7 +186,7 @@ void arrange_workspace(struct sway_workspace *workspace) { | |||
186 | } | 186 | } |
187 | struct sway_output *output = workspace->output; | 187 | struct sway_output *output = workspace->output; |
188 | struct wlr_box *area = &output->usable_area; | 188 | struct wlr_box *area = &output->usable_area; |
189 | wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", | 189 | sway_log(SWAY_DEBUG, "Usable area for ws: %dx%d@%d,%d", |
190 | area->width, area->height, area->x, area->y); | 190 | area->width, area->height, area->x, area->y); |
191 | workspace_remove_gaps(workspace); | 191 | workspace_remove_gaps(workspace); |
192 | 192 | ||
@@ -217,7 +217,7 @@ void arrange_workspace(struct sway_workspace *workspace) { | |||
217 | 217 | ||
218 | workspace_add_gaps(workspace); | 218 | workspace_add_gaps(workspace); |
219 | node_set_dirty(&workspace->node); | 219 | node_set_dirty(&workspace->node); |
220 | wlr_log(WLR_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name, | 220 | sway_log(SWAY_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name, |
221 | workspace->x, workspace->y); | 221 | workspace->x, workspace->y); |
222 | if (workspace->fullscreen) { | 222 | if (workspace->fullscreen) { |
223 | struct sway_container *fs = workspace->fullscreen; | 223 | struct sway_container *fs = workspace->fullscreen; |
diff --git a/sway/tree/container.c b/sway/tree/container.c index d9c721f5..97a52d91 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -28,7 +28,7 @@ | |||
28 | struct sway_container *container_create(struct sway_view *view) { | 28 | struct sway_container *container_create(struct sway_view *view) { |
29 | struct sway_container *c = calloc(1, sizeof(struct sway_container)); | 29 | struct sway_container *c = calloc(1, sizeof(struct sway_container)); |
30 | if (!c) { | 30 | if (!c) { |
31 | wlr_log(WLR_ERROR, "Unable to allocate sway_container"); | 31 | sway_log(SWAY_ERROR, "Unable to allocate sway_container"); |
32 | return NULL; | 32 | return NULL; |
33 | } | 33 | } |
34 | node_init(&c->node, N_CONTAINER, c); | 34 | node_init(&c->node, N_CONTAINER, c); |
@@ -983,7 +983,7 @@ void container_discover_outputs(struct sway_container *con) { | |||
983 | 983 | ||
984 | if (intersects && index == -1) { | 984 | if (intersects && index == -1) { |
985 | // Send enter | 985 | // Send enter |
986 | wlr_log(WLR_DEBUG, "Container %p entered output %p", con, output); | 986 | sway_log(SWAY_DEBUG, "Container %p entered output %p", con, output); |
987 | if (con->view) { | 987 | if (con->view) { |
988 | view_for_each_surface(con->view, | 988 | view_for_each_surface(con->view, |
989 | surface_send_enter_iterator, output->wlr_output); | 989 | surface_send_enter_iterator, output->wlr_output); |
@@ -991,7 +991,7 @@ void container_discover_outputs(struct sway_container *con) { | |||
991 | list_add(con->outputs, output); | 991 | list_add(con->outputs, output); |
992 | } else if (!intersects && index != -1) { | 992 | } else if (!intersects && index != -1) { |
993 | // Send leave | 993 | // Send leave |
994 | wlr_log(WLR_DEBUG, "Container %p left output %p", con, output); | 994 | sway_log(SWAY_DEBUG, "Container %p left output %p", con, output); |
995 | if (con->view) { | 995 | if (con->view) { |
996 | view_for_each_surface(con->view, | 996 | view_for_each_surface(con->view, |
997 | surface_send_leave_iterator, output->wlr_output); | 997 | surface_send_leave_iterator, output->wlr_output); |
diff --git a/sway/tree/output.c b/sway/tree/output.c index b79e70d4..7fbeeebd 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -97,7 +97,7 @@ void output_enable(struct sway_output *output, struct output_config *oc) { | |||
97 | if (!output->workspaces->length) { | 97 | if (!output->workspaces->length) { |
98 | // Create workspace | 98 | // Create workspace |
99 | char *ws_name = workspace_next_name(wlr_output->name); | 99 | char *ws_name = workspace_next_name(wlr_output->name); |
100 | wlr_log(WLR_DEBUG, "Creating default workspace %s", ws_name); | 100 | sway_log(SWAY_DEBUG, "Creating default workspace %s", ws_name); |
101 | ws = workspace_create(output, ws_name); | 101 | ws = workspace_create(output, ws_name); |
102 | // Set each seat's focus if not already set | 102 | // Set each seat's focus if not already set |
103 | struct sway_seat *seat = NULL; | 103 | struct sway_seat *seat = NULL; |
@@ -212,7 +212,7 @@ void output_disable(struct sway_output *output) { | |||
212 | if (!sway_assert(output->enabled, "Expected an enabled output")) { | 212 | if (!sway_assert(output->enabled, "Expected an enabled output")) { |
213 | return; | 213 | return; |
214 | } | 214 | } |
215 | wlr_log(WLR_DEBUG, "Disabling output '%s'", output->wlr_output->name); | 215 | sway_log(SWAY_DEBUG, "Disabling output '%s'", output->wlr_output->name); |
216 | wl_signal_emit(&output->events.destroy, output); | 216 | wl_signal_emit(&output->events.destroy, output); |
217 | 217 | ||
218 | output_evacuate(output); | 218 | output_evacuate(output); |
@@ -237,7 +237,7 @@ void output_begin_destroy(struct sway_output *output) { | |||
237 | if (!sway_assert(!output->enabled, "Expected a disabled output")) { | 237 | if (!sway_assert(!output->enabled, "Expected a disabled output")) { |
238 | return; | 238 | return; |
239 | } | 239 | } |
240 | wlr_log(WLR_DEBUG, "Destroying output '%s'", output->wlr_output->name); | 240 | sway_log(SWAY_DEBUG, "Destroying output '%s'", output->wlr_output->name); |
241 | 241 | ||
242 | output->node.destroying = true; | 242 | output->node.destroying = true; |
243 | node_set_dirty(&output->node); | 243 | node_set_dirty(&output->node); |
@@ -258,11 +258,11 @@ struct output_config *output_find_config(struct sway_output *output) { | |||
258 | 258 | ||
259 | if (strcasecmp(name, cur->name) == 0 || | 259 | if (strcasecmp(name, cur->name) == 0 || |
260 | strcasecmp(identifier, cur->name) == 0) { | 260 | strcasecmp(identifier, cur->name) == 0) { |
261 | wlr_log(WLR_DEBUG, "Matched output config for %s", name); | 261 | sway_log(SWAY_DEBUG, "Matched output config for %s", name); |
262 | oc = cur; | 262 | oc = cur; |
263 | } | 263 | } |
264 | if (strcasecmp("*", cur->name) == 0) { | 264 | if (strcasecmp("*", cur->name) == 0) { |
265 | wlr_log(WLR_DEBUG, "Matched wildcard output config for %s", name); | 265 | sway_log(SWAY_DEBUG, "Matched wildcard output config for %s", name); |
266 | all = cur; | 266 | all = cur; |
267 | } | 267 | } |
268 | 268 | ||
diff --git a/sway/tree/root.c b/sway/tree/root.c index e5df8dd1..08ce7942 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c | |||
@@ -26,7 +26,7 @@ static void output_layout_handle_change(struct wl_listener *listener, | |||
26 | struct sway_root *root_create(void) { | 26 | struct sway_root *root_create(void) { |
27 | struct sway_root *root = calloc(1, sizeof(struct sway_root)); | 27 | struct sway_root *root = calloc(1, sizeof(struct sway_root)); |
28 | if (!root) { | 28 | if (!root) { |
29 | wlr_log(WLR_ERROR, "Unable to allocate sway_root"); | 29 | sway_log(SWAY_ERROR, "Unable to allocate sway_root"); |
30 | return NULL; | 30 | return NULL; |
31 | } | 31 | } |
32 | node_init(&root->node, N_ROOT, root); | 32 | node_init(&root->node, N_ROOT, root); |
@@ -178,14 +178,14 @@ struct sway_workspace *root_workspace_for_pid(pid_t pid) { | |||
178 | struct sway_workspace *ws = NULL; | 178 | struct sway_workspace *ws = NULL; |
179 | struct pid_workspace *pw = NULL; | 179 | struct pid_workspace *pw = NULL; |
180 | 180 | ||
181 | wlr_log(WLR_DEBUG, "Looking up workspace for pid %d", pid); | 181 | sway_log(SWAY_DEBUG, "Looking up workspace for pid %d", pid); |
182 | 182 | ||
183 | do { | 183 | do { |
184 | struct pid_workspace *_pw = NULL; | 184 | struct pid_workspace *_pw = NULL; |
185 | wl_list_for_each(_pw, &pid_workspaces, link) { | 185 | wl_list_for_each(_pw, &pid_workspaces, link) { |
186 | if (pid == _pw->pid) { | 186 | if (pid == _pw->pid) { |
187 | pw = _pw; | 187 | pw = _pw; |
188 | wlr_log(WLR_DEBUG, | 188 | sway_log(SWAY_DEBUG, |
189 | "found pid_workspace for pid %d, workspace %s", | 189 | "found pid_workspace for pid %d, workspace %s", |
190 | pid, pw->workspace); | 190 | pid, pw->workspace); |
191 | goto found; | 191 | goto found; |
@@ -199,7 +199,7 @@ found: | |||
199 | ws = workspace_by_name(pw->workspace); | 199 | ws = workspace_by_name(pw->workspace); |
200 | 200 | ||
201 | if (!ws) { | 201 | if (!ws) { |
202 | wlr_log(WLR_DEBUG, | 202 | sway_log(SWAY_DEBUG, |
203 | "Creating workspace %s for pid %d because it disappeared", | 203 | "Creating workspace %s for pid %d because it disappeared", |
204 | pw->workspace, pid); | 204 | pw->workspace, pid); |
205 | ws = workspace_create(pw->output, pw->workspace); | 205 | ws = workspace_create(pw->output, pw->workspace); |
@@ -222,7 +222,7 @@ static void pw_handle_output_destroy(struct wl_listener *listener, void *data) { | |||
222 | } | 222 | } |
223 | 223 | ||
224 | void root_record_workspace_pid(pid_t pid) { | 224 | void root_record_workspace_pid(pid_t pid) { |
225 | wlr_log(WLR_DEBUG, "Recording workspace for process %d", pid); | 225 | sway_log(SWAY_DEBUG, "Recording workspace for process %d", pid); |
226 | if (!pid_workspaces.prev && !pid_workspaces.next) { | 226 | if (!pid_workspaces.prev && !pid_workspaces.next) { |
227 | wl_list_init(&pid_workspaces); | 227 | wl_list_init(&pid_workspaces); |
228 | } | 228 | } |
@@ -230,12 +230,12 @@ void root_record_workspace_pid(pid_t pid) { | |||
230 | struct sway_seat *seat = input_manager_current_seat(); | 230 | struct sway_seat *seat = input_manager_current_seat(); |
231 | struct sway_workspace *ws = seat_get_focused_workspace(seat); | 231 | struct sway_workspace *ws = seat_get_focused_workspace(seat); |
232 | if (!ws) { | 232 | if (!ws) { |
233 | wlr_log(WLR_DEBUG, "Bailing out, no workspace"); | 233 | sway_log(SWAY_DEBUG, "Bailing out, no workspace"); |
234 | return; | 234 | return; |
235 | } | 235 | } |
236 | struct sway_output *output = ws->output; | 236 | struct sway_output *output = ws->output; |
237 | if (!output) { | 237 | if (!output) { |
238 | wlr_log(WLR_DEBUG, "Bailing out, no output"); | 238 | sway_log(SWAY_DEBUG, "Bailing out, no output"); |
239 | return; | 239 | return; |
240 | } | 240 | } |
241 | 241 | ||
diff --git a/sway/tree/view.c b/sway/tree/view.c index e65968c6..bc252521 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -328,7 +328,7 @@ void view_request_activate(struct sway_view *view) { | |||
328 | } | 328 | } |
329 | 329 | ||
330 | void view_set_csd_from_server(struct sway_view *view, bool enabled) { | 330 | void view_set_csd_from_server(struct sway_view *view, bool enabled) { |
331 | wlr_log(WLR_DEBUG, "Telling view %p to set CSD to %i", view, enabled); | 331 | sway_log(SWAY_DEBUG, "Telling view %p to set CSD to %i", view, enabled); |
332 | if (view->xdg_decoration) { | 332 | if (view->xdg_decoration) { |
333 | uint32_t mode = enabled ? | 333 | uint32_t mode = enabled ? |
334 | WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE : | 334 | WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE : |
@@ -340,7 +340,7 @@ void view_set_csd_from_server(struct sway_view *view, bool enabled) { | |||
340 | } | 340 | } |
341 | 341 | ||
342 | void view_update_csd_from_client(struct sway_view *view, bool enabled) { | 342 | void view_update_csd_from_client(struct sway_view *view, bool enabled) { |
343 | wlr_log(WLR_DEBUG, "View %p updated CSD to %i", view, enabled); | 343 | sway_log(SWAY_DEBUG, "View %p updated CSD to %i", view, enabled); |
344 | struct sway_container *con = view->container; | 344 | struct sway_container *con = view->container; |
345 | if (enabled && con && con->border != B_CSD) { | 345 | if (enabled && con && con->border != B_CSD) { |
346 | con->saved_border = con->border; | 346 | con->saved_border = con->border; |
@@ -429,12 +429,12 @@ void view_execute_criteria(struct sway_view *view) { | |||
429 | list_t *criterias = criteria_for_view(view, CT_COMMAND); | 429 | list_t *criterias = criteria_for_view(view, CT_COMMAND); |
430 | for (int i = 0; i < criterias->length; i++) { | 430 | for (int i = 0; i < criterias->length; i++) { |
431 | struct criteria *criteria = criterias->items[i]; | 431 | struct criteria *criteria = criterias->items[i]; |
432 | wlr_log(WLR_DEBUG, "Checking criteria %s", criteria->raw); | 432 | sway_log(SWAY_DEBUG, "Checking criteria %s", criteria->raw); |
433 | if (view_has_executed_criteria(view, criteria)) { | 433 | if (view_has_executed_criteria(view, criteria)) { |
434 | wlr_log(WLR_DEBUG, "Criteria already executed"); | 434 | sway_log(SWAY_DEBUG, "Criteria already executed"); |
435 | continue; | 435 | continue; |
436 | } | 436 | } |
437 | wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", | 437 | sway_log(SWAY_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", |
438 | criteria->raw, view, criteria->cmdlist); | 438 | criteria->raw, view, criteria->cmdlist); |
439 | list_add(view->executed_criteria, criteria); | 439 | list_add(view->executed_criteria, criteria); |
440 | list_t *res_list = execute_command( | 440 | list_t *res_list = execute_command( |
@@ -721,7 +721,7 @@ static void view_subsurface_create(struct sway_view *view, | |||
721 | struct sway_subsurface *subsurface = | 721 | struct sway_subsurface *subsurface = |
722 | calloc(1, sizeof(struct sway_subsurface)); | 722 | calloc(1, sizeof(struct sway_subsurface)); |
723 | if (subsurface == NULL) { | 723 | if (subsurface == NULL) { |
724 | wlr_log(WLR_ERROR, "Allocation failed"); | 724 | sway_log(SWAY_ERROR, "Allocation failed"); |
725 | return; | 725 | return; |
726 | } | 726 | } |
727 | view_child_init(&subsurface->child, &subsurface_impl, view, | 727 | view_child_init(&subsurface->child, &subsurface_impl, view, |
@@ -860,7 +860,7 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) { | |||
860 | } | 860 | } |
861 | 861 | ||
862 | const char *role = wlr_surface->role ? wlr_surface->role->name : NULL; | 862 | const char *role = wlr_surface->role ? wlr_surface->role->name : NULL; |
863 | wlr_log(WLR_DEBUG, "Surface of unknown type (role %s): %p", | 863 | sway_log(SWAY_DEBUG, "Surface of unknown type (role %s): %p", |
864 | role, wlr_surface); | 864 | role, wlr_surface); |
865 | return NULL; | 865 | return NULL; |
866 | } | 866 | } |
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 7f18046d..e89c0849 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -69,12 +69,12 @@ struct sway_workspace *workspace_create(struct sway_output *output, | |||
69 | output = workspace_get_initial_output(name); | 69 | output = workspace_get_initial_output(name); |
70 | } | 70 | } |
71 | 71 | ||
72 | wlr_log(WLR_DEBUG, "Adding workspace %s for output %s", name, | 72 | sway_log(SWAY_DEBUG, "Adding workspace %s for output %s", name, |
73 | output->wlr_output->name); | 73 | output->wlr_output->name); |
74 | 74 | ||
75 | struct sway_workspace *ws = calloc(1, sizeof(struct sway_workspace)); | 75 | struct sway_workspace *ws = calloc(1, sizeof(struct sway_workspace)); |
76 | if (!ws) { | 76 | if (!ws) { |
77 | wlr_log(WLR_ERROR, "Unable to allocate sway_workspace"); | 77 | sway_log(SWAY_ERROR, "Unable to allocate sway_workspace"); |
78 | return NULL; | 78 | return NULL; |
79 | } | 79 | } |
80 | node_init(&ws->node, N_WORKSPACE, ws); | 80 | node_init(&ws->node, N_WORKSPACE, ws); |
@@ -152,7 +152,7 @@ void workspace_destroy(struct sway_workspace *workspace) { | |||
152 | } | 152 | } |
153 | 153 | ||
154 | void workspace_begin_destroy(struct sway_workspace *workspace) { | 154 | void workspace_begin_destroy(struct sway_workspace *workspace) { |
155 | wlr_log(WLR_DEBUG, "Destroying workspace '%s'", workspace->name); | 155 | sway_log(SWAY_DEBUG, "Destroying workspace '%s'", workspace->name); |
156 | ipc_event_workspace(NULL, workspace, "empty"); // intentional | 156 | ipc_event_workspace(NULL, workspace, "empty"); // intentional |
157 | wl_signal_emit(&workspace->node.events.destroy, &workspace->node); | 157 | wl_signal_emit(&workspace->node.events.destroy, &workspace->node); |
158 | 158 | ||
@@ -223,7 +223,7 @@ static void workspace_name_from_binding(const struct sway_binding * binding, | |||
223 | char *_target = strdup(name); | 223 | char *_target = strdup(name); |
224 | _target = do_var_replacement(_target); | 224 | _target = do_var_replacement(_target); |
225 | strip_quotes(_target); | 225 | strip_quotes(_target); |
226 | wlr_log(WLR_DEBUG, "Got valid workspace command for target: '%s'", | 226 | sway_log(SWAY_DEBUG, "Got valid workspace command for target: '%s'", |
227 | _target); | 227 | _target); |
228 | 228 | ||
229 | // Make sure that the command references an actual workspace | 229 | // Make sure that the command references an actual workspace |
@@ -248,7 +248,7 @@ static void workspace_name_from_binding(const struct sway_binding * binding, | |||
248 | temp[length - 1] = '\0'; | 248 | temp[length - 1] = '\0'; |
249 | free(_target); | 249 | free(_target); |
250 | _target = temp; | 250 | _target = temp; |
251 | wlr_log(WLR_DEBUG, "Isolated name from workspace number: '%s'", _target); | 251 | sway_log(SWAY_DEBUG, "Isolated name from workspace number: '%s'", _target); |
252 | 252 | ||
253 | // Make sure the workspace number doesn't already exist | 253 | // Make sure the workspace number doesn't already exist |
254 | if (isdigit(_target[0]) && workspace_by_number(_target)) { | 254 | if (isdigit(_target[0]) && workspace_by_number(_target)) { |
@@ -277,7 +277,7 @@ static void workspace_name_from_binding(const struct sway_binding * binding, | |||
277 | *min_order = binding->order; | 277 | *min_order = binding->order; |
278 | free(*earliest_name); | 278 | free(*earliest_name); |
279 | *earliest_name = _target; | 279 | *earliest_name = _target; |
280 | wlr_log(WLR_DEBUG, "Workspace: Found free name %s", _target); | 280 | sway_log(SWAY_DEBUG, "Workspace: Found free name %s", _target); |
281 | } else { | 281 | } else { |
282 | free(_target); | 282 | free(_target); |
283 | } | 283 | } |
@@ -286,7 +286,7 @@ static void workspace_name_from_binding(const struct sway_binding * binding, | |||
286 | } | 286 | } |
287 | 287 | ||
288 | char *workspace_next_name(const char *output_name) { | 288 | char *workspace_next_name(const char *output_name) { |
289 | wlr_log(WLR_DEBUG, "Workspace: Generating new workspace name for output %s", | 289 | sway_log(SWAY_DEBUG, "Workspace: Generating new workspace name for output %s", |
290 | output_name); | 290 | output_name); |
291 | // Scan for available workspace names by looking through output-workspace | 291 | // Scan for available workspace names by looking through output-workspace |
292 | // assignments primarily, falling back to bindings and numbers. | 292 | // assignments primarily, falling back to bindings and numbers. |
@@ -468,13 +468,13 @@ bool workspace_switch(struct sway_workspace *workspace, | |||
468 | free(seat->prev_workspace_name); | 468 | free(seat->prev_workspace_name); |
469 | seat->prev_workspace_name = malloc(strlen(active_ws->name) + 1); | 469 | seat->prev_workspace_name = malloc(strlen(active_ws->name) + 1); |
470 | if (!seat->prev_workspace_name) { | 470 | if (!seat->prev_workspace_name) { |
471 | wlr_log(WLR_ERROR, "Unable to allocate previous workspace name"); | 471 | sway_log(SWAY_ERROR, "Unable to allocate previous workspace name"); |
472 | return false; | 472 | return false; |
473 | } | 473 | } |
474 | strcpy(seat->prev_workspace_name, active_ws->name); | 474 | strcpy(seat->prev_workspace_name, active_ws->name); |
475 | } | 475 | } |
476 | 476 | ||
477 | wlr_log(WLR_DEBUG, "Switching to workspace %p:%s", | 477 | sway_log(SWAY_DEBUG, "Switching to workspace %p:%s", |
478 | workspace, workspace->name); | 478 | workspace, workspace->name); |
479 | struct sway_node *next = seat_get_focus_inactive(seat, &workspace->node); | 479 | struct sway_node *next = seat_get_focus_inactive(seat, &workspace->node); |
480 | if (next == NULL) { | 480 | if (next == NULL) { |