diff options
author | M Stoeckl <code@mstoeckl.com> | 2019-01-20 13:51:12 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-21 12:59:42 +0100 |
commit | 1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch) | |
tree | 5c3f60e0219cb8b4a1b7cafb760a871661866e32 /sway/config | |
parent | Log libinput_config_status errors (diff) | |
download | sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip |
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/bar.c | 14 | ||||
-rw-r--r-- | sway/config/input.c | 18 | ||||
-rw-r--r-- | sway/config/output.c | 44 | ||||
-rw-r--r-- | sway/config/seat.c | 16 |
4 files changed, 46 insertions, 46 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c index b1aa2313..0fdac5d8 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c | |||
@@ -19,10 +19,10 @@ | |||
19 | #include "util.h" | 19 | #include "util.h" |
20 | 20 | ||
21 | static void terminate_swaybar(pid_t pid) { | 21 | static void terminate_swaybar(pid_t pid) { |
22 | wlr_log(WLR_DEBUG, "Terminating swaybar %d", pid); | 22 | sway_log(SWAY_DEBUG, "Terminating swaybar %d", pid); |
23 | int ret = kill(-pid, SIGTERM); | 23 | int ret = kill(-pid, SIGTERM); |
24 | if (ret != 0) { | 24 | if (ret != 0) { |
25 | wlr_log_errno(WLR_ERROR, "Unable to terminate swaybar %d", pid); | 25 | sway_log_errno(SWAY_ERROR, "Unable to terminate swaybar %d", pid); |
26 | } else { | 26 | } else { |
27 | int status; | 27 | int status; |
28 | waitpid(pid, &status, 0); | 28 | waitpid(pid, &status, 0); |
@@ -194,7 +194,7 @@ static void invoke_swaybar(struct bar_config *bar) { | |||
194 | // Pipe to communicate errors | 194 | // Pipe to communicate errors |
195 | int filedes[2]; | 195 | int filedes[2]; |
196 | if (pipe(filedes) == -1) { | 196 | if (pipe(filedes) == -1) { |
197 | wlr_log(WLR_ERROR, "Pipe setup failed! Cannot fork into bar"); | 197 | sway_log(SWAY_ERROR, "Pipe setup failed! Cannot fork into bar"); |
198 | return; | 198 | return; |
199 | } | 199 | } |
200 | 200 | ||
@@ -227,17 +227,17 @@ static void invoke_swaybar(struct bar_config *bar) { | |||
227 | execvp(cmd[0], cmd); | 227 | execvp(cmd[0], cmd); |
228 | exit(1); | 228 | exit(1); |
229 | } | 229 | } |
230 | wlr_log(WLR_DEBUG, "Spawned swaybar %d", bar->pid); | 230 | sway_log(SWAY_DEBUG, "Spawned swaybar %d", bar->pid); |
231 | close(filedes[0]); | 231 | close(filedes[0]); |
232 | size_t len; | 232 | size_t len; |
233 | if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { | 233 | if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { |
234 | char *buf = malloc(len); | 234 | char *buf = malloc(len); |
235 | if(!buf) { | 235 | if(!buf) { |
236 | wlr_log(WLR_ERROR, "Cannot allocate error string"); | 236 | sway_log(SWAY_ERROR, "Cannot allocate error string"); |
237 | return; | 237 | return; |
238 | } | 238 | } |
239 | if (read(filedes[1], buf, len)) { | 239 | if (read(filedes[1], buf, len)) { |
240 | wlr_log(WLR_ERROR, "%s", buf); | 240 | sway_log(SWAY_ERROR, "%s", buf); |
241 | } | 241 | } |
242 | free(buf); | 242 | free(buf); |
243 | } | 243 | } |
@@ -248,7 +248,7 @@ void load_swaybar(struct bar_config *bar) { | |||
248 | if (bar->pid != 0) { | 248 | if (bar->pid != 0) { |
249 | terminate_swaybar(bar->pid); | 249 | terminate_swaybar(bar->pid); |
250 | } | 250 | } |
251 | wlr_log(WLR_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); | 251 | sway_log(SWAY_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); |
252 | invoke_swaybar(bar); | 252 | invoke_swaybar(bar); |
253 | } | 253 | } |
254 | 254 | ||
diff --git a/sway/config/input.c b/sway/config/input.c index d649d34d..63c28635 100644 --- a/sway/config/input.c +++ b/sway/config/input.c | |||
@@ -8,13 +8,13 @@ | |||
8 | struct input_config *new_input_config(const char* identifier) { | 8 | struct input_config *new_input_config(const char* identifier) { |
9 | struct input_config *input = calloc(1, sizeof(struct input_config)); | 9 | struct input_config *input = calloc(1, sizeof(struct input_config)); |
10 | if (!input) { | 10 | if (!input) { |
11 | wlr_log(WLR_DEBUG, "Unable to allocate input config"); | 11 | sway_log(SWAY_DEBUG, "Unable to allocate input config"); |
12 | return NULL; | 12 | return NULL; |
13 | } | 13 | } |
14 | wlr_log(WLR_DEBUG, "new_input_config(%s)", identifier); | 14 | sway_log(SWAY_DEBUG, "new_input_config(%s)", identifier); |
15 | if (!(input->identifier = strdup(identifier))) { | 15 | if (!(input->identifier = strdup(identifier))) { |
16 | free(input); | 16 | free(input); |
17 | wlr_log(WLR_DEBUG, "Unable to allocate input config"); | 17 | sway_log(SWAY_DEBUG, "Unable to allocate input config"); |
18 | return NULL; | 18 | return NULL; |
19 | } | 19 | } |
20 | 20 | ||
@@ -136,7 +136,7 @@ static void merge_wildcard_on_all(struct input_config *wildcard) { | |||
136 | for (int i = 0; i < config->input_configs->length; i++) { | 136 | for (int i = 0; i < config->input_configs->length; i++) { |
137 | struct input_config *ic = config->input_configs->items[i]; | 137 | struct input_config *ic = config->input_configs->items[i]; |
138 | if (strcmp(wildcard->identifier, ic->identifier) != 0) { | 138 | if (strcmp(wildcard->identifier, ic->identifier) != 0) { |
139 | wlr_log(WLR_DEBUG, "Merging input * config on %s", ic->identifier); | 139 | sway_log(SWAY_DEBUG, "Merging input * config on %s", ic->identifier); |
140 | merge_input_config(ic, wildcard); | 140 | merge_input_config(ic, wildcard); |
141 | } | 141 | } |
142 | } | 142 | } |
@@ -151,16 +151,16 @@ struct input_config *store_input_config(struct input_config *ic) { | |||
151 | int i = list_seq_find(config->input_configs, input_identifier_cmp, | 151 | int i = list_seq_find(config->input_configs, input_identifier_cmp, |
152 | ic->identifier); | 152 | ic->identifier); |
153 | if (i >= 0) { | 153 | if (i >= 0) { |
154 | wlr_log(WLR_DEBUG, "Merging on top of existing input config"); | 154 | sway_log(SWAY_DEBUG, "Merging on top of existing input config"); |
155 | struct input_config *current = config->input_configs->items[i]; | 155 | struct input_config *current = config->input_configs->items[i]; |
156 | merge_input_config(current, ic); | 156 | merge_input_config(current, ic); |
157 | free_input_config(ic); | 157 | free_input_config(ic); |
158 | ic = current; | 158 | ic = current; |
159 | } else if (!wildcard) { | 159 | } else if (!wildcard) { |
160 | wlr_log(WLR_DEBUG, "Adding non-wildcard input config"); | 160 | sway_log(SWAY_DEBUG, "Adding non-wildcard input config"); |
161 | i = list_seq_find(config->input_configs, input_identifier_cmp, "*"); | 161 | i = list_seq_find(config->input_configs, input_identifier_cmp, "*"); |
162 | if (i >= 0) { | 162 | if (i >= 0) { |
163 | wlr_log(WLR_DEBUG, "Merging on top of input * config"); | 163 | sway_log(SWAY_DEBUG, "Merging on top of input * config"); |
164 | struct input_config *current = new_input_config(ic->identifier); | 164 | struct input_config *current = new_input_config(ic->identifier); |
165 | merge_input_config(current, config->input_configs->items[i]); | 165 | merge_input_config(current, config->input_configs->items[i]); |
166 | merge_input_config(current, ic); | 166 | merge_input_config(current, ic); |
@@ -170,11 +170,11 @@ struct input_config *store_input_config(struct input_config *ic) { | |||
170 | list_add(config->input_configs, ic); | 170 | list_add(config->input_configs, ic); |
171 | } else { | 171 | } else { |
172 | // New wildcard config. Just add it | 172 | // New wildcard config. Just add it |
173 | wlr_log(WLR_DEBUG, "Adding input * config"); | 173 | sway_log(SWAY_DEBUG, "Adding input * config"); |
174 | list_add(config->input_configs, ic); | 174 | list_add(config->input_configs, ic); |
175 | } | 175 | } |
176 | 176 | ||
177 | wlr_log(WLR_DEBUG, "Config stored for input %s", ic->identifier); | 177 | sway_log(SWAY_DEBUG, "Config stored for input %s", ic->identifier); |
178 | 178 | ||
179 | return ic; | 179 | return ic; |
180 | } | 180 | } |
diff --git a/sway/config/output.c b/sway/config/output.c index 8f59c863..ec833ffe 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -91,7 +91,7 @@ static void merge_wildcard_on_all(struct output_config *wildcard) { | |||
91 | for (int i = 0; i < config->output_configs->length; i++) { | 91 | for (int i = 0; i < config->output_configs->length; i++) { |
92 | struct output_config *oc = config->output_configs->items[i]; | 92 | struct output_config *oc = config->output_configs->items[i]; |
93 | if (strcmp(wildcard->name, oc->name) != 0) { | 93 | if (strcmp(wildcard->name, oc->name) != 0) { |
94 | wlr_log(WLR_DEBUG, "Merging output * config on %s", oc->name); | 94 | sway_log(SWAY_DEBUG, "Merging output * config on %s", oc->name); |
95 | merge_output_config(oc, wildcard); | 95 | merge_output_config(oc, wildcard); |
96 | } | 96 | } |
97 | } | 97 | } |
@@ -105,16 +105,16 @@ struct output_config *store_output_config(struct output_config *oc) { | |||
105 | 105 | ||
106 | int i = list_seq_find(config->output_configs, output_name_cmp, oc->name); | 106 | int i = list_seq_find(config->output_configs, output_name_cmp, oc->name); |
107 | if (i >= 0) { | 107 | if (i >= 0) { |
108 | wlr_log(WLR_DEBUG, "Merging on top of existing output config"); | 108 | sway_log(SWAY_DEBUG, "Merging on top of existing output config"); |
109 | struct output_config *current = config->output_configs->items[i]; | 109 | struct output_config *current = config->output_configs->items[i]; |
110 | merge_output_config(current, oc); | 110 | merge_output_config(current, oc); |
111 | free_output_config(oc); | 111 | free_output_config(oc); |
112 | oc = current; | 112 | oc = current; |
113 | } else if (!wildcard) { | 113 | } else if (!wildcard) { |
114 | wlr_log(WLR_DEBUG, "Adding non-wildcard output config"); | 114 | sway_log(SWAY_DEBUG, "Adding non-wildcard output config"); |
115 | i = list_seq_find(config->output_configs, output_name_cmp, "*"); | 115 | i = list_seq_find(config->output_configs, output_name_cmp, "*"); |
116 | if (i >= 0) { | 116 | if (i >= 0) { |
117 | wlr_log(WLR_DEBUG, "Merging on top of output * config"); | 117 | sway_log(SWAY_DEBUG, "Merging on top of output * config"); |
118 | struct output_config *current = new_output_config(oc->name); | 118 | struct output_config *current = new_output_config(oc->name); |
119 | merge_output_config(current, config->output_configs->items[i]); | 119 | merge_output_config(current, config->output_configs->items[i]); |
120 | merge_output_config(current, oc); | 120 | merge_output_config(current, oc); |
@@ -124,11 +124,11 @@ struct output_config *store_output_config(struct output_config *oc) { | |||
124 | list_add(config->output_configs, oc); | 124 | list_add(config->output_configs, oc); |
125 | } else { | 125 | } else { |
126 | // New wildcard config. Just add it | 126 | // New wildcard config. Just add it |
127 | wlr_log(WLR_DEBUG, "Adding output * config"); | 127 | sway_log(SWAY_DEBUG, "Adding output * config"); |
128 | list_add(config->output_configs, oc); | 128 | list_add(config->output_configs, oc); |
129 | } | 129 | } |
130 | 130 | ||
131 | wlr_log(WLR_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " | 131 | sway_log(SWAY_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " |
132 | "position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)", | 132 | "position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)", |
133 | oc->name, oc->enabled, oc->width, oc->height, oc->refresh_rate, | 133 | oc->name, oc->enabled, oc->width, oc->height, oc->refresh_rate, |
134 | oc->x, oc->y, oc->scale, oc->transform, oc->background, | 134 | oc->x, oc->y, oc->scale, oc->transform, oc->background, |
@@ -141,7 +141,7 @@ static bool set_mode(struct wlr_output *output, int width, int height, | |||
141 | float refresh_rate) { | 141 | float refresh_rate) { |
142 | int mhz = (int)(refresh_rate * 1000); | 142 | int mhz = (int)(refresh_rate * 1000); |
143 | if (wl_list_empty(&output->modes)) { | 143 | if (wl_list_empty(&output->modes)) { |
144 | wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name); | 144 | sway_log(SWAY_DEBUG, "Assigning custom mode to %s", output->name); |
145 | return wlr_output_set_custom_mode(output, width, height, mhz); | 145 | return wlr_output_set_custom_mode(output, width, height, mhz); |
146 | } | 146 | } |
147 | 147 | ||
@@ -156,11 +156,11 @@ static bool set_mode(struct wlr_output *output, int width, int height, | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | if (!best) { | 158 | if (!best) { |
159 | wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name); | 159 | sway_log(SWAY_ERROR, "Configured mode for %s not available", output->name); |
160 | wlr_log(WLR_INFO, "Picking default mode instead"); | 160 | sway_log(SWAY_INFO, "Picking default mode instead"); |
161 | best = wl_container_of(output->modes.prev, mode, link); | 161 | best = wl_container_of(output->modes.prev, mode, link); |
162 | } else { | 162 | } else { |
163 | wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); | 163 | sway_log(SWAY_DEBUG, "Assigning configured mode to %s", output->name); |
164 | } | 164 | } |
165 | return wlr_output_set_mode(output, best); | 165 | return wlr_output_set_mode(output, best); |
166 | } | 166 | } |
@@ -168,7 +168,7 @@ static bool set_mode(struct wlr_output *output, int width, int height, | |||
168 | void terminate_swaybg(pid_t pid) { | 168 | void terminate_swaybg(pid_t pid) { |
169 | int ret = kill(pid, SIGTERM); | 169 | int ret = kill(pid, SIGTERM); |
170 | if (ret != 0) { | 170 | if (ret != 0) { |
171 | wlr_log(WLR_ERROR, "Unable to terminate swaybg [pid: %d]", pid); | 171 | sway_log(SWAY_ERROR, "Unable to terminate swaybg [pid: %d]", pid); |
172 | } else { | 172 | } else { |
173 | int status; | 173 | int status; |
174 | waitpid(pid, &status, 0); | 174 | waitpid(pid, &status, 0); |
@@ -197,7 +197,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
197 | 197 | ||
198 | bool modeset_success; | 198 | bool modeset_success; |
199 | if (oc && oc->width > 0 && oc->height > 0) { | 199 | if (oc && oc->width > 0 && oc->height > 0) { |
200 | wlr_log(WLR_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, | 200 | sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, |
201 | oc->height, oc->refresh_rate); | 201 | oc->height, oc->refresh_rate); |
202 | modeset_success = | 202 | modeset_success = |
203 | set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); | 203 | set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); |
@@ -213,22 +213,22 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
213 | // Failed to modeset, maybe the output is missing a CRTC. Leave the | 213 | // Failed to modeset, maybe the output is missing a CRTC. Leave the |
214 | // output disabled for now and try again when the output gets the mode | 214 | // output disabled for now and try again when the output gets the mode |
215 | // we asked for. | 215 | // we asked for. |
216 | wlr_log(WLR_ERROR, "Failed to modeset output %s", wlr_output->name); | 216 | sway_log(SWAY_ERROR, "Failed to modeset output %s", wlr_output->name); |
217 | return false; | 217 | return false; |
218 | } | 218 | } |
219 | 219 | ||
220 | if (oc && oc->scale > 0) { | 220 | if (oc && oc->scale > 0) { |
221 | wlr_log(WLR_DEBUG, "Set %s scale to %f", oc->name, oc->scale); | 221 | sway_log(SWAY_DEBUG, "Set %s scale to %f", oc->name, oc->scale); |
222 | wlr_output_set_scale(wlr_output, oc->scale); | 222 | wlr_output_set_scale(wlr_output, oc->scale); |
223 | } | 223 | } |
224 | if (oc && oc->transform >= 0) { | 224 | if (oc && oc->transform >= 0) { |
225 | wlr_log(WLR_DEBUG, "Set %s transform to %d", oc->name, oc->transform); | 225 | sway_log(SWAY_DEBUG, "Set %s transform to %d", oc->name, oc->transform); |
226 | wlr_output_set_transform(wlr_output, oc->transform); | 226 | wlr_output_set_transform(wlr_output, oc->transform); |
227 | } | 227 | } |
228 | 228 | ||
229 | // Find position for it | 229 | // Find position for it |
230 | if (oc && (oc->x != -1 || oc->y != -1)) { | 230 | if (oc && (oc->x != -1 || oc->y != -1)) { |
231 | wlr_log(WLR_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); | 231 | sway_log(SWAY_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); |
232 | wlr_output_layout_add(root->output_layout, wlr_output, oc->x, oc->y); | 232 | wlr_output_layout_add(root->output_layout, wlr_output, oc->x, oc->y); |
233 | } else { | 233 | } else { |
234 | wlr_output_layout_add_auto(root->output_layout, wlr_output); | 234 | wlr_output_layout_add_auto(root->output_layout, wlr_output); |
@@ -238,7 +238,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
238 | terminate_swaybg(output->bg_pid); | 238 | terminate_swaybg(output->bg_pid); |
239 | } | 239 | } |
240 | if (oc && oc->background && config->swaybg_command) { | 240 | if (oc && oc->background && config->swaybg_command) { |
241 | wlr_log(WLR_DEBUG, "Setting background for output %s to %s", | 241 | sway_log(SWAY_DEBUG, "Setting background for output %s to %s", |
242 | wlr_output->name, oc->background); | 242 | wlr_output->name, oc->background); |
243 | 243 | ||
244 | char *const cmd[] = { | 244 | char *const cmd[] = { |
@@ -252,21 +252,21 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
252 | 252 | ||
253 | output->bg_pid = fork(); | 253 | output->bg_pid = fork(); |
254 | if (output->bg_pid < 0) { | 254 | if (output->bg_pid < 0) { |
255 | wlr_log_errno(WLR_ERROR, "fork failed"); | 255 | sway_log_errno(SWAY_ERROR, "fork failed"); |
256 | } else if (output->bg_pid == 0) { | 256 | } else if (output->bg_pid == 0) { |
257 | execvp(cmd[0], cmd); | 257 | execvp(cmd[0], cmd); |
258 | wlr_log_errno(WLR_ERROR, "Failed to execute swaybg"); | 258 | sway_log_errno(SWAY_ERROR, "Failed to execute swaybg"); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
262 | if (oc) { | 262 | if (oc) { |
263 | switch (oc->dpms_state) { | 263 | switch (oc->dpms_state) { |
264 | case DPMS_ON: | 264 | case DPMS_ON: |
265 | wlr_log(WLR_DEBUG, "Turning on screen"); | 265 | sway_log(SWAY_DEBUG, "Turning on screen"); |
266 | wlr_output_enable(wlr_output, true); | 266 | wlr_output_enable(wlr_output, true); |
267 | break; | 267 | break; |
268 | case DPMS_OFF: | 268 | case DPMS_OFF: |
269 | wlr_log(WLR_DEBUG, "Turning off screen"); | 269 | sway_log(SWAY_DEBUG, "Turning off screen"); |
270 | wlr_output_enable(wlr_output, false); | 270 | wlr_output_enable(wlr_output, false); |
271 | break; | 271 | break; |
272 | case DPMS_IGNORE: | 272 | case DPMS_IGNORE: |
@@ -325,7 +325,7 @@ static struct output_config *get_output_config(char *identifier, | |||
325 | merge_output_config(result, oc_name); | 325 | merge_output_config(result, oc_name); |
326 | merge_output_config(result, oc_id); | 326 | merge_output_config(result, oc_id); |
327 | 327 | ||
328 | wlr_log(WLR_DEBUG, "Generated output config \"%s\" (enabled: %d)" | 328 | sway_log(SWAY_DEBUG, "Generated output config \"%s\" (enabled: %d)" |
329 | " (%dx%d@%fHz position %d,%d scale %f transform %d) (bg %s %s)" | 329 | " (%dx%d@%fHz position %d,%d scale %f transform %d) (bg %s %s)" |
330 | " (dpms %d)", result->name, result->enabled, result->width, | 330 | " (dpms %d)", result->name, result->enabled, result->width, |
331 | result->height, result->refresh_rate, result->x, result->y, | 331 | result->height, result->refresh_rate, result->x, result->y, |
diff --git a/sway/config/seat.c b/sway/config/seat.c index d7316c68..92dc42e3 100644 --- a/sway/config/seat.c +++ b/sway/config/seat.c | |||
@@ -7,7 +7,7 @@ | |||
7 | struct seat_config *new_seat_config(const char* name) { | 7 | struct seat_config *new_seat_config(const char* name) { |
8 | struct seat_config *seat = calloc(1, sizeof(struct seat_config)); | 8 | struct seat_config *seat = calloc(1, sizeof(struct seat_config)); |
9 | if (!seat) { | 9 | if (!seat) { |
10 | wlr_log(WLR_DEBUG, "Unable to allocate seat config"); | 10 | sway_log(SWAY_DEBUG, "Unable to allocate seat config"); |
11 | return NULL; | 11 | return NULL; |
12 | } | 12 | } |
13 | 13 | ||
@@ -34,7 +34,7 @@ static void merge_wildcard_on_all(struct seat_config *wildcard) { | |||
34 | for (int i = 0; i < config->seat_configs->length; i++) { | 34 | for (int i = 0; i < config->seat_configs->length; i++) { |
35 | struct seat_config *sc = config->seat_configs->items[i]; | 35 | struct seat_config *sc = config->seat_configs->items[i]; |
36 | if (strcmp(wildcard->name, sc->name) != 0) { | 36 | if (strcmp(wildcard->name, sc->name) != 0) { |
37 | wlr_log(WLR_DEBUG, "Merging seat * config on %s", sc->name); | 37 | sway_log(SWAY_DEBUG, "Merging seat * config on %s", sc->name); |
38 | merge_seat_config(sc, wildcard); | 38 | merge_seat_config(sc, wildcard); |
39 | } | 39 | } |
40 | } | 40 | } |
@@ -48,16 +48,16 @@ struct seat_config *store_seat_config(struct seat_config *sc) { | |||
48 | 48 | ||
49 | int i = list_seq_find(config->seat_configs, seat_name_cmp, sc->name); | 49 | int i = list_seq_find(config->seat_configs, seat_name_cmp, sc->name); |
50 | if (i >= 0) { | 50 | if (i >= 0) { |
51 | wlr_log(WLR_DEBUG, "Merging on top of existing seat config"); | 51 | sway_log(SWAY_DEBUG, "Merging on top of existing seat config"); |
52 | struct seat_config *current = config->seat_configs->items[i]; | 52 | struct seat_config *current = config->seat_configs->items[i]; |
53 | merge_seat_config(current, sc); | 53 | merge_seat_config(current, sc); |
54 | free_seat_config(sc); | 54 | free_seat_config(sc); |
55 | sc = current; | 55 | sc = current; |
56 | } else if (!wildcard) { | 56 | } else if (!wildcard) { |
57 | wlr_log(WLR_DEBUG, "Adding non-wildcard seat config"); | 57 | sway_log(SWAY_DEBUG, "Adding non-wildcard seat config"); |
58 | i = list_seq_find(config->seat_configs, seat_name_cmp, "*"); | 58 | i = list_seq_find(config->seat_configs, seat_name_cmp, "*"); |
59 | if (i >= 0) { | 59 | if (i >= 0) { |
60 | wlr_log(WLR_DEBUG, "Merging on top of seat * config"); | 60 | sway_log(SWAY_DEBUG, "Merging on top of seat * config"); |
61 | struct seat_config *current = new_seat_config(sc->name); | 61 | struct seat_config *current = new_seat_config(sc->name); |
62 | merge_seat_config(current, config->seat_configs->items[i]); | 62 | merge_seat_config(current, config->seat_configs->items[i]); |
63 | merge_seat_config(current, sc); | 63 | merge_seat_config(current, sc); |
@@ -67,11 +67,11 @@ struct seat_config *store_seat_config(struct seat_config *sc) { | |||
67 | list_add(config->seat_configs, sc); | 67 | list_add(config->seat_configs, sc); |
68 | } else { | 68 | } else { |
69 | // New wildcard config. Just add it | 69 | // New wildcard config. Just add it |
70 | wlr_log(WLR_DEBUG, "Adding seat * config"); | 70 | sway_log(SWAY_DEBUG, "Adding seat * config"); |
71 | list_add(config->seat_configs, sc); | 71 | list_add(config->seat_configs, sc); |
72 | } | 72 | } |
73 | 73 | ||
74 | wlr_log(WLR_DEBUG, "Config stored for seat %s", sc->name); | 74 | sway_log(SWAY_DEBUG, "Config stored for seat %s", sc->name); |
75 | 75 | ||
76 | return sc; | 76 | return sc; |
77 | } | 77 | } |
@@ -80,7 +80,7 @@ struct seat_attachment_config *seat_attachment_config_new(void) { | |||
80 | struct seat_attachment_config *attachment = | 80 | struct seat_attachment_config *attachment = |
81 | calloc(1, sizeof(struct seat_attachment_config)); | 81 | calloc(1, sizeof(struct seat_attachment_config)); |
82 | if (!attachment) { | 82 | if (!attachment) { |
83 | wlr_log(WLR_DEBUG, "cannot allocate attachment config"); | 83 | sway_log(SWAY_DEBUG, "cannot allocate attachment config"); |
84 | return NULL; | 84 | return NULL; |
85 | } | 85 | } |
86 | return attachment; | 86 | return attachment; |