aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/root.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/tree/root.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/tree/root.c')
-rw-r--r--sway/tree/root.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c
index e5df8dd1..08ce7942 100644
--- a/sway/tree/root.c
+++ b/sway/tree/root.c
@@ -26,7 +26,7 @@ static void output_layout_handle_change(struct wl_listener *listener,
26struct sway_root *root_create(void) { 26struct sway_root *root_create(void) {
27 struct sway_root *root = calloc(1, sizeof(struct sway_root)); 27 struct sway_root *root = calloc(1, sizeof(struct sway_root));
28 if (!root) { 28 if (!root) {
29 wlr_log(WLR_ERROR, "Unable to allocate sway_root"); 29 sway_log(SWAY_ERROR, "Unable to allocate sway_root");
30 return NULL; 30 return NULL;
31 } 31 }
32 node_init(&root->node, N_ROOT, root); 32 node_init(&root->node, N_ROOT, root);
@@ -178,14 +178,14 @@ struct sway_workspace *root_workspace_for_pid(pid_t pid) {
178 struct sway_workspace *ws = NULL; 178 struct sway_workspace *ws = NULL;
179 struct pid_workspace *pw = NULL; 179 struct pid_workspace *pw = NULL;
180 180
181 wlr_log(WLR_DEBUG, "Looking up workspace for pid %d", pid); 181 sway_log(SWAY_DEBUG, "Looking up workspace for pid %d", pid);
182 182
183 do { 183 do {
184 struct pid_workspace *_pw = NULL; 184 struct pid_workspace *_pw = NULL;
185 wl_list_for_each(_pw, &pid_workspaces, link) { 185 wl_list_for_each(_pw, &pid_workspaces, link) {
186 if (pid == _pw->pid) { 186 if (pid == _pw->pid) {
187 pw = _pw; 187 pw = _pw;
188 wlr_log(WLR_DEBUG, 188 sway_log(SWAY_DEBUG,
189 "found pid_workspace for pid %d, workspace %s", 189 "found pid_workspace for pid %d, workspace %s",
190 pid, pw->workspace); 190 pid, pw->workspace);
191 goto found; 191 goto found;
@@ -199,7 +199,7 @@ found:
199 ws = workspace_by_name(pw->workspace); 199 ws = workspace_by_name(pw->workspace);
200 200
201 if (!ws) { 201 if (!ws) {
202 wlr_log(WLR_DEBUG, 202 sway_log(SWAY_DEBUG,
203 "Creating workspace %s for pid %d because it disappeared", 203 "Creating workspace %s for pid %d because it disappeared",
204 pw->workspace, pid); 204 pw->workspace, pid);
205 ws = workspace_create(pw->output, pw->workspace); 205 ws = workspace_create(pw->output, pw->workspace);
@@ -222,7 +222,7 @@ static void pw_handle_output_destroy(struct wl_listener *listener, void *data) {
222} 222}
223 223
224void root_record_workspace_pid(pid_t pid) { 224void root_record_workspace_pid(pid_t pid) {
225 wlr_log(WLR_DEBUG, "Recording workspace for process %d", pid); 225 sway_log(SWAY_DEBUG, "Recording workspace for process %d", pid);
226 if (!pid_workspaces.prev && !pid_workspaces.next) { 226 if (!pid_workspaces.prev && !pid_workspaces.next) {
227 wl_list_init(&pid_workspaces); 227 wl_list_init(&pid_workspaces);
228 } 228 }
@@ -230,12 +230,12 @@ void root_record_workspace_pid(pid_t pid) {
230 struct sway_seat *seat = input_manager_current_seat(); 230 struct sway_seat *seat = input_manager_current_seat();
231 struct sway_workspace *ws = seat_get_focused_workspace(seat); 231 struct sway_workspace *ws = seat_get_focused_workspace(seat);
232 if (!ws) { 232 if (!ws) {
233 wlr_log(WLR_DEBUG, "Bailing out, no workspace"); 233 sway_log(SWAY_DEBUG, "Bailing out, no workspace");
234 return; 234 return;
235 } 235 }
236 struct sway_output *output = ws->output; 236 struct sway_output *output = ws->output;
237 if (!output) { 237 if (!output) {
238 wlr_log(WLR_DEBUG, "Bailing out, no output"); 238 sway_log(SWAY_DEBUG, "Bailing out, no output");
239 return; 239 return;
240 } 240 }
241 241