aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config/seat.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/seat.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/seat.c')
-rw-r--r--sway/config/seat.c16
1 files changed, 8 insertions, 8 deletions
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 @@
7struct seat_config *new_seat_config(const char* name) { 7struct seat_config *new_seat_config(const char* name) {
8 struct seat_config *seat = calloc(1, sizeof(struct seat_config)); 8 struct seat_config *seat = calloc(1, sizeof(struct seat_config));
9 if (!seat) { 9 if (!seat) {
10 wlr_log(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;