diff options
36 files changed, 167 insertions, 190 deletions
diff --git a/common/ipc-client.c b/common/ipc-client.c index 1ab6627b..582c5e86 100644 --- a/common/ipc-client.c +++ b/common/ipc-client.c | |||
@@ -79,7 +79,7 @@ struct ipc_response *ipc_recv_response(int socketfd) { | |||
79 | error_2: | 79 | error_2: |
80 | free(response); | 80 | free(response); |
81 | error_1: | 81 | error_1: |
82 | sway_log(L_ERROR, "Unable to allocate memory for IPC response"); | 82 | wlr_log(L_ERROR, "Unable to allocate memory for IPC response"); |
83 | return NULL; | 83 | return NULL; |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/common/readline.c b/common/readline.c index cc40a2cc..ed5801de 100644 --- a/common/readline.c +++ b/common/readline.c | |||
@@ -8,7 +8,7 @@ char *read_line(FILE *file) { | |||
8 | char *string = malloc(size); | 8 | char *string = malloc(size); |
9 | char lastChar = '\0'; | 9 | char lastChar = '\0'; |
10 | if (!string) { | 10 | if (!string) { |
11 | sway_log(L_ERROR, "Unable to allocate memory for read_line"); | 11 | wlr_log(L_ERROR, "Unable to allocate memory for read_line"); |
12 | return NULL; | 12 | return NULL; |
13 | } | 13 | } |
14 | while (1) { | 14 | while (1) { |
@@ -29,7 +29,7 @@ char *read_line(FILE *file) { | |||
29 | char *new_string = realloc(string, size *= 2); | 29 | char *new_string = realloc(string, size *= 2); |
30 | if (!new_string) { | 30 | if (!new_string) { |
31 | free(string); | 31 | free(string); |
32 | sway_log(L_ERROR, "Unable to allocate memory for read_line"); | 32 | wlr_log(L_ERROR, "Unable to allocate memory for read_line"); |
33 | return NULL; | 33 | return NULL; |
34 | } | 34 | } |
35 | string = new_string; | 35 | string = new_string; |
diff --git a/common/util.c b/common/util.c index 83981160..fb7f9454 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -113,7 +113,7 @@ uint32_t parse_color(const char *color) { | |||
113 | 113 | ||
114 | int len = strlen(color); | 114 | int len = strlen(color); |
115 | if (len != 6 && len != 8) { | 115 | if (len != 6 && len != 8) { |
116 | sway_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color); | 116 | wlr_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color); |
117 | return 0xFFFFFFFF; | 117 | return 0xFFFFFFFF; |
118 | } | 118 | } |
119 | uint32_t res = (uint32_t)strtoul(color, NULL, 16); | 119 | uint32_t res = (uint32_t)strtoul(color, NULL, 16); |
diff --git a/include/log.h b/include/log.h index a1e33fa2..646776f5 100644 --- a/include/log.h +++ b/include/log.h | |||
@@ -1,22 +1,7 @@ | |||
1 | #ifndef _SWAY_LOG_H | 1 | #ifndef _SWAY_LOG_H |
2 | #define _SWAY_LOG_H | 2 | #define _SWAY_LOG_H |
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | 4 | #include <wlr/util/log.h> | |
5 | typedef enum { | ||
6 | L_SILENT = 0, | ||
7 | L_ERROR = 1, | ||
8 | L_INFO = 2, | ||
9 | L_DEBUG = 3, | ||
10 | } log_importance_t; | ||
11 | |||
12 | void init_log(log_importance_t verbosity); | ||
13 | void set_log_level(log_importance_t verbosity); | ||
14 | log_importance_t get_log_level(void); | ||
15 | void reset_log_level(void); | ||
16 | // returns whether debug logging is on after switching. | ||
17 | bool toggle_debug_logging(void); | ||
18 | void sway_log_colors(int mode); | ||
19 | void sway_log_errno(log_importance_t verbosity, char* format, ...) __attribute__((format(printf,2,3))); | ||
20 | 5 | ||
21 | void _sway_abort(const char *filename, int line, const char* format, ...) __attribute__((format(printf,3,4))); | 6 | void _sway_abort(const char *filename, int line, const char* format, ...) __attribute__((format(printf,3,4))); |
22 | #define sway_abort(FMT, ...) \ | 7 | #define sway_abort(FMT, ...) \ |
@@ -26,14 +11,6 @@ bool _sway_assert(bool condition, const char *filename, int line, const char* fo | |||
26 | #define sway_assert(COND, FMT, ...) \ | 11 | #define sway_assert(COND, FMT, ...) \ |
27 | _sway_assert(COND, __FILE__, __LINE__, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) | 12 | _sway_assert(COND, __FILE__, __LINE__, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) |
28 | 13 | ||
29 | void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5))); | ||
30 | |||
31 | #define sway_log(VERBOSITY, FMT, ...) \ | ||
32 | _sway_log(__FILE__, __LINE__, VERBOSITY, FMT, ##__VA_ARGS__) | ||
33 | |||
34 | #define sway_vlog(VERBOSITY, FMT, VA_ARGS) \ | ||
35 | _sway_vlog(__FILE__, __LINE__, VERBOSITY, FMT, VA_ARGS) | ||
36 | |||
37 | void error_handler(int sig); | 14 | void error_handler(int sig); |
38 | 15 | ||
39 | #endif | 16 | #endif |
diff --git a/sway/commands.c b/sway/commands.c index f01329db..1005cf68 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -176,7 +176,7 @@ static struct cmd_handler seat_handlers[] = { | |||
176 | static struct cmd_handler *find_handler(char *line, enum cmd_status block) { | 176 | static struct cmd_handler *find_handler(char *line, enum cmd_status block) { |
177 | struct cmd_handler d = { .command=line }; | 177 | struct cmd_handler d = { .command=line }; |
178 | struct cmd_handler *res = NULL; | 178 | struct cmd_handler *res = NULL; |
179 | sway_log(L_DEBUG, "find_handler(%s) %d", line, block == CMD_BLOCK_SEAT); | 179 | wlr_log(L_DEBUG, "find_handler(%s) %d", line, block == CMD_BLOCK_SEAT); |
180 | 180 | ||
181 | if (block == CMD_BLOCK_INPUT) { | 181 | if (block == CMD_BLOCK_INPUT) { |
182 | res = bsearch(&d, input_handlers, | 182 | res = bsearch(&d, input_handlers, |
@@ -215,10 +215,10 @@ struct cmd_results *handle_command(char *_exec) { | |||
215 | cmd = argsep(&cmdlist, ","); | 215 | cmd = argsep(&cmdlist, ","); |
216 | cmd += strspn(cmd, whitespace); | 216 | cmd += strspn(cmd, whitespace); |
217 | if (strcmp(cmd, "") == 0) { | 217 | if (strcmp(cmd, "") == 0) { |
218 | sway_log(L_INFO, "Ignoring empty command."); | 218 | wlr_log(L_INFO, "Ignoring empty command."); |
219 | continue; | 219 | continue; |
220 | } | 220 | } |
221 | sway_log(L_INFO, "Handling command '%s'", cmd); | 221 | wlr_log(L_INFO, "Handling command '%s'", cmd); |
222 | //TODO better handling of argv | 222 | //TODO better handling of argv |
223 | int argc; | 223 | int argc; |
224 | char **argv = split_args(cmd, &argc); | 224 | char **argv = split_args(cmd, &argc); |
@@ -276,7 +276,7 @@ struct cmd_results *config_command(char *exec, enum cmd_status block) { | |||
276 | goto cleanup; | 276 | goto cleanup; |
277 | } | 277 | } |
278 | 278 | ||
279 | sway_log(L_INFO, "handling config command '%s'", exec); | 279 | wlr_log(L_INFO, "handling config command '%s'", exec); |
280 | // Endblock | 280 | // Endblock |
281 | if (**argv == '}') { | 281 | if (**argv == '}') { |
282 | results = cmd_results_new(CMD_BLOCK_END, NULL, NULL); | 282 | results = cmd_results_new(CMD_BLOCK_END, NULL, NULL); |
@@ -380,7 +380,7 @@ struct cmd_results *config_commands_command(char *exec) { | |||
380 | } | 380 | } |
381 | policy->context = context; | 381 | policy->context = context; |
382 | 382 | ||
383 | sway_log(L_INFO, "Set command policy for %s to %d", | 383 | wlr_log(L_INFO, "Set command policy for %s to %d", |
384 | policy->command, policy->context); | 384 | policy->command, policy->context); |
385 | 385 | ||
386 | results = cmd_results_new(CMD_SUCCESS, NULL, NULL); | 386 | results = cmd_results_new(CMD_SUCCESS, NULL, NULL); |
@@ -394,7 +394,7 @@ struct cmd_results *cmd_results_new(enum cmd_status status, | |||
394 | const char *input, const char *format, ...) { | 394 | const char *input, const char *format, ...) { |
395 | struct cmd_results *results = malloc(sizeof(struct cmd_results)); | 395 | struct cmd_results *results = malloc(sizeof(struct cmd_results)); |
396 | if (!results) { | 396 | if (!results) { |
397 | sway_log(L_ERROR, "Unable to allocate command results"); | 397 | wlr_log(L_ERROR, "Unable to allocate command results"); |
398 | return NULL; | 398 | return NULL; |
399 | } | 399 | } |
400 | results->status = status; | 400 | results->status = status; |
diff --git a/sway/commands/bind.c b/sway/commands/bind.c index 79121404..cbabb07b 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c | |||
@@ -145,7 +145,7 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) { | |||
145 | for (int i = 0; i < mode_bindings->length; ++i) { | 145 | for (int i = 0; i < mode_bindings->length; ++i) { |
146 | struct sway_binding *config_binding = mode_bindings->items[i]; | 146 | struct sway_binding *config_binding = mode_bindings->items[i]; |
147 | if (binding_key_compare(binding, config_binding)) { | 147 | if (binding_key_compare(binding, config_binding)) { |
148 | sway_log(L_DEBUG, "overwriting old binding with command '%s'", | 148 | wlr_log(L_DEBUG, "overwriting old binding with command '%s'", |
149 | config_binding->command); | 149 | config_binding->command); |
150 | free_sway_binding(config_binding); | 150 | free_sway_binding(config_binding); |
151 | mode_bindings->items[i] = binding; | 151 | mode_bindings->items[i] = binding; |
@@ -157,7 +157,7 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) { | |||
157 | list_add(mode_bindings, binding); | 157 | list_add(mode_bindings, binding); |
158 | } | 158 | } |
159 | 159 | ||
160 | sway_log(L_DEBUG, "bindsym - Bound %s to command %s", | 160 | wlr_log(L_DEBUG, "bindsym - Bound %s to command %s", |
161 | argv[0], binding->command); | 161 | argv[0], binding->command); |
162 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 162 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
163 | } | 163 | } |
@@ -227,7 +227,7 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) { | |||
227 | for (int i = 0; i < mode_bindings->length; ++i) { | 227 | for (int i = 0; i < mode_bindings->length; ++i) { |
228 | struct sway_binding *config_binding = mode_bindings->items[i]; | 228 | struct sway_binding *config_binding = mode_bindings->items[i]; |
229 | if (binding_key_compare(binding, config_binding)) { | 229 | if (binding_key_compare(binding, config_binding)) { |
230 | sway_log(L_DEBUG, "overwriting old binding with command '%s'", | 230 | wlr_log(L_DEBUG, "overwriting old binding with command '%s'", |
231 | config_binding->command); | 231 | config_binding->command); |
232 | free_sway_binding(config_binding); | 232 | free_sway_binding(config_binding); |
233 | mode_bindings->items[i] = binding; | 233 | mode_bindings->items[i] = binding; |
@@ -239,7 +239,7 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) { | |||
239 | list_add(mode_bindings, binding); | 239 | list_add(mode_bindings, binding); |
240 | } | 240 | } |
241 | 241 | ||
242 | sway_log(L_DEBUG, "bindcode - Bound %s to command %s", | 242 | wlr_log(L_DEBUG, "bindcode - Bound %s to command %s", |
243 | argv[0], binding->command); | 243 | argv[0], binding->command); |
244 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 244 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
245 | } | 245 | } |
diff --git a/sway/commands/exec.c b/sway/commands/exec.c index fbbc4941..363d5bef 100644 --- a/sway/commands/exec.c +++ b/sway/commands/exec.c | |||
@@ -8,7 +8,7 @@ struct cmd_results *cmd_exec(int argc, char **argv) { | |||
8 | if (!config->active) return cmd_results_new(CMD_DEFER, "exec", NULL); | 8 | if (!config->active) return cmd_results_new(CMD_DEFER, "exec", NULL); |
9 | if (config->reloading) { | 9 | if (config->reloading) { |
10 | char *args = join_args(argv, argc); | 10 | char *args = join_args(argv, argc); |
11 | sway_log(L_DEBUG, "Ignoring 'exec %s' due to reload", args); | 11 | wlr_log(L_DEBUG, "Ignoring 'exec %s' due to reload", args); |
12 | free(args); | 12 | free(args); |
13 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 13 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
14 | } | 14 | } |
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 9527a487..61870c51 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c | |||
@@ -20,7 +20,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
20 | 20 | ||
21 | char *tmp = NULL; | 21 | char *tmp = NULL; |
22 | if (strcmp((char*)*argv, "--no-startup-id") == 0) { | 22 | if (strcmp((char*)*argv, "--no-startup-id") == 0) { |
23 | sway_log(L_INFO, "exec switch '--no-startup-id' not supported, ignored."); | 23 | wlr_log(L_INFO, "exec switch '--no-startup-id' not supported, ignored."); |
24 | if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) { | 24 | if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) { |
25 | return error; | 25 | return error; |
26 | } | 26 | } |
@@ -35,11 +35,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
35 | strncpy(cmd, tmp, sizeof(cmd)); | 35 | strncpy(cmd, tmp, sizeof(cmd)); |
36 | cmd[sizeof(cmd) - 1] = 0; | 36 | cmd[sizeof(cmd) - 1] = 0; |
37 | free(tmp); | 37 | free(tmp); |
38 | sway_log(L_DEBUG, "Executing %s", cmd); | 38 | wlr_log(L_DEBUG, "Executing %s", cmd); |
39 | 39 | ||
40 | int fd[2]; | 40 | int fd[2]; |
41 | if (pipe(fd) != 0) { | 41 | if (pipe(fd) != 0) { |
42 | sway_log(L_ERROR, "Unable to create pipe for fork"); | 42 | wlr_log(L_ERROR, "Unable to create pipe for fork"); |
43 | } | 43 | } |
44 | 44 | ||
45 | pid_t pid; | 45 | pid_t pid; |
@@ -75,7 +75,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
75 | // cleanup child process | 75 | // cleanup child process |
76 | wait(0); | 76 | wait(0); |
77 | if (*child > 0) { | 77 | if (*child > 0) { |
78 | sway_log(L_DEBUG, "Child process created with pid %d", *child); | 78 | wlr_log(L_DEBUG, "Child process created with pid %d", *child); |
79 | // TODO: add PID to active workspace | 79 | // TODO: add PID to active workspace |
80 | } else { | 80 | } else { |
81 | free(child); | 81 | free(child); |
diff --git a/sway/commands/input.c b/sway/commands/input.c index edf45e4c..5ea39f62 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c | |||
@@ -12,7 +12,7 @@ struct cmd_results *cmd_input(int argc, char **argv) { | |||
12 | 12 | ||
13 | if (config->reading && strcmp("{", argv[1]) == 0) { | 13 | if (config->reading && strcmp("{", argv[1]) == 0) { |
14 | current_input_config = new_input_config(argv[0]); | 14 | current_input_config = new_input_config(argv[0]); |
15 | sway_log(L_DEBUG, "entering input block: %s", current_input_config->identifier); | 15 | wlr_log(L_DEBUG, "entering input block: %s", current_input_config->identifier); |
16 | return cmd_results_new(CMD_BLOCK_INPUT, NULL, NULL); | 16 | return cmd_results_new(CMD_BLOCK_INPUT, NULL, NULL); |
17 | } | 17 | } |
18 | 18 | ||
diff --git a/sway/commands/input/click_method.c b/sway/commands/input/click_method.c index dcf64c1a..22eb15f7 100644 --- a/sway/commands/input/click_method.c +++ b/sway/commands/input/click_method.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "log.h" | 6 | #include "log.h" |
7 | 7 | ||
8 | struct cmd_results *input_cmd_click_method(int argc, char **argv) { | 8 | struct cmd_results *input_cmd_click_method(int argc, char **argv) { |
9 | sway_log(L_DEBUG, "click_method for device: %d %s", | 9 | wlr_log(L_DEBUG, "click_method for device: %d %s", |
10 | current_input_config==NULL, current_input_config->identifier); | 10 | current_input_config==NULL, current_input_config->identifier); |
11 | struct cmd_results *error = NULL; | 11 | struct cmd_results *error = NULL; |
12 | if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) { | 12 | if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) { |
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c index 8a74c11e..a1bfbacd 100644 --- a/sway/commands/input/events.c +++ b/sway/commands/input/events.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "log.h" | 6 | #include "log.h" |
7 | 7 | ||
8 | struct cmd_results *input_cmd_events(int argc, char **argv) { | 8 | struct cmd_results *input_cmd_events(int argc, char **argv) { |
9 | sway_log(L_DEBUG, "events for device: %s", | 9 | wlr_log(L_DEBUG, "events for device: %s", |
10 | current_input_config->identifier); | 10 | current_input_config->identifier); |
11 | struct cmd_results *error = NULL; | 11 | struct cmd_results *error = NULL; |
12 | if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) { | 12 | if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) { |
diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c index 8547c0cd..ecab9a5b 100644 --- a/sway/commands/input/tap.c +++ b/sway/commands/input/tap.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "log.h" | 6 | #include "log.h" |
7 | 7 | ||
8 | struct cmd_results *input_cmd_tap(int argc, char **argv) { | 8 | struct cmd_results *input_cmd_tap(int argc, char **argv) { |
9 | sway_log(L_DEBUG, "tap for device: %s", current_input_config->identifier); | 9 | wlr_log(L_DEBUG, "tap for device: %s", current_input_config->identifier); |
10 | struct cmd_results *error = NULL; | 10 | struct cmd_results *error = NULL; |
11 | if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) { | 11 | if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) { |
12 | return error; | 12 | return error; |
@@ -26,7 +26,7 @@ struct cmd_results *input_cmd_tap(int argc, char **argv) { | |||
26 | "Expected 'tap <enabled|disabled>'"); | 26 | "Expected 'tap <enabled|disabled>'"); |
27 | } | 27 | } |
28 | 28 | ||
29 | sway_log(L_DEBUG, "apply-tap for device: %s", | 29 | wlr_log(L_DEBUG, "apply-tap for device: %s", |
30 | current_input_config->identifier); | 30 | current_input_config->identifier); |
31 | apply_input_config(new_config); | 31 | apply_input_config(new_config); |
32 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 32 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c index a25d3850..25db1a33 100644 --- a/sway/commands/input/xkb_layout.c +++ b/sway/commands/input/xkb_layout.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "log.h" | 5 | #include "log.h" |
6 | 6 | ||
7 | struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) { | 7 | struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) { |
8 | sway_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier); | 8 | wlr_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier); |
9 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
10 | if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) { | 10 | if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) { |
11 | return error; | 11 | return error; |
@@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) { | |||
18 | 18 | ||
19 | new_config->xkb_layout = strdup(argv[0]); | 19 | new_config->xkb_layout = strdup(argv[0]); |
20 | 20 | ||
21 | sway_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s", | 21 | wlr_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s", |
22 | current_input_config->identifier, new_config->xkb_layout); | 22 | current_input_config->identifier, new_config->xkb_layout); |
23 | apply_input_config(new_config); | 23 | apply_input_config(new_config); |
24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c index 9729e869..819b796b 100644 --- a/sway/commands/input/xkb_model.c +++ b/sway/commands/input/xkb_model.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "log.h" | 5 | #include "log.h" |
6 | 6 | ||
7 | struct cmd_results *input_cmd_xkb_model(int argc, char **argv) { | 7 | struct cmd_results *input_cmd_xkb_model(int argc, char **argv) { |
8 | sway_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier); | 8 | wlr_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier); |
9 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
10 | if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) { | 10 | if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) { |
11 | return error; | 11 | return error; |
@@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) { | |||
18 | 18 | ||
19 | new_config->xkb_model = strdup(argv[0]); | 19 | new_config->xkb_model = strdup(argv[0]); |
20 | 20 | ||
21 | sway_log(L_DEBUG, "apply-xkb_model for device: %s model: %s", | 21 | wlr_log(L_DEBUG, "apply-xkb_model for device: %s model: %s", |
22 | current_input_config->identifier, new_config->xkb_model); | 22 | current_input_config->identifier, new_config->xkb_model); |
23 | apply_input_config(new_config); | 23 | apply_input_config(new_config); |
24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c index 504849cc..ff5f83ec 100644 --- a/sway/commands/input/xkb_options.c +++ b/sway/commands/input/xkb_options.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "log.h" | 5 | #include "log.h" |
6 | 6 | ||
7 | struct cmd_results *input_cmd_xkb_options(int argc, char **argv) { | 7 | struct cmd_results *input_cmd_xkb_options(int argc, char **argv) { |
8 | sway_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier); | 8 | wlr_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier); |
9 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
10 | if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) { | 10 | if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) { |
11 | return error; | 11 | return error; |
@@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) { | |||
18 | 18 | ||
19 | new_config->xkb_options = strdup(argv[0]); | 19 | new_config->xkb_options = strdup(argv[0]); |
20 | 20 | ||
21 | sway_log(L_DEBUG, "apply-xkb_options for device: %s options: %s", | 21 | wlr_log(L_DEBUG, "apply-xkb_options for device: %s options: %s", |
22 | current_input_config->identifier, new_config->xkb_options); | 22 | current_input_config->identifier, new_config->xkb_options); |
23 | apply_input_config(new_config); | 23 | apply_input_config(new_config); |
24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c index db7d8abe..aafe0003 100644 --- a/sway/commands/input/xkb_rules.c +++ b/sway/commands/input/xkb_rules.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "log.h" | 5 | #include "log.h" |
6 | 6 | ||
7 | struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) { | 7 | struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) { |
8 | sway_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier); | 8 | wlr_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier); |
9 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
10 | if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) { | 10 | if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) { |
11 | return error; | 11 | return error; |
@@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) { | |||
18 | 18 | ||
19 | new_config->xkb_rules = strdup(argv[0]); | 19 | new_config->xkb_rules = strdup(argv[0]); |
20 | 20 | ||
21 | sway_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s", | 21 | wlr_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s", |
22 | current_input_config->identifier, new_config->xkb_rules); | 22 | current_input_config->identifier, new_config->xkb_rules); |
23 | apply_input_config(new_config); | 23 | apply_input_config(new_config); |
24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c index 855e6abc..89a61fdc 100644 --- a/sway/commands/input/xkb_variant.c +++ b/sway/commands/input/xkb_variant.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "log.h" | 5 | #include "log.h" |
6 | 6 | ||
7 | struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) { | 7 | struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) { |
8 | sway_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier); | 8 | wlr_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier); |
9 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
10 | if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) { | 10 | if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) { |
11 | return error; | 11 | return error; |
@@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) { | |||
18 | 18 | ||
19 | new_config->xkb_variant = strdup(argv[0]); | 19 | new_config->xkb_variant = strdup(argv[0]); |
20 | 20 | ||
21 | sway_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s", | 21 | wlr_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s", |
22 | current_input_config->identifier, new_config->xkb_variant); | 22 | current_input_config->identifier, new_config->xkb_variant); |
23 | apply_input_config(new_config); | 23 | apply_input_config(new_config); |
24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/output.c b/sway/commands/output.c index 8c0fa63c..e747eb4e 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c | |||
@@ -203,12 +203,12 @@ static struct cmd_results *cmd_output_background(struct output_config *output, | |||
203 | if (src) { | 203 | if (src) { |
204 | sprintf(src, "%s/%s", conf_path, p.we_wordv[0]); | 204 | sprintf(src, "%s/%s", conf_path, p.we_wordv[0]); |
205 | } else { | 205 | } else { |
206 | sway_log(L_ERROR, | 206 | wlr_log(L_ERROR, |
207 | "Unable to allocate background source"); | 207 | "Unable to allocate background source"); |
208 | } | 208 | } |
209 | free(conf); | 209 | free(conf); |
210 | } else { | 210 | } else { |
211 | sway_log(L_ERROR, "Unable to allocate background source"); | 211 | wlr_log(L_ERROR, "Unable to allocate background source"); |
212 | } | 212 | } |
213 | } | 213 | } |
214 | if (!src || access(src, F_OK) == -1) { | 214 | if (!src || access(src, F_OK) == -1) { |
@@ -238,7 +238,7 @@ struct cmd_results *cmd_output(int argc, char **argv) { | |||
238 | 238 | ||
239 | struct output_config *output = new_output_config(argv[0]); | 239 | struct output_config *output = new_output_config(argv[0]); |
240 | if (!output) { | 240 | if (!output) { |
241 | sway_log(L_ERROR, "Failed to allocate output config"); | 241 | wlr_log(L_ERROR, "Failed to allocate output config"); |
242 | return NULL; | 242 | return NULL; |
243 | } | 243 | } |
244 | 244 | ||
@@ -284,7 +284,7 @@ struct cmd_results *cmd_output(int argc, char **argv) { | |||
284 | list_add(config->output_configs, output); | 284 | list_add(config->output_configs, output); |
285 | } | 285 | } |
286 | 286 | ||
287 | sway_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " | 287 | wlr_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " |
288 | "position %d,%d scale %f transform %d) (bg %s %s)", | 288 | "position %d,%d scale %f transform %d) (bg %s %s)", |
289 | output->name, output->enabled, output->width, output->height, | 289 | output->name, output->enabled, output->width, output->height, |
290 | output->refresh_rate, output->x, output->y, output->scale, | 290 | output->refresh_rate, output->x, output->y, output->scale, |
diff --git a/sway/commands/seat.c b/sway/commands/seat.c index 155bc510..6284002b 100644 --- a/sway/commands/seat.c +++ b/sway/commands/seat.c | |||
@@ -12,7 +12,7 @@ struct cmd_results *cmd_seat(int argc, char **argv) { | |||
12 | 12 | ||
13 | if (config->reading && strcmp("{", argv[1]) == 0) { | 13 | if (config->reading && strcmp("{", argv[1]) == 0) { |
14 | current_seat_config = new_seat_config(argv[0]); | 14 | current_seat_config = new_seat_config(argv[0]); |
15 | sway_log(L_DEBUG, "entering seat block: %s", current_seat_config->name); | 15 | wlr_log(L_DEBUG, "entering seat block: %s", current_seat_config->name); |
16 | return cmd_results_new(CMD_BLOCK_SEAT, NULL, NULL); | 16 | return cmd_results_new(CMD_BLOCK_SEAT, NULL, NULL); |
17 | } | 17 | } |
18 | 18 | ||
diff --git a/sway/commands/set.c b/sway/commands/set.c index dcd928ba..856c73e7 100644 --- a/sway/commands/set.c +++ b/sway/commands/set.c | |||
@@ -33,7 +33,7 @@ struct cmd_results *cmd_set(int argc, char **argv) { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | if (argv[0][0] != '$') { | 35 | if (argv[0][0] != '$') { |
36 | sway_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]); | 36 | wlr_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]); |
37 | 37 | ||
38 | size_t size = snprintf(NULL, 0, "$%s", argv[0]); | 38 | size_t size = snprintf(NULL, 0, "$%s", argv[0]); |
39 | tmp = malloc(size + 1); | 39 | tmp = malloc(size + 1); |
diff --git a/sway/config.c b/sway/config.c index e0a93e19..5ec45b17 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -232,12 +232,12 @@ static char *get_config_path(void) { | |||
232 | char *home = getenv("HOME"); | 232 | char *home = getenv("HOME"); |
233 | char *config_home = malloc(strlen(home) + strlen("/.config") + 1); | 233 | char *config_home = malloc(strlen(home) + strlen("/.config") + 1); |
234 | if (!config_home) { | 234 | if (!config_home) { |
235 | sway_log(L_ERROR, "Unable to allocate $HOME/.config"); | 235 | wlr_log(L_ERROR, "Unable to allocate $HOME/.config"); |
236 | } else { | 236 | } else { |
237 | strcpy(config_home, home); | 237 | strcpy(config_home, home); |
238 | strcat(config_home, "/.config"); | 238 | strcat(config_home, "/.config"); |
239 | setenv("XDG_CONFIG_HOME", config_home, 1); | 239 | setenv("XDG_CONFIG_HOME", config_home, 1); |
240 | sway_log(L_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home); | 240 | wlr_log(L_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home); |
241 | free(config_home); | 241 | free(config_home); |
242 | } | 242 | } |
243 | } | 243 | } |
@@ -263,7 +263,7 @@ static char *get_config_path(void) { | |||
263 | const char *current_config_path; | 263 | const char *current_config_path; |
264 | 264 | ||
265 | static bool load_config(const char *path, struct sway_config *config) { | 265 | static bool load_config(const char *path, struct sway_config *config) { |
266 | sway_log(L_INFO, "Loading config from %s", path); | 266 | wlr_log(L_INFO, "Loading config from %s", path); |
267 | current_config_path = path; | 267 | current_config_path = path; |
268 | 268 | ||
269 | struct stat sb; | 269 | struct stat sb; |
@@ -272,13 +272,13 @@ static bool load_config(const char *path, struct sway_config *config) { | |||
272 | } | 272 | } |
273 | 273 | ||
274 | if (path == NULL) { | 274 | if (path == NULL) { |
275 | sway_log(L_ERROR, "Unable to find a config file!"); | 275 | wlr_log(L_ERROR, "Unable to find a config file!"); |
276 | return false; | 276 | return false; |
277 | } | 277 | } |
278 | 278 | ||
279 | FILE *f = fopen(path, "r"); | 279 | FILE *f = fopen(path, "r"); |
280 | if (!f) { | 280 | if (!f) { |
281 | sway_log(L_ERROR, "Unable to open %s for reading", path); | 281 | wlr_log(L_ERROR, "Unable to open %s for reading", path); |
282 | return false; | 282 | return false; |
283 | } | 283 | } |
284 | 284 | ||
@@ -286,7 +286,7 @@ static bool load_config(const char *path, struct sway_config *config) { | |||
286 | fclose(f); | 286 | fclose(f); |
287 | 287 | ||
288 | if (!config_load_success) { | 288 | if (!config_load_success) { |
289 | sway_log(L_ERROR, "Error(s) loading config!"); | 289 | wlr_log(L_ERROR, "Error(s) loading config!"); |
290 | } | 290 | } |
291 | 291 | ||
292 | current_config_path = NULL; | 292 | current_config_path = NULL; |
@@ -313,7 +313,7 @@ bool load_main_config(const char *file, bool is_active) { | |||
313 | 313 | ||
314 | config_defaults(config); | 314 | config_defaults(config); |
315 | if (is_active) { | 315 | if (is_active) { |
316 | sway_log(L_DEBUG, "Performing configuration file reload"); | 316 | wlr_log(L_DEBUG, "Performing configuration file reload"); |
317 | config->reloading = true; | 317 | config->reloading = true; |
318 | config->active = true; | 318 | config->active = true; |
319 | } | 319 | } |
@@ -327,7 +327,7 @@ bool load_main_config(const char *file, bool is_active) { | |||
327 | bool success = true; | 327 | bool success = true; |
328 | DIR *dir = opendir(SYSCONFDIR "/sway/security.d"); | 328 | DIR *dir = opendir(SYSCONFDIR "/sway/security.d"); |
329 | if (!dir) { | 329 | if (!dir) { |
330 | sway_log(L_ERROR, | 330 | wlr_log(L_ERROR, |
331 | "%s does not exist, sway will have no security configuration" | 331 | "%s does not exist, sway will have no security configuration" |
332 | " and will probably be broken", SYSCONFDIR "/sway/security.d"); | 332 | " and will probably be broken", SYSCONFDIR "/sway/security.d"); |
333 | } else { | 333 | } else { |
@@ -356,7 +356,7 @@ bool load_main_config(const char *file, bool is_active) { | |||
356 | if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || | 356 | if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || |
357 | (((s.st_mode & 0777) != 0644) && | 357 | (((s.st_mode & 0777) != 0644) && |
358 | (s.st_mode & 0777) != 0444)) { | 358 | (s.st_mode & 0777) != 0444)) { |
359 | sway_log(L_ERROR, | 359 | wlr_log(L_ERROR, |
360 | "Refusing to load %s - it must be owned by root " | 360 | "Refusing to load %s - it must be owned by root " |
361 | "and mode 644 or 444", _path); | 361 | "and mode 644 or 444", _path); |
362 | success = false; | 362 | success = false; |
@@ -398,7 +398,7 @@ static bool load_include_config(const char *path, const char *parent_dir, | |||
398 | len = len + strlen(parent_dir) + 2; | 398 | len = len + strlen(parent_dir) + 2; |
399 | full_path = malloc(len * sizeof(char)); | 399 | full_path = malloc(len * sizeof(char)); |
400 | if (!full_path) { | 400 | if (!full_path) { |
401 | sway_log(L_ERROR, | 401 | wlr_log(L_ERROR, |
402 | "Unable to allocate full path to included config"); | 402 | "Unable to allocate full path to included config"); |
403 | return false; | 403 | return false; |
404 | } | 404 | } |
@@ -409,7 +409,7 @@ static bool load_include_config(const char *path, const char *parent_dir, | |||
409 | free(full_path); | 409 | free(full_path); |
410 | 410 | ||
411 | if (real_path == NULL) { | 411 | if (real_path == NULL) { |
412 | sway_log(L_DEBUG, "%s not found.", path); | 412 | wlr_log(L_DEBUG, "%s not found.", path); |
413 | return false; | 413 | return false; |
414 | } | 414 | } |
415 | 415 | ||
@@ -418,7 +418,7 @@ static bool load_include_config(const char *path, const char *parent_dir, | |||
418 | for (j = 0; j < config->config_chain->length; ++j) { | 418 | for (j = 0; j < config->config_chain->length; ++j) { |
419 | char *old_path = config->config_chain->items[j]; | 419 | char *old_path = config->config_chain->items[j]; |
420 | if (strcmp(real_path, old_path) == 0) { | 420 | if (strcmp(real_path, old_path) == 0) { |
421 | sway_log(L_DEBUG, | 421 | wlr_log(L_DEBUG, |
422 | "%s already included once, won't be included again.", | 422 | "%s already included once, won't be included again.", |
423 | real_path); | 423 | real_path); |
424 | free(real_path); | 424 | free(real_path); |
@@ -472,7 +472,7 @@ bool load_include_configs(const char *path, struct sway_config *config) { | |||
472 | // restore wd | 472 | // restore wd |
473 | if (chdir(wd) < 0) { | 473 | if (chdir(wd) < 0) { |
474 | free(wd); | 474 | free(wd); |
475 | sway_log(L_ERROR, "failed to restore working directory"); | 475 | wlr_log(L_ERROR, "failed to restore working directory"); |
476 | return false; | 476 | return false; |
477 | } | 477 | } |
478 | 478 | ||
@@ -508,13 +508,13 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
508 | switch(res->status) { | 508 | switch(res->status) { |
509 | case CMD_FAILURE: | 509 | case CMD_FAILURE: |
510 | case CMD_INVALID: | 510 | case CMD_INVALID: |
511 | sway_log(L_ERROR, "Error on line %i '%s': %s (%s)", line_number, | 511 | wlr_log(L_ERROR, "Error on line %i '%s': %s (%s)", line_number, |
512 | line, res->error, config->current_config); | 512 | line, res->error, config->current_config); |
513 | success = false; | 513 | success = false; |
514 | break; | 514 | break; |
515 | 515 | ||
516 | case CMD_DEFER: | 516 | case CMD_DEFER: |
517 | sway_log(L_DEBUG, "Deferring command `%s'", line); | 517 | wlr_log(L_DEBUG, "Deferring command `%s'", line); |
518 | list_add(config->cmd_queue, strdup(line)); | 518 | list_add(config->cmd_queue, strdup(line)); |
519 | break; | 519 | break; |
520 | 520 | ||
@@ -522,7 +522,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
522 | if (block == CMD_BLOCK_END) { | 522 | if (block == CMD_BLOCK_END) { |
523 | block = CMD_BLOCK_MODE; | 523 | block = CMD_BLOCK_MODE; |
524 | } else { | 524 | } else { |
525 | sway_log(L_ERROR, "Invalid block '%s'", line); | 525 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
526 | } | 526 | } |
527 | break; | 527 | break; |
528 | 528 | ||
@@ -530,7 +530,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
530 | if (block == CMD_BLOCK_END) { | 530 | if (block == CMD_BLOCK_END) { |
531 | block = CMD_BLOCK_INPUT; | 531 | block = CMD_BLOCK_INPUT; |
532 | } else { | 532 | } else { |
533 | sway_log(L_ERROR, "Invalid block '%s'", line); | 533 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
534 | } | 534 | } |
535 | break; | 535 | break; |
536 | 536 | ||
@@ -538,7 +538,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
538 | if (block == CMD_BLOCK_END) { | 538 | if (block == CMD_BLOCK_END) { |
539 | block = CMD_BLOCK_SEAT; | 539 | block = CMD_BLOCK_SEAT; |
540 | } else { | 540 | } else { |
541 | sway_log(L_ERROR, "Invalid block '%s'", line); | 541 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
542 | } | 542 | } |
543 | break; | 543 | break; |
544 | 544 | ||
@@ -546,7 +546,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
546 | if (block == CMD_BLOCK_END) { | 546 | if (block == CMD_BLOCK_END) { |
547 | block = CMD_BLOCK_BAR; | 547 | block = CMD_BLOCK_BAR; |
548 | } else { | 548 | } else { |
549 | sway_log(L_ERROR, "Invalid block '%s'", line); | 549 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
550 | } | 550 | } |
551 | break; | 551 | break; |
552 | 552 | ||
@@ -554,7 +554,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
554 | if (block == CMD_BLOCK_BAR) { | 554 | if (block == CMD_BLOCK_BAR) { |
555 | block = CMD_BLOCK_BAR_COLORS; | 555 | block = CMD_BLOCK_BAR_COLORS; |
556 | } else { | 556 | } else { |
557 | sway_log(L_ERROR, "Invalid block '%s'", line); | 557 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
558 | } | 558 | } |
559 | break; | 559 | break; |
560 | 560 | ||
@@ -562,7 +562,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
562 | if (block == CMD_BLOCK_END) { | 562 | if (block == CMD_BLOCK_END) { |
563 | block = CMD_BLOCK_COMMANDS; | 563 | block = CMD_BLOCK_COMMANDS; |
564 | } else { | 564 | } else { |
565 | sway_log(L_ERROR, "Invalid block '%s'", line); | 565 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
566 | } | 566 | } |
567 | break; | 567 | break; |
568 | 568 | ||
@@ -570,7 +570,7 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
570 | if (block == CMD_BLOCK_END) { | 570 | if (block == CMD_BLOCK_END) { |
571 | block = CMD_BLOCK_IPC; | 571 | block = CMD_BLOCK_IPC; |
572 | } else { | 572 | } else { |
573 | sway_log(L_ERROR, "Invalid block '%s'", line); | 573 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
574 | } | 574 | } |
575 | break; | 575 | break; |
576 | 576 | ||
@@ -578,59 +578,59 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
578 | if (block == CMD_BLOCK_IPC) { | 578 | if (block == CMD_BLOCK_IPC) { |
579 | block = CMD_BLOCK_IPC_EVENTS; | 579 | block = CMD_BLOCK_IPC_EVENTS; |
580 | } else { | 580 | } else { |
581 | sway_log(L_ERROR, "Invalid block '%s'", line); | 581 | wlr_log(L_ERROR, "Invalid block '%s'", line); |
582 | } | 582 | } |
583 | break; | 583 | break; |
584 | 584 | ||
585 | case CMD_BLOCK_END: | 585 | case CMD_BLOCK_END: |
586 | switch(block) { | 586 | switch(block) { |
587 | case CMD_BLOCK_MODE: | 587 | case CMD_BLOCK_MODE: |
588 | sway_log(L_DEBUG, "End of mode block"); | 588 | wlr_log(L_DEBUG, "End of mode block"); |
589 | config->current_mode = config->modes->items[0]; | 589 | config->current_mode = config->modes->items[0]; |
590 | block = CMD_BLOCK_END; | 590 | block = CMD_BLOCK_END; |
591 | break; | 591 | break; |
592 | 592 | ||
593 | case CMD_BLOCK_INPUT: | 593 | case CMD_BLOCK_INPUT: |
594 | sway_log(L_DEBUG, "End of input block"); | 594 | wlr_log(L_DEBUG, "End of input block"); |
595 | free_input_config(current_input_config); | 595 | free_input_config(current_input_config); |
596 | current_input_config = NULL; | 596 | current_input_config = NULL; |
597 | block = CMD_BLOCK_END; | 597 | block = CMD_BLOCK_END; |
598 | break; | 598 | break; |
599 | 599 | ||
600 | case CMD_BLOCK_SEAT: | 600 | case CMD_BLOCK_SEAT: |
601 | sway_log(L_DEBUG, "End of seat block"); | 601 | wlr_log(L_DEBUG, "End of seat block"); |
602 | current_seat_config = NULL; | 602 | current_seat_config = NULL; |
603 | block = CMD_BLOCK_END; | 603 | block = CMD_BLOCK_END; |
604 | break; | 604 | break; |
605 | 605 | ||
606 | case CMD_BLOCK_BAR: | 606 | case CMD_BLOCK_BAR: |
607 | sway_log(L_DEBUG, "End of bar block"); | 607 | wlr_log(L_DEBUG, "End of bar block"); |
608 | config->current_bar = NULL; | 608 | config->current_bar = NULL; |
609 | block = CMD_BLOCK_END; | 609 | block = CMD_BLOCK_END; |
610 | break; | 610 | break; |
611 | 611 | ||
612 | case CMD_BLOCK_BAR_COLORS: | 612 | case CMD_BLOCK_BAR_COLORS: |
613 | sway_log(L_DEBUG, "End of bar colors block"); | 613 | wlr_log(L_DEBUG, "End of bar colors block"); |
614 | block = CMD_BLOCK_BAR; | 614 | block = CMD_BLOCK_BAR; |
615 | break; | 615 | break; |
616 | 616 | ||
617 | case CMD_BLOCK_COMMANDS: | 617 | case CMD_BLOCK_COMMANDS: |
618 | sway_log(L_DEBUG, "End of commands block"); | 618 | wlr_log(L_DEBUG, "End of commands block"); |
619 | block = CMD_BLOCK_END; | 619 | block = CMD_BLOCK_END; |
620 | break; | 620 | break; |
621 | 621 | ||
622 | case CMD_BLOCK_IPC: | 622 | case CMD_BLOCK_IPC: |
623 | sway_log(L_DEBUG, "End of IPC block"); | 623 | wlr_log(L_DEBUG, "End of IPC block"); |
624 | block = CMD_BLOCK_END; | 624 | block = CMD_BLOCK_END; |
625 | break; | 625 | break; |
626 | 626 | ||
627 | case CMD_BLOCK_IPC_EVENTS: | 627 | case CMD_BLOCK_IPC_EVENTS: |
628 | sway_log(L_DEBUG, "End of IPC events block"); | 628 | wlr_log(L_DEBUG, "End of IPC events block"); |
629 | block = CMD_BLOCK_IPC; | 629 | block = CMD_BLOCK_IPC; |
630 | break; | 630 | break; |
631 | 631 | ||
632 | case CMD_BLOCK_END: | 632 | case CMD_BLOCK_END: |
633 | sway_log(L_ERROR, "Unmatched }"); | 633 | wlr_log(L_ERROR, "Unmatched }"); |
634 | break; | 634 | break; |
635 | 635 | ||
636 | default:; | 636 | default:; |
@@ -663,7 +663,7 @@ char *do_var_replacement(char *str) { | |||
663 | int vvlen = strlen(var->value); | 663 | int vvlen = strlen(var->value); |
664 | char *newstr = malloc(strlen(str) - vnlen + vvlen + 1); | 664 | char *newstr = malloc(strlen(str) - vnlen + vvlen + 1); |
665 | if (!newstr) { | 665 | if (!newstr) { |
666 | sway_log(L_ERROR, | 666 | wlr_log(L_ERROR, |
667 | "Unable to allocate replacement " | 667 | "Unable to allocate replacement " |
668 | "during variable expansion"); | 668 | "during variable expansion"); |
669 | break; | 669 | break; |
diff --git a/sway/config/input.c b/sway/config/input.c index 6f8d31f7..96181302 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 | sway_log(L_DEBUG, "Unable to allocate input config"); | 11 | wlr_log(L_DEBUG, "Unable to allocate input config"); |
12 | return NULL; | 12 | return NULL; |
13 | } | 13 | } |
14 | sway_log(L_DEBUG, "new_input_config(%s)", identifier); | 14 | wlr_log(L_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 | sway_log(L_DEBUG, "Unable to allocate input config"); | 17 | wlr_log(L_DEBUG, "Unable to allocate input config"); |
18 | return NULL; | 18 | return NULL; |
19 | } | 19 | } |
20 | 20 | ||
diff --git a/sway/config/output.c b/sway/config/output.c index e798a20e..69e883f1 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -84,7 +84,7 @@ static void set_mode(struct wlr_output *output, int width, int height, | |||
84 | float refresh_rate) { | 84 | float refresh_rate) { |
85 | int mhz = (int)(refresh_rate * 1000); | 85 | int mhz = (int)(refresh_rate * 1000); |
86 | if (wl_list_empty(&output->modes)) { | 86 | if (wl_list_empty(&output->modes)) { |
87 | sway_log(L_DEBUG, "Assigning custom mode to %s", output->name); | 87 | wlr_log(L_DEBUG, "Assigning custom mode to %s", output->name); |
88 | wlr_output_set_custom_mode(output, width, height, mhz); | 88 | wlr_output_set_custom_mode(output, width, height, mhz); |
89 | return; | 89 | return; |
90 | } | 90 | } |
@@ -100,9 +100,9 @@ static void set_mode(struct wlr_output *output, int width, int height, | |||
100 | } | 100 | } |
101 | } | 101 | } |
102 | if (!best) { | 102 | if (!best) { |
103 | sway_log(L_ERROR, "Configured mode for %s not available", output->name); | 103 | wlr_log(L_ERROR, "Configured mode for %s not available", output->name); |
104 | } else { | 104 | } else { |
105 | sway_log(L_DEBUG, "Assigning configured mode to %s", output->name); | 105 | wlr_log(L_DEBUG, "Assigning configured mode to %s", output->name); |
106 | wlr_output_set_mode(output, best); | 106 | wlr_output_set_mode(output, best); |
107 | } | 107 | } |
108 | } | 108 | } |
@@ -119,22 +119,22 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
119 | } | 119 | } |
120 | 120 | ||
121 | if (oc && oc->width > 0 && oc->height > 0) { | 121 | if (oc && oc->width > 0 && oc->height > 0) { |
122 | sway_log(L_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, | 122 | wlr_log(L_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, |
123 | oc->height, oc->refresh_rate); | 123 | oc->height, oc->refresh_rate); |
124 | set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); | 124 | set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); |
125 | } | 125 | } |
126 | if (oc && oc->scale > 0) { | 126 | if (oc && oc->scale > 0) { |
127 | sway_log(L_DEBUG, "Set %s scale to %f", oc->name, oc->scale); | 127 | wlr_log(L_DEBUG, "Set %s scale to %f", oc->name, oc->scale); |
128 | wlr_output_set_scale(wlr_output, oc->scale); | 128 | wlr_output_set_scale(wlr_output, oc->scale); |
129 | } | 129 | } |
130 | if (oc && oc->transform >= 0) { | 130 | if (oc && oc->transform >= 0) { |
131 | sway_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform); | 131 | wlr_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform); |
132 | wlr_output_set_transform(wlr_output, oc->transform); | 132 | wlr_output_set_transform(wlr_output, oc->transform); |
133 | } | 133 | } |
134 | 134 | ||
135 | // Find position for it | 135 | // Find position for it |
136 | if (oc && (oc->x != -1 || oc->y != -1)) { | 136 | if (oc && (oc->x != -1 || oc->y != -1)) { |
137 | sway_log(L_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); | 137 | wlr_log(L_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); |
138 | wlr_output_layout_add(root_container.sway_root->output_layout, | 138 | wlr_output_layout_add(root_container.sway_root->output_layout, |
139 | wlr_output, oc->x, oc->y); | 139 | wlr_output, oc->x, oc->y); |
140 | } else { | 140 | } else { |
@@ -165,7 +165,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
165 | terminate_swaybg(output->bg_pid); | 165 | terminate_swaybg(output->bg_pid); |
166 | } | 166 | } |
167 | 167 | ||
168 | sway_log(L_DEBUG, "Setting background for output %d to %s", output_i, oc->background); | 168 | wlr_log(L_DEBUG, "Setting background for output %d to %s", output_i, oc->background); |
169 | 169 | ||
170 | size_t bufsize = 12; | 170 | size_t bufsize = 12; |
171 | char output_id[bufsize]; | 171 | char output_id[bufsize]; |
diff --git a/sway/config/seat.c b/sway/config/seat.c index 113139e8..03cc6d4e 100644 --- a/sway/config/seat.c +++ b/sway/config/seat.c | |||
@@ -7,11 +7,11 @@ | |||
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 | sway_log(L_DEBUG, "Unable to allocate seat config"); | 10 | wlr_log(L_DEBUG, "Unable to allocate seat config"); |
11 | return NULL; | 11 | return NULL; |
12 | } | 12 | } |
13 | 13 | ||
14 | sway_log(L_DEBUG, "new_seat_config(%s)", name); | 14 | wlr_log(L_DEBUG, "new_seat_config(%s)", name); |
15 | seat->name = strdup(name); | 15 | seat->name = strdup(name); |
16 | if (!sway_assert(seat->name, "could not allocate name for seat")) { | 16 | if (!sway_assert(seat->name, "could not allocate name for seat")) { |
17 | free(seat); | 17 | free(seat); |
@@ -34,7 +34,7 @@ struct seat_attachment_config *seat_attachment_config_new() { | |||
34 | struct seat_attachment_config *attachment = | 34 | struct seat_attachment_config *attachment = |
35 | calloc(1, sizeof(struct seat_attachment_config)); | 35 | calloc(1, sizeof(struct seat_attachment_config)); |
36 | if (!attachment) { | 36 | if (!attachment) { |
37 | sway_log(L_DEBUG, "cannot allocate attachment config"); | 37 | wlr_log(L_DEBUG, "cannot allocate attachment config"); |
38 | return NULL; | 38 | return NULL; |
39 | } | 39 | } |
40 | return attachment; | 40 | return attachment; |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 3b87c2e7..2b428c30 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -110,7 +110,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) { | |||
110 | void output_add_notify(struct wl_listener *listener, void *data) { | 110 | void output_add_notify(struct wl_listener *listener, void *data) { |
111 | struct sway_server *server = wl_container_of(listener, server, output_add); | 111 | struct sway_server *server = wl_container_of(listener, server, output_add); |
112 | struct wlr_output *wlr_output = data; | 112 | struct wlr_output *wlr_output = data; |
113 | sway_log(L_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); | 113 | wlr_log(L_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); |
114 | 114 | ||
115 | struct sway_output *output = calloc(1, sizeof(struct sway_output)); | 115 | struct sway_output *output = calloc(1, sizeof(struct sway_output)); |
116 | if (!output) { | 116 | if (!output) { |
@@ -140,7 +140,7 @@ void output_add_notify(struct wl_listener *listener, void *data) { | |||
140 | void output_remove_notify(struct wl_listener *listener, void *data) { | 140 | void output_remove_notify(struct wl_listener *listener, void *data) { |
141 | struct sway_server *server = wl_container_of(listener, server, output_remove); | 141 | struct sway_server *server = wl_container_of(listener, server, output_remove); |
142 | struct wlr_output *wlr_output = data; | 142 | struct wlr_output *wlr_output = data; |
143 | sway_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); | 143 | wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); |
144 | 144 | ||
145 | swayc_t *output_container = NULL; | 145 | swayc_t *output_container = NULL; |
146 | for (int i = 0 ; i < root_container.children->length; ++i) { | 146 | for (int i = 0 ; i < root_container.children->length; ++i) { |
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c index a7bb8eb5..345a1398 100644 --- a/sway/desktop/wl_shell.c +++ b/sway/desktop/wl_shell.c | |||
@@ -82,7 +82,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) { | |||
82 | return; | 82 | return; |
83 | } | 83 | } |
84 | 84 | ||
85 | sway_log(L_DEBUG, "New wl_shell toplevel title='%s' app_id='%s'", | 85 | wlr_log(L_DEBUG, "New wl_shell toplevel title='%s' app_id='%s'", |
86 | shell_surface->title, shell_surface->class); | 86 | shell_surface->title, shell_surface->class); |
87 | wlr_wl_shell_surface_ping(shell_surface); | 87 | wlr_wl_shell_surface_ping(shell_surface); |
88 | 88 | ||
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 5ff19f7e..df48345c 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -88,7 +88,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { | |||
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | 90 | ||
91 | sway_log(L_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'", | 91 | wlr_log(L_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'", |
92 | xdg_surface->title, xdg_surface->app_id); | 92 | xdg_surface->title, xdg_surface->app_id); |
93 | wlr_xdg_surface_v6_ping(xdg_surface); | 93 | wlr_xdg_surface_v6_ping(xdg_surface); |
94 | 94 | ||
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 42e82c64..43bb2e00 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -124,7 +124,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
124 | return; | 124 | return; |
125 | } | 125 | } |
126 | 126 | ||
127 | sway_log(L_DEBUG, "New xwayland surface title='%s' class='%s'", | 127 | wlr_log(L_DEBUG, "New xwayland surface title='%s' class='%s'", |
128 | xsurface->title, xsurface->class); | 128 | xsurface->title, xsurface->class); |
129 | 129 | ||
130 | struct sway_xwayland_surface *sway_surface = | 130 | struct sway_xwayland_surface *sway_surface = |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 3b5cfce5..c51b59f9 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -85,35 +85,35 @@ static void handle_touch_down(struct wl_listener *listener, void *data) { | |||
85 | struct sway_cursor *cursor = | 85 | struct sway_cursor *cursor = |
86 | wl_container_of(listener, cursor, touch_down); | 86 | wl_container_of(listener, cursor, touch_down); |
87 | struct wlr_event_touch_down *event = data; | 87 | struct wlr_event_touch_down *event = data; |
88 | sway_log(L_DEBUG, "TODO: handle touch down event: %p", event); | 88 | wlr_log(L_DEBUG, "TODO: handle touch down event: %p", event); |
89 | } | 89 | } |
90 | 90 | ||
91 | static void handle_touch_up(struct wl_listener *listener, void *data) { | 91 | static void handle_touch_up(struct wl_listener *listener, void *data) { |
92 | struct sway_cursor *cursor = | 92 | struct sway_cursor *cursor = |
93 | wl_container_of(listener, cursor, touch_up); | 93 | wl_container_of(listener, cursor, touch_up); |
94 | struct wlr_event_touch_up *event = data; | 94 | struct wlr_event_touch_up *event = data; |
95 | sway_log(L_DEBUG, "TODO: handle touch up event: %p", event); | 95 | wlr_log(L_DEBUG, "TODO: handle touch up event: %p", event); |
96 | } | 96 | } |
97 | 97 | ||
98 | static void handle_touch_motion(struct wl_listener *listener, void *data) { | 98 | static void handle_touch_motion(struct wl_listener *listener, void *data) { |
99 | struct sway_cursor *cursor = | 99 | struct sway_cursor *cursor = |
100 | wl_container_of(listener, cursor, touch_motion); | 100 | wl_container_of(listener, cursor, touch_motion); |
101 | struct wlr_event_touch_motion *event = data; | 101 | struct wlr_event_touch_motion *event = data; |
102 | sway_log(L_DEBUG, "TODO: handle touch motion event: %p", event); | 102 | wlr_log(L_DEBUG, "TODO: handle touch motion event: %p", event); |
103 | } | 103 | } |
104 | 104 | ||
105 | static void handle_tool_axis(struct wl_listener *listener, void *data) { | 105 | static void handle_tool_axis(struct wl_listener *listener, void *data) { |
106 | struct sway_cursor *cursor = | 106 | struct sway_cursor *cursor = |
107 | wl_container_of(listener, cursor, tool_axis); | 107 | wl_container_of(listener, cursor, tool_axis); |
108 | struct wlr_event_tablet_tool_axis *event = data; | 108 | struct wlr_event_tablet_tool_axis *event = data; |
109 | sway_log(L_DEBUG, "TODO: handle tool axis event: %p", event); | 109 | wlr_log(L_DEBUG, "TODO: handle tool axis event: %p", event); |
110 | } | 110 | } |
111 | 111 | ||
112 | static void handle_tool_tip(struct wl_listener *listener, void *data) { | 112 | static void handle_tool_tip(struct wl_listener *listener, void *data) { |
113 | struct sway_cursor *cursor = | 113 | struct sway_cursor *cursor = |
114 | wl_container_of(listener, cursor, tool_tip); | 114 | wl_container_of(listener, cursor, tool_tip); |
115 | struct wlr_event_tablet_tool_tip *event = data; | 115 | struct wlr_event_tablet_tool_tip *event = data; |
116 | sway_log(L_DEBUG, "TODO: handle tool tip event: %p", event); | 116 | wlr_log(L_DEBUG, "TODO: handle tool tip event: %p", event); |
117 | } | 117 | } |
118 | 118 | ||
119 | static void handle_request_set_cursor(struct wl_listener *listener, | 119 | static void handle_request_set_cursor(struct wl_listener *listener, |
@@ -121,7 +121,7 @@ static void handle_request_set_cursor(struct wl_listener *listener, | |||
121 | struct sway_cursor *cursor = | 121 | struct sway_cursor *cursor = |
122 | wl_container_of(listener, cursor, request_set_cursor); | 122 | wl_container_of(listener, cursor, request_set_cursor); |
123 | struct wlr_seat_pointer_request_set_cursor_event *event = data; | 123 | struct wlr_seat_pointer_request_set_cursor_event *event = data; |
124 | sway_log(L_DEBUG, "TODO: handle request set cursor event: %p", event); | 124 | wlr_log(L_DEBUG, "TODO: handle request set cursor event: %p", event); |
125 | } | 125 | } |
126 | 126 | ||
127 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { | 127 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { |
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 128a818a..26cf5035 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -52,7 +52,7 @@ static char *get_device_identifier(struct wlr_input_device *device) { | |||
52 | int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; | 52 | int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; |
53 | char *identifier = malloc(len); | 53 | char *identifier = malloc(len); |
54 | if (!identifier) { | 54 | if (!identifier) { |
55 | sway_log(L_ERROR, "Unable to allocate unique input device name"); | 55 | wlr_log(L_ERROR, "Unable to allocate unique input device name"); |
56 | return NULL; | 56 | return NULL; |
57 | } | 57 | } |
58 | 58 | ||
@@ -93,60 +93,60 @@ static void sway_input_manager_libinput_config_pointer(struct sway_input_device | |||
93 | } | 93 | } |
94 | 94 | ||
95 | libinput_device = wlr_libinput_get_device_handle(wlr_device); | 95 | libinput_device = wlr_libinput_get_device_handle(wlr_device); |
96 | sway_log(L_DEBUG, "sway_input_manager_libinput_config_pointer(%s)", ic->identifier); | 96 | wlr_log(L_DEBUG, "sway_input_manager_libinput_config_pointer(%s)", ic->identifier); |
97 | 97 | ||
98 | if (ic->accel_profile != INT_MIN) { | 98 | if (ic->accel_profile != INT_MIN) { |
99 | sway_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", | 99 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", |
100 | ic->identifier, ic->accel_profile); | 100 | ic->identifier, ic->accel_profile); |
101 | libinput_device_config_accel_set_profile(libinput_device, ic->accel_profile); | 101 | libinput_device_config_accel_set_profile(libinput_device, ic->accel_profile); |
102 | } | 102 | } |
103 | if (ic->click_method != INT_MIN) { | 103 | if (ic->click_method != INT_MIN) { |
104 | sway_log(L_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", | 104 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", |
105 | ic->identifier, ic->click_method); | 105 | ic->identifier, ic->click_method); |
106 | libinput_device_config_click_set_method(libinput_device, ic->click_method); | 106 | libinput_device_config_click_set_method(libinput_device, ic->click_method); |
107 | } | 107 | } |
108 | if (ic->drag_lock != INT_MIN) { | 108 | if (ic->drag_lock != INT_MIN) { |
109 | sway_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", | 109 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", |
110 | ic->identifier, ic->click_method); | 110 | ic->identifier, ic->click_method); |
111 | libinput_device_config_tap_set_drag_lock_enabled(libinput_device, ic->drag_lock); | 111 | libinput_device_config_tap_set_drag_lock_enabled(libinput_device, ic->drag_lock); |
112 | } | 112 | } |
113 | if (ic->dwt != INT_MIN) { | 113 | if (ic->dwt != INT_MIN) { |
114 | sway_log(L_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", | 114 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", |
115 | ic->identifier, ic->dwt); | 115 | ic->identifier, ic->dwt); |
116 | libinput_device_config_dwt_set_enabled(libinput_device, ic->dwt); | 116 | libinput_device_config_dwt_set_enabled(libinput_device, ic->dwt); |
117 | } | 117 | } |
118 | if (ic->left_handed != INT_MIN) { | 118 | if (ic->left_handed != INT_MIN) { |
119 | sway_log(L_DEBUG, "libinput_config_pointer(%s) left_handed_set_enabled(%d)", | 119 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) left_handed_set_enabled(%d)", |
120 | ic->identifier, ic->left_handed); | 120 | ic->identifier, ic->left_handed); |
121 | libinput_device_config_left_handed_set(libinput_device, ic->left_handed); | 121 | libinput_device_config_left_handed_set(libinput_device, ic->left_handed); |
122 | } | 122 | } |
123 | if (ic->middle_emulation != INT_MIN) { | 123 | if (ic->middle_emulation != INT_MIN) { |
124 | sway_log(L_DEBUG, "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", | 124 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", |
125 | ic->identifier, ic->middle_emulation); | 125 | ic->identifier, ic->middle_emulation); |
126 | libinput_device_config_middle_emulation_set_enabled(libinput_device, ic->middle_emulation); | 126 | libinput_device_config_middle_emulation_set_enabled(libinput_device, ic->middle_emulation); |
127 | } | 127 | } |
128 | if (ic->natural_scroll != INT_MIN) { | 128 | if (ic->natural_scroll != INT_MIN) { |
129 | sway_log(L_DEBUG, "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", | 129 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", |
130 | ic->identifier, ic->natural_scroll); | 130 | ic->identifier, ic->natural_scroll); |
131 | libinput_device_config_scroll_set_natural_scroll_enabled(libinput_device, ic->natural_scroll); | 131 | libinput_device_config_scroll_set_natural_scroll_enabled(libinput_device, ic->natural_scroll); |
132 | } | 132 | } |
133 | if (ic->pointer_accel != FLT_MIN) { | 133 | if (ic->pointer_accel != FLT_MIN) { |
134 | sway_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", | 134 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", |
135 | ic->identifier, ic->pointer_accel); | 135 | ic->identifier, ic->pointer_accel); |
136 | libinput_device_config_accel_set_speed(libinput_device, ic->pointer_accel); | 136 | libinput_device_config_accel_set_speed(libinput_device, ic->pointer_accel); |
137 | } | 137 | } |
138 | if (ic->scroll_method != INT_MIN) { | 138 | if (ic->scroll_method != INT_MIN) { |
139 | sway_log(L_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", | 139 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", |
140 | ic->identifier, ic->scroll_method); | 140 | ic->identifier, ic->scroll_method); |
141 | libinput_device_config_scroll_set_method(libinput_device, ic->scroll_method); | 141 | libinput_device_config_scroll_set_method(libinput_device, ic->scroll_method); |
142 | } | 142 | } |
143 | if (ic->send_events != INT_MIN) { | 143 | if (ic->send_events != INT_MIN) { |
144 | sway_log(L_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", | 144 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", |
145 | ic->identifier, ic->send_events); | 145 | ic->identifier, ic->send_events); |
146 | libinput_device_config_send_events_set_mode(libinput_device, ic->send_events); | 146 | libinput_device_config_send_events_set_mode(libinput_device, ic->send_events); |
147 | } | 147 | } |
148 | if (ic->tap != INT_MIN) { | 148 | if (ic->tap != INT_MIN) { |
149 | sway_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", | 149 | wlr_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", |
150 | ic->identifier, ic->tap); | 150 | ic->identifier, ic->tap); |
151 | libinput_device_config_tap_set_enabled(libinput_device, ic->tap); | 151 | libinput_device_config_tap_set_enabled(libinput_device, ic->tap); |
152 | } | 152 | } |
@@ -167,7 +167,7 @@ static void input_add_notify(struct wl_listener *listener, void *data) { | |||
167 | input_device->identifier = get_device_identifier(device); | 167 | input_device->identifier = get_device_identifier(device); |
168 | wl_list_insert(&input->devices, &input_device->link); | 168 | wl_list_insert(&input->devices, &input_device->link); |
169 | 169 | ||
170 | sway_log(L_DEBUG, "adding device: '%s'", | 170 | wlr_log(L_DEBUG, "adding device: '%s'", |
171 | input_device->identifier); | 171 | input_device->identifier); |
172 | 172 | ||
173 | // find config | 173 | // find config |
@@ -185,7 +185,7 @@ static void input_add_notify(struct wl_listener *listener, void *data) { | |||
185 | 185 | ||
186 | struct sway_seat *seat = NULL; | 186 | struct sway_seat *seat = NULL; |
187 | if (!input_has_seat_configuration(input)) { | 187 | if (!input_has_seat_configuration(input)) { |
188 | sway_log(L_DEBUG, "no seat configuration, using default seat"); | 188 | wlr_log(L_DEBUG, "no seat configuration, using default seat"); |
189 | seat = input_manager_get_seat(input, default_seat); | 189 | seat = input_manager_get_seat(input, default_seat); |
190 | sway_seat_add_device(seat, input_device); | 190 | sway_seat_add_device(seat, input_device); |
191 | return; | 191 | return; |
@@ -213,7 +213,7 @@ static void input_add_notify(struct wl_listener *listener, void *data) { | |||
213 | } | 213 | } |
214 | 214 | ||
215 | if (!added) { | 215 | if (!added) { |
216 | sway_log(L_DEBUG, | 216 | wlr_log(L_DEBUG, |
217 | "device '%s' is not configured on any seats", | 217 | "device '%s' is not configured on any seats", |
218 | input_device->identifier); | 218 | input_device->identifier); |
219 | } | 219 | } |
@@ -231,7 +231,7 @@ static void input_remove_notify(struct wl_listener *listener, void *data) { | |||
231 | return; | 231 | return; |
232 | } | 232 | } |
233 | 233 | ||
234 | sway_log(L_DEBUG, "removing device: '%s'", | 234 | wlr_log(L_DEBUG, "removing device: '%s'", |
235 | input_device->identifier); | 235 | input_device->identifier); |
236 | 236 | ||
237 | struct sway_seat *seat = NULL; | 237 | struct sway_seat *seat = NULL; |
@@ -309,7 +309,7 @@ void sway_input_manager_apply_input_config(struct sway_input_manager *input, | |||
309 | 309 | ||
310 | void sway_input_manager_apply_seat_config(struct sway_input_manager *input, | 310 | void sway_input_manager_apply_seat_config(struct sway_input_manager *input, |
311 | struct seat_config *seat_config) { | 311 | struct seat_config *seat_config) { |
312 | sway_log(L_DEBUG, "applying new seat config for seat %s", | 312 | wlr_log(L_DEBUG, "applying new seat config for seat %s", |
313 | seat_config->name); | 313 | seat_config->name); |
314 | struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); | 314 | struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); |
315 | if (!seat) { | 315 | if (!seat) { |
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index c2bb2578..e7539c48 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -90,11 +90,11 @@ static bool binding_matches_key_state(struct sway_binding *binding, | |||
90 | } | 90 | } |
91 | 91 | ||
92 | static void binding_execute_command(struct sway_binding *binding) { | 92 | static void binding_execute_command(struct sway_binding *binding) { |
93 | sway_log(L_DEBUG, "running command for binding: %s", | 93 | wlr_log(L_DEBUG, "running command for binding: %s", |
94 | binding->command); | 94 | binding->command); |
95 | struct cmd_results *results = handle_command(binding->command); | 95 | struct cmd_results *results = handle_command(binding->command); |
96 | if (results->status != CMD_SUCCESS) { | 96 | if (results->status != CMD_SUCCESS) { |
97 | sway_log(L_DEBUG, "could not run command for binding: %s", | 97 | wlr_log(L_DEBUG, "could not run command for binding: %s", |
98 | binding->command); | 98 | binding->command); |
99 | } | 99 | } |
100 | free_cmd_results(results); | 100 | free_cmd_results(results); |
@@ -467,7 +467,7 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
467 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); | 467 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); |
468 | 468 | ||
469 | if (!keymap) { | 469 | if (!keymap) { |
470 | sway_log(L_DEBUG, "cannot configure keyboard: keymap does not exist"); | 470 | wlr_log(L_DEBUG, "cannot configure keyboard: keymap does not exist"); |
471 | xkb_context_unref(context); | 471 | xkb_context_unref(context); |
472 | return; | 472 | return; |
473 | } | 473 | } |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 9a6a667b..268486ab 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -112,7 +112,7 @@ void sway_seat_configure_device(struct sway_seat *seat, | |||
112 | case WLR_INPUT_DEVICE_TOUCH: | 112 | case WLR_INPUT_DEVICE_TOUCH: |
113 | case WLR_INPUT_DEVICE_TABLET_PAD: | 113 | case WLR_INPUT_DEVICE_TABLET_PAD: |
114 | case WLR_INPUT_DEVICE_TABLET_TOOL: | 114 | case WLR_INPUT_DEVICE_TABLET_TOOL: |
115 | sway_log(L_DEBUG, "TODO: configure other devices"); | 115 | wlr_log(L_DEBUG, "TODO: configure other devices"); |
116 | break; | 116 | break; |
117 | } | 117 | } |
118 | } | 118 | } |
@@ -127,11 +127,11 @@ void sway_seat_add_device(struct sway_seat *seat, | |||
127 | struct sway_seat_device *seat_device = | 127 | struct sway_seat_device *seat_device = |
128 | calloc(1, sizeof(struct sway_seat_device)); | 128 | calloc(1, sizeof(struct sway_seat_device)); |
129 | if (!seat_device) { | 129 | if (!seat_device) { |
130 | sway_log(L_DEBUG, "could not allocate seat device"); | 130 | wlr_log(L_DEBUG, "could not allocate seat device"); |
131 | return; | 131 | return; |
132 | } | 132 | } |
133 | 133 | ||
134 | sway_log(L_DEBUG, "adding device %s to seat %s", | 134 | wlr_log(L_DEBUG, "adding device %s to seat %s", |
135 | input_device->identifier, seat->wlr_seat->name); | 135 | input_device->identifier, seat->wlr_seat->name); |
136 | 136 | ||
137 | seat_device->sway_seat = seat; | 137 | seat_device->sway_seat = seat; |
@@ -150,7 +150,7 @@ void sway_seat_remove_device(struct sway_seat *seat, | |||
150 | return; | 150 | return; |
151 | } | 151 | } |
152 | 152 | ||
153 | sway_log(L_DEBUG, "removing device %s from seat %s", | 153 | wlr_log(L_DEBUG, "removing device %s from seat %s", |
154 | input_device->identifier, seat->wlr_seat->name); | 154 | input_device->identifier, seat->wlr_seat->name); |
155 | 155 | ||
156 | seat_device_destroy(seat_device); | 156 | seat_device_destroy(seat_device); |
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 046e40a8..d2dd881f 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -125,32 +125,32 @@ struct sockaddr_un *ipc_user_sockaddr(void) { | |||
125 | int ipc_handle_connection(int fd, uint32_t mask, void *data) { | 125 | int ipc_handle_connection(int fd, uint32_t mask, void *data) { |
126 | (void) fd; | 126 | (void) fd; |
127 | struct sway_server *server = data; | 127 | struct sway_server *server = data; |
128 | sway_log(L_DEBUG, "Event on IPC listening socket"); | 128 | wlr_log(L_DEBUG, "Event on IPC listening socket"); |
129 | assert(mask == WL_EVENT_READABLE); | 129 | assert(mask == WL_EVENT_READABLE); |
130 | 130 | ||
131 | int client_fd = accept(ipc_socket, NULL, NULL); | 131 | int client_fd = accept(ipc_socket, NULL, NULL); |
132 | if (client_fd == -1) { | 132 | if (client_fd == -1) { |
133 | sway_log_errno(L_ERROR, "Unable to accept IPC client connection"); | 133 | wlr_log_errno(L_ERROR, "Unable to accept IPC client connection"); |
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
137 | int flags; | 137 | int flags; |
138 | if ((flags = fcntl(client_fd, F_GETFD)) == -1 | 138 | if ((flags = fcntl(client_fd, F_GETFD)) == -1 |
139 | || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { | 139 | || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { |
140 | sway_log_errno(L_ERROR, "Unable to set CLOEXEC on IPC client socket"); | 140 | wlr_log_errno(L_ERROR, "Unable to set CLOEXEC on IPC client socket"); |
141 | close(client_fd); | 141 | close(client_fd); |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | if ((flags = fcntl(client_fd, F_GETFL)) == -1 | 144 | if ((flags = fcntl(client_fd, F_GETFL)) == -1 |
145 | || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { | 145 | || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { |
146 | sway_log_errno(L_ERROR, "Unable to set NONBLOCK on IPC client socket"); | 146 | wlr_log_errno(L_ERROR, "Unable to set NONBLOCK on IPC client socket"); |
147 | close(client_fd); | 147 | close(client_fd); |
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
150 | 150 | ||
151 | struct ipc_client *client = malloc(sizeof(struct ipc_client)); | 151 | struct ipc_client *client = malloc(sizeof(struct ipc_client)); |
152 | if (!client) { | 152 | if (!client) { |
153 | sway_log(L_ERROR, "Unable to allocate ipc client"); | 153 | wlr_log(L_ERROR, "Unable to allocate ipc client"); |
154 | close(client_fd); | 154 | close(client_fd); |
155 | return 0; | 155 | return 0; |
156 | } | 156 | } |
@@ -166,12 +166,12 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { | |||
166 | client->write_buffer_len = 0; | 166 | client->write_buffer_len = 0; |
167 | client->write_buffer = malloc(client->write_buffer_size); | 167 | client->write_buffer = malloc(client->write_buffer_size); |
168 | if (!client->write_buffer) { | 168 | if (!client->write_buffer) { |
169 | sway_log(L_ERROR, "Unable to allocate ipc client write buffer"); | 169 | wlr_log(L_ERROR, "Unable to allocate ipc client write buffer"); |
170 | close(client_fd); | 170 | close(client_fd); |
171 | return 0; | 171 | return 0; |
172 | } | 172 | } |
173 | 173 | ||
174 | sway_log(L_DEBUG, "New client: fd %d", client_fd); | 174 | wlr_log(L_DEBUG, "New client: fd %d", client_fd); |
175 | list_add(ipc_client_list, client); | 175 | list_add(ipc_client_list, client); |
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
@@ -182,22 +182,22 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { | |||
182 | struct ipc_client *client = data; | 182 | struct ipc_client *client = data; |
183 | 183 | ||
184 | if (mask & WL_EVENT_ERROR) { | 184 | if (mask & WL_EVENT_ERROR) { |
185 | sway_log(L_ERROR, "IPC Client socket error, removing client"); | 185 | wlr_log(L_ERROR, "IPC Client socket error, removing client"); |
186 | ipc_client_disconnect(client); | 186 | ipc_client_disconnect(client); |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
190 | if (mask & WL_EVENT_HANGUP) { | 190 | if (mask & WL_EVENT_HANGUP) { |
191 | sway_log(L_DEBUG, "Client %d hung up", client->fd); | 191 | wlr_log(L_DEBUG, "Client %d hung up", client->fd); |
192 | ipc_client_disconnect(client); | 192 | ipc_client_disconnect(client); |
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | 195 | ||
196 | sway_log(L_DEBUG, "Client %d readable", client->fd); | 196 | wlr_log(L_DEBUG, "Client %d readable", client->fd); |
197 | 197 | ||
198 | int read_available; | 198 | int read_available; |
199 | if (ioctl(client_fd, FIONREAD, &read_available) == -1) { | 199 | if (ioctl(client_fd, FIONREAD, &read_available) == -1) { |
200 | sway_log_errno(L_INFO, "Unable to read IPC socket buffer size"); | 200 | wlr_log_errno(L_INFO, "Unable to read IPC socket buffer size"); |
201 | ipc_client_disconnect(client); | 201 | ipc_client_disconnect(client); |
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
@@ -219,13 +219,13 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { | |||
219 | // Should be fully available, because read_available >= ipc_header_size | 219 | // Should be fully available, because read_available >= ipc_header_size |
220 | ssize_t received = recv(client_fd, buf, ipc_header_size, 0); | 220 | ssize_t received = recv(client_fd, buf, ipc_header_size, 0); |
221 | if (received == -1) { | 221 | if (received == -1) { |
222 | sway_log_errno(L_INFO, "Unable to receive header from IPC client"); | 222 | wlr_log_errno(L_INFO, "Unable to receive header from IPC client"); |
223 | ipc_client_disconnect(client); | 223 | ipc_client_disconnect(client); |
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | if (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) { | 227 | if (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) { |
228 | sway_log(L_DEBUG, "IPC header check failed"); | 228 | wlr_log(L_DEBUG, "IPC header check failed"); |
229 | ipc_client_disconnect(client); | 229 | ipc_client_disconnect(client); |
230 | return 0; | 230 | return 0; |
231 | } | 231 | } |
@@ -244,13 +244,13 @@ int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { | |||
244 | struct ipc_client *client = data; | 244 | struct ipc_client *client = data; |
245 | 245 | ||
246 | if (mask & WL_EVENT_ERROR) { | 246 | if (mask & WL_EVENT_ERROR) { |
247 | sway_log(L_ERROR, "IPC Client socket error, removing client"); | 247 | wlr_log(L_ERROR, "IPC Client socket error, removing client"); |
248 | ipc_client_disconnect(client); | 248 | ipc_client_disconnect(client); |
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
251 | 251 | ||
252 | if (mask & WL_EVENT_HANGUP) { | 252 | if (mask & WL_EVENT_HANGUP) { |
253 | sway_log(L_DEBUG, "Client %d hung up", client->fd); | 253 | wlr_log(L_DEBUG, "Client %d hung up", client->fd); |
254 | ipc_client_disconnect(client); | 254 | ipc_client_disconnect(client); |
255 | return 0; | 255 | return 0; |
256 | } | 256 | } |
@@ -259,14 +259,14 @@ int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { | |||
259 | return 0; | 259 | return 0; |
260 | } | 260 | } |
261 | 261 | ||
262 | sway_log(L_DEBUG, "Client %d writable", client->fd); | 262 | wlr_log(L_DEBUG, "Client %d writable", client->fd); |
263 | 263 | ||
264 | ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); | 264 | ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); |
265 | 265 | ||
266 | if (written == -1 && errno == EAGAIN) { | 266 | if (written == -1 && errno == EAGAIN) { |
267 | return 0; | 267 | return 0; |
268 | } else if (written == -1) { | 268 | } else if (written == -1) { |
269 | sway_log_errno(L_INFO, "Unable to send data from queue to IPC client"); | 269 | wlr_log_errno(L_INFO, "Unable to send data from queue to IPC client"); |
270 | ipc_client_disconnect(client); | 270 | ipc_client_disconnect(client); |
271 | return 0; | 271 | return 0; |
272 | } | 272 | } |
@@ -291,7 +291,7 @@ void ipc_client_disconnect(struct ipc_client *client) { | |||
291 | shutdown(client->fd, SHUT_RDWR); | 291 | shutdown(client->fd, SHUT_RDWR); |
292 | } | 292 | } |
293 | 293 | ||
294 | sway_log(L_INFO, "IPC Client %d disconnected", client->fd); | 294 | wlr_log(L_INFO, "IPC Client %d disconnected", client->fd); |
295 | wl_event_source_remove(client->event_source); | 295 | wl_event_source_remove(client->event_source); |
296 | if (client->writable_event_source) { | 296 | if (client->writable_event_source) { |
297 | wl_event_source_remove(client->writable_event_source); | 297 | wl_event_source_remove(client->writable_event_source); |
@@ -313,7 +313,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
313 | 313 | ||
314 | char *buf = malloc(client->payload_length + 1); | 314 | char *buf = malloc(client->payload_length + 1); |
315 | if (!buf) { | 315 | if (!buf) { |
316 | sway_log_errno(L_INFO, "Unable to allocate IPC payload"); | 316 | wlr_log_errno(L_INFO, "Unable to allocate IPC payload"); |
317 | ipc_client_disconnect(client); | 317 | ipc_client_disconnect(client); |
318 | return; | 318 | return; |
319 | } | 319 | } |
@@ -322,7 +322,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
322 | ssize_t received = recv(client->fd, buf, client->payload_length, 0); | 322 | ssize_t received = recv(client->fd, buf, client->payload_length, 0); |
323 | if (received == -1) | 323 | if (received == -1) |
324 | { | 324 | { |
325 | sway_log_errno(L_INFO, "Unable to receive payload from IPC client"); | 325 | wlr_log_errno(L_INFO, "Unable to receive payload from IPC client"); |
326 | ipc_client_disconnect(client); | 326 | ipc_client_disconnect(client); |
327 | free(buf); | 327 | free(buf); |
328 | return; | 328 | return; |
@@ -393,12 +393,12 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
393 | } | 393 | } |
394 | 394 | ||
395 | default: | 395 | default: |
396 | sway_log(L_INFO, "Unknown IPC command type %i", client->current_command); | 396 | wlr_log(L_INFO, "Unknown IPC command type %i", client->current_command); |
397 | goto exit_cleanup; | 397 | goto exit_cleanup; |
398 | } | 398 | } |
399 | 399 | ||
400 | ipc_send_reply(client, error_denied, (uint32_t)strlen(error_denied)); | 400 | ipc_send_reply(client, error_denied, (uint32_t)strlen(error_denied)); |
401 | sway_log(L_DEBUG, "Denied IPC client access to %i", client->current_command); | 401 | wlr_log(L_DEBUG, "Denied IPC client access to %i", client->current_command); |
402 | 402 | ||
403 | exit_cleanup: | 403 | exit_cleanup: |
404 | client->payload_length = 0; | 404 | client->payload_length = 0; |
@@ -422,14 +422,14 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay | |||
422 | } | 422 | } |
423 | 423 | ||
424 | if (client->write_buffer_size > 4e6) { // 4 MB | 424 | if (client->write_buffer_size > 4e6) { // 4 MB |
425 | sway_log(L_ERROR, "Client write buffer too big, disconnecting client"); | 425 | wlr_log(L_ERROR, "Client write buffer too big, disconnecting client"); |
426 | ipc_client_disconnect(client); | 426 | ipc_client_disconnect(client); |
427 | return false; | 427 | return false; |
428 | } | 428 | } |
429 | 429 | ||
430 | char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); | 430 | char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); |
431 | if (!new_buffer) { | 431 | if (!new_buffer) { |
432 | sway_log(L_ERROR, "Unable to reallocate ipc client write buffer"); | 432 | wlr_log(L_ERROR, "Unable to reallocate ipc client write buffer"); |
433 | ipc_client_disconnect(client); | 433 | ipc_client_disconnect(client); |
434 | return false; | 434 | return false; |
435 | } | 435 | } |
@@ -446,6 +446,6 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay | |||
446 | ipc_client_handle_writable, client); | 446 | ipc_client_handle_writable, client); |
447 | } | 447 | } |
448 | 448 | ||
449 | sway_log(L_DEBUG, "Added IPC reply to client %d queue: %s", client->fd, payload); | 449 | wlr_log(L_DEBUG, "Added IPC reply to client %d queue: %s", client->fd, payload); |
450 | return true; | 450 | return true; |
451 | } | 451 | } |
diff --git a/sway/tree/container.c b/sway/tree/container.c index c5574275..31ec2ce5 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -92,11 +92,11 @@ swayc_t *new_output(struct sway_output *sway_output) { | |||
92 | 92 | ||
93 | if (strcasecmp(name, cur->name) == 0 || | 93 | if (strcasecmp(name, cur->name) == 0 || |
94 | strcasecmp(identifier, cur->name) == 0) { | 94 | strcasecmp(identifier, cur->name) == 0) { |
95 | sway_log(L_DEBUG, "Matched output config for %s", name); | 95 | wlr_log(L_DEBUG, "Matched output config for %s", name); |
96 | oc = cur; | 96 | oc = cur; |
97 | } | 97 | } |
98 | if (strcasecmp("*", cur->name) == 0) { | 98 | if (strcasecmp("*", cur->name) == 0) { |
99 | sway_log(L_DEBUG, "Matched wildcard output config for %s", name); | 99 | wlr_log(L_DEBUG, "Matched wildcard output config for %s", name); |
100 | all = cur; | 100 | all = cur; |
101 | } | 101 | } |
102 | 102 | ||
@@ -126,7 +126,7 @@ swayc_t *new_output(struct sway_output *sway_output) { | |||
126 | 126 | ||
127 | // Create workspace | 127 | // Create workspace |
128 | char *ws_name = workspace_next_name(output->name); | 128 | char *ws_name = workspace_next_name(output->name); |
129 | sway_log(L_DEBUG, "Creating default workspace %s", ws_name); | 129 | wlr_log(L_DEBUG, "Creating default workspace %s", ws_name); |
130 | new_workspace(output, ws_name); | 130 | new_workspace(output, ws_name); |
131 | free(ws_name); | 131 | free(ws_name); |
132 | return output; | 132 | return output; |
@@ -136,7 +136,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) { | |||
136 | if (!sway_assert(output, "new_workspace called with null output")) { | 136 | if (!sway_assert(output, "new_workspace called with null output")) { |
137 | return NULL; | 137 | return NULL; |
138 | } | 138 | } |
139 | sway_log(L_DEBUG, "Added workspace %s for output %s", name, output->name); | 139 | wlr_log(L_DEBUG, "Added workspace %s for output %s", name, output->name); |
140 | swayc_t *workspace = new_swayc(C_WORKSPACE); | 140 | swayc_t *workspace = new_swayc(C_WORKSPACE); |
141 | 141 | ||
142 | workspace->x = output->x; | 142 | workspace->x = output->x; |
@@ -159,7 +159,7 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) { | |||
159 | } | 159 | } |
160 | const char *title = sway_view->iface.get_prop(sway_view, VIEW_PROP_TITLE); | 160 | const char *title = sway_view->iface.get_prop(sway_view, VIEW_PROP_TITLE); |
161 | swayc_t *swayc = new_swayc(C_VIEW); | 161 | swayc_t *swayc = new_swayc(C_VIEW); |
162 | sway_log(L_DEBUG, "Adding new view %p:%s to container %p %d", | 162 | wlr_log(L_DEBUG, "Adding new view %p:%s to container %p %d", |
163 | swayc, title, sibling, sibling ? sibling->type : 0); | 163 | swayc, title, sibling, sibling ? sibling->type : 0); |
164 | // Setup values | 164 | // Setup values |
165 | swayc->sway_view = sway_view; | 165 | swayc->sway_view = sway_view; |
@@ -200,7 +200,7 @@ swayc_t *destroy_output(swayc_t *output) { | |||
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | sway_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name); | 203 | wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name); |
204 | free_swayc(output); | 204 | free_swayc(output); |
205 | 205 | ||
206 | return &root_container; | 206 | return &root_container; |
@@ -210,7 +210,7 @@ swayc_t *destroy_view(swayc_t *view) { | |||
210 | if (!sway_assert(view, "null view passed to destroy_view")) { | 210 | if (!sway_assert(view, "null view passed to destroy_view")) { |
211 | return NULL; | 211 | return NULL; |
212 | } | 212 | } |
213 | sway_log(L_DEBUG, "Destroying view '%s'", view->name); | 213 | wlr_log(L_DEBUG, "Destroying view '%s'", view->name); |
214 | swayc_t *parent = view->parent; | 214 | swayc_t *parent = view->parent; |
215 | free_swayc(view); | 215 | free_swayc(view); |
216 | 216 | ||
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 4bcf0e2f..13b8a395 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -59,7 +59,7 @@ void init_layout(void) { | |||
59 | } | 59 | } |
60 | 60 | ||
61 | void add_child(swayc_t *parent, swayc_t *child) { | 61 | void add_child(swayc_t *parent, swayc_t *child) { |
62 | sway_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)", | 62 | wlr_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)", |
63 | child, child->type, child->width, child->height, | 63 | child, child->type, child->width, child->height, |
64 | parent, parent->type, parent->width, parent->height); | 64 | parent, parent->type, parent->width, parent->height); |
65 | list_add(parent->children, child); | 65 | list_add(parent->children, child); |
@@ -145,7 +145,7 @@ void arrange_windows(swayc_t *container, double width, double height) { | |||
145 | width = floor(width); | 145 | width = floor(width); |
146 | height = floor(height); | 146 | height = floor(height); |
147 | 147 | ||
148 | sway_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", container, | 148 | wlr_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", container, |
149 | container->name, container->width, container->height, container->x, | 149 | container->name, container->width, container->height, container->x, |
150 | container->y); | 150 | container->y); |
151 | 151 | ||
@@ -155,7 +155,7 @@ void arrange_windows(swayc_t *container, double width, double height) { | |||
155 | // TODO: wlr_output_layout probably | 155 | // TODO: wlr_output_layout probably |
156 | for (i = 0; i < container->children->length; ++i) { | 156 | for (i = 0; i < container->children->length; ++i) { |
157 | swayc_t *output = container->children->items[i]; | 157 | swayc_t *output = container->children->items[i]; |
158 | sway_log(L_DEBUG, "Arranging output '%s' at %f,%f", | 158 | wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", |
159 | output->name, output->x, output->y); | 159 | output->name, output->x, output->y); |
160 | arrange_windows(output, -1, -1); | 160 | arrange_windows(output, -1, -1); |
161 | } | 161 | } |
@@ -181,7 +181,7 @@ void arrange_windows(swayc_t *container, double width, double height) { | |||
181 | container->height = output->height; | 181 | container->height = output->height; |
182 | container->x = x; | 182 | container->x = x; |
183 | container->y = y; | 183 | container->y = y; |
184 | sway_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", | 184 | wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", |
185 | container->name, container->x, container->y); | 185 | container->name, container->x, container->y); |
186 | } | 186 | } |
187 | // children are properly handled below | 187 | // children are properly handled below |
@@ -192,7 +192,7 @@ void arrange_windows(swayc_t *container, double width, double height) { | |||
192 | container->height = height; | 192 | container->height = height; |
193 | container->sway_view->iface.set_size(container->sway_view, | 193 | container->sway_view->iface.set_size(container->sway_view, |
194 | container->width, container->height); | 194 | container->width, container->height); |
195 | sway_log(L_DEBUG, "Set view to %.f x %.f @ %.f, %.f", | 195 | wlr_log(L_DEBUG, "Set view to %.f x %.f @ %.f, %.f", |
196 | container->width, container->height, | 196 | container->width, container->height, |
197 | container->x, container->y); | 197 | container->x, container->y); |
198 | } | 198 | } |
@@ -215,7 +215,7 @@ void arrange_windows(swayc_t *container, double width, double height) { | |||
215 | container->children->length); | 215 | container->children->length); |
216 | break; | 216 | break; |
217 | default: | 217 | default: |
218 | sway_log(L_DEBUG, "TODO: arrange layout type %d", container->layout); | 218 | wlr_log(L_DEBUG, "TODO: arrange layout type %d", container->layout); |
219 | apply_horiz_layout(container, x, y, width, height, 0, | 219 | apply_horiz_layout(container, x, y, width, height, 0, |
220 | container->children->length); | 220 | container->children->length); |
221 | break; | 221 | break; |
@@ -244,10 +244,10 @@ static void apply_horiz_layout(swayc_t *container, | |||
244 | // Resize windows | 244 | // Resize windows |
245 | double child_x = x; | 245 | double child_x = x; |
246 | if (scale > 0.1) { | 246 | if (scale > 0.1) { |
247 | sway_log(L_DEBUG, "Arranging %p horizontally", container); | 247 | wlr_log(L_DEBUG, "Arranging %p horizontally", container); |
248 | for (int i = start; i < end; ++i) { | 248 | for (int i = start; i < end; ++i) { |
249 | swayc_t *child = container->children->items[i]; | 249 | swayc_t *child = container->children->items[i]; |
250 | sway_log(L_DEBUG, | 250 | wlr_log(L_DEBUG, |
251 | "Calculating arrangement for %p:%d (will scale %f by %f)", | 251 | "Calculating arrangement for %p:%d (will scale %f by %f)", |
252 | child, child->type, width, scale); | 252 | child, child->type, width, scale); |
253 | child->sway_view->iface.set_position(child->sway_view, child_x, y); | 253 | child->sway_view->iface.set_position(child->sway_view, child_x, y); |
@@ -294,10 +294,10 @@ void apply_vert_layout(swayc_t *container, | |||
294 | // Resize | 294 | // Resize |
295 | double child_y = y; | 295 | double child_y = y; |
296 | if (scale > 0.1) { | 296 | if (scale > 0.1) { |
297 | sway_log(L_DEBUG, "Arranging %p vertically", container); | 297 | wlr_log(L_DEBUG, "Arranging %p vertically", container); |
298 | for (i = start; i < end; ++i) { | 298 | for (i = start; i < end; ++i) { |
299 | swayc_t *child = container->children->items[i]; | 299 | swayc_t *child = container->children->items[i]; |
300 | sway_log(L_DEBUG, | 300 | wlr_log(L_DEBUG, |
301 | "Calculating arrangement for %p:%d (will scale %f by %f)", | 301 | "Calculating arrangement for %p:%d (will scale %f by %f)", |
302 | child, child->type, height, scale); | 302 | child, child->type, height, scale); |
303 | child->sway_view->iface.set_position(child->sway_view, x, child_y); | 303 | child->sway_view->iface.set_position(child->sway_view, x, child_y); |
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index e8ed4102..c37a873c 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -11,7 +11,7 @@ void next_name_map(swayc_t *ws, void *data) { | |||
11 | } | 11 | } |
12 | 12 | ||
13 | char *workspace_next_name(const char *output_name) { | 13 | char *workspace_next_name(const char *output_name) { |
14 | sway_log(L_DEBUG, "Workspace: Generating new workspace name for output %s", | 14 | wlr_log(L_DEBUG, "Workspace: Generating new workspace name for output %s", |
15 | output_name); | 15 | output_name); |
16 | int count = 0; | 16 | int count = 0; |
17 | next_name_map(&root_container, &count); | 17 | next_name_map(&root_container, &count); |