aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config/input.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /sway/config/input.c
parentLog libinput_config_status errors (diff)
downloadsway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'sway/config/input.c')
-rw-r--r--sway/config/input.c18
1 files changed, 9 insertions, 9 deletions
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 @@
8struct input_config *new_input_config(const char* identifier) { 8struct input_config *new_input_config(const char* identifier) {
9 struct input_config *input = calloc(1, sizeof(struct input_config)); 9 struct input_config *input = calloc(1, sizeof(struct input_config));
10 if (!input) { 10 if (!input) {
11 wlr_log(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}