sway: change all sway_log to wlr_log

This commit is contained in:
Dominique Martinet 2018-01-05 22:32:51 +01:00
parent fdc92e7454
commit 67985e9031
36 changed files with 167 additions and 190 deletions

View file

@ -92,11 +92,11 @@ swayc_t *new_output(struct sway_output *sway_output) {
if (strcasecmp(name, cur->name) == 0 ||
strcasecmp(identifier, cur->name) == 0) {
sway_log(L_DEBUG, "Matched output config for %s", name);
wlr_log(L_DEBUG, "Matched output config for %s", name);
oc = cur;
}
if (strcasecmp("*", cur->name) == 0) {
sway_log(L_DEBUG, "Matched wildcard output config for %s", name);
wlr_log(L_DEBUG, "Matched wildcard output config for %s", name);
all = cur;
}
@ -126,7 +126,7 @@ swayc_t *new_output(struct sway_output *sway_output) {
// Create workspace
char *ws_name = workspace_next_name(output->name);
sway_log(L_DEBUG, "Creating default workspace %s", ws_name);
wlr_log(L_DEBUG, "Creating default workspace %s", ws_name);
new_workspace(output, ws_name);
free(ws_name);
return output;
@ -136,7 +136,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) {
if (!sway_assert(output, "new_workspace called with null output")) {
return NULL;
}
sway_log(L_DEBUG, "Added workspace %s for output %s", name, output->name);
wlr_log(L_DEBUG, "Added workspace %s for output %s", name, output->name);
swayc_t *workspace = new_swayc(C_WORKSPACE);
workspace->x = output->x;
@ -159,7 +159,7 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) {
}
const char *title = sway_view->iface.get_prop(sway_view, VIEW_PROP_TITLE);
swayc_t *swayc = new_swayc(C_VIEW);
sway_log(L_DEBUG, "Adding new view %p:%s to container %p %d",
wlr_log(L_DEBUG, "Adding new view %p:%s to container %p %d",
swayc, title, sibling, sibling ? sibling->type : 0);
// Setup values
swayc->sway_view = sway_view;
@ -200,7 +200,7 @@ swayc_t *destroy_output(swayc_t *output) {
}
}
sway_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name);
wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name);
free_swayc(output);
return &root_container;
@ -210,7 +210,7 @@ swayc_t *destroy_view(swayc_t *view) {
if (!sway_assert(view, "null view passed to destroy_view")) {
return NULL;
}
sway_log(L_DEBUG, "Destroying view '%s'", view->name);
wlr_log(L_DEBUG, "Destroying view '%s'", view->name);
swayc_t *parent = view->parent;
free_swayc(view);

View file

@ -59,7 +59,7 @@ void init_layout(void) {
}
void add_child(swayc_t *parent, swayc_t *child) {
sway_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)",
wlr_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)",
child, child->type, child->width, child->height,
parent, parent->type, parent->width, parent->height);
list_add(parent->children, child);
@ -145,7 +145,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
width = floor(width);
height = floor(height);
sway_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", container,
wlr_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", container,
container->name, container->width, container->height, container->x,
container->y);
@ -155,7 +155,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
// TODO: wlr_output_layout probably
for (i = 0; i < container->children->length; ++i) {
swayc_t *output = container->children->items[i];
sway_log(L_DEBUG, "Arranging output '%s' at %f,%f",
wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f",
output->name, output->x, output->y);
arrange_windows(output, -1, -1);
}
@ -181,7 +181,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
container->height = output->height;
container->x = x;
container->y = y;
sway_log(L_DEBUG, "Arranging workspace '%s' at %f, %f",
wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f",
container->name, container->x, container->y);
}
// children are properly handled below
@ -192,7 +192,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
container->height = height;
container->sway_view->iface.set_size(container->sway_view,
container->width, container->height);
sway_log(L_DEBUG, "Set view to %.f x %.f @ %.f, %.f",
wlr_log(L_DEBUG, "Set view to %.f x %.f @ %.f, %.f",
container->width, container->height,
container->x, container->y);
}
@ -215,7 +215,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
container->children->length);
break;
default:
sway_log(L_DEBUG, "TODO: arrange layout type %d", container->layout);
wlr_log(L_DEBUG, "TODO: arrange layout type %d", container->layout);
apply_horiz_layout(container, x, y, width, height, 0,
container->children->length);
break;
@ -244,10 +244,10 @@ static void apply_horiz_layout(swayc_t *container,
// Resize windows
double child_x = x;
if (scale > 0.1) {
sway_log(L_DEBUG, "Arranging %p horizontally", container);
wlr_log(L_DEBUG, "Arranging %p horizontally", container);
for (int i = start; i < end; ++i) {
swayc_t *child = container->children->items[i];
sway_log(L_DEBUG,
wlr_log(L_DEBUG,
"Calculating arrangement for %p:%d (will scale %f by %f)",
child, child->type, width, scale);
child->sway_view->iface.set_position(child->sway_view, child_x, y);
@ -294,10 +294,10 @@ void apply_vert_layout(swayc_t *container,
// Resize
double child_y = y;
if (scale > 0.1) {
sway_log(L_DEBUG, "Arranging %p vertically", container);
wlr_log(L_DEBUG, "Arranging %p vertically", container);
for (i = start; i < end; ++i) {
swayc_t *child = container->children->items[i];
sway_log(L_DEBUG,
wlr_log(L_DEBUG,
"Calculating arrangement for %p:%d (will scale %f by %f)",
child, child->type, height, scale);
child->sway_view->iface.set_position(child->sway_view, x, child_y);

View file

@ -11,7 +11,7 @@ void next_name_map(swayc_t *ws, void *data) {
}
char *workspace_next_name(const char *output_name) {
sway_log(L_DEBUG, "Workspace: Generating new workspace name for output %s",
wlr_log(L_DEBUG, "Workspace: Generating new workspace name for output %s",
output_name);
int count = 0;
next_name_map(&root_container, &count);