mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 06:46:27 -04:00
Update for swaywm/wlroots#1126
This commit is contained in:
parent
ebcdce457a
commit
63b4bf5000
85 changed files with 391 additions and 385 deletions
|
|
@ -47,11 +47,11 @@ static void apply_horiz_layout(struct sway_container *parent) {
|
|||
double scale = parent->width / total_width;
|
||||
|
||||
// Resize windows
|
||||
wlr_log(L_DEBUG, "Arranging %p horizontally", parent);
|
||||
wlr_log(WLR_DEBUG, "Arranging %p horizontally", parent);
|
||||
double child_x = parent->x;
|
||||
for (size_t i = 0; i < num_children; ++i) {
|
||||
struct sway_container *child = parent->children->items[i];
|
||||
wlr_log(L_DEBUG,
|
||||
wlr_log(WLR_DEBUG,
|
||||
"Calculating arrangement for %p:%d (will scale %f by %f)",
|
||||
child, child->type, child->width, scale);
|
||||
child->x = child_x;
|
||||
|
|
@ -99,11 +99,11 @@ static void apply_vert_layout(struct sway_container *parent) {
|
|||
double scale = parent_height / total_height;
|
||||
|
||||
// Resize
|
||||
wlr_log(L_DEBUG, "Arranging %p vertically", parent);
|
||||
wlr_log(WLR_DEBUG, "Arranging %p vertically", parent);
|
||||
double child_y = parent->y + parent_offset;
|
||||
for (size_t i = 0; i < num_children; ++i) {
|
||||
struct sway_container *child = parent->children->items[i];
|
||||
wlr_log(L_DEBUG,
|
||||
wlr_log(WLR_DEBUG,
|
||||
"Calculating arrangement for %p:%d (will scale %f by %f)",
|
||||
child, child->type, child->height, scale);
|
||||
child->x = parent->x;
|
||||
|
|
@ -179,7 +179,7 @@ static void arrange_children_of(struct sway_container *parent,
|
|||
if (config->reloading) {
|
||||
return;
|
||||
}
|
||||
wlr_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", parent,
|
||||
wlr_log(WLR_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", parent,
|
||||
parent->name, parent->width, parent->height, parent->x, parent->y);
|
||||
|
||||
// Calculate x, y, width and height of children
|
||||
|
|
@ -226,7 +226,7 @@ static void arrange_workspace(struct sway_container *workspace,
|
|||
}
|
||||
struct sway_container *output = workspace->parent;
|
||||
struct wlr_box *area = &output->sway_output->usable_area;
|
||||
wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d",
|
||||
wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d",
|
||||
area->width, area->height, area->x, area->y);
|
||||
remove_gaps(workspace);
|
||||
workspace->width = area->width;
|
||||
|
|
@ -235,7 +235,7 @@ static void arrange_workspace(struct sway_container *workspace,
|
|||
workspace->y = output->y + area->y;
|
||||
add_gaps(workspace);
|
||||
transaction_add_container(transaction, workspace);
|
||||
wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name,
|
||||
wlr_log(WLR_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name,
|
||||
workspace->x, workspace->y);
|
||||
arrange_floating(workspace->sway_workspace->floating, transaction);
|
||||
arrange_children_of(workspace, transaction);
|
||||
|
|
@ -254,7 +254,7 @@ static void arrange_output(struct sway_container *output,
|
|||
output->width = output_box->width;
|
||||
output->height = output_box->height;
|
||||
transaction_add_container(transaction, output);
|
||||
wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f",
|
||||
wlr_log(WLR_DEBUG, "Arranging output '%s' at %f,%f",
|
||||
output->name, output->x, output->y);
|
||||
for (int i = 0; i < output->children->length; ++i) {
|
||||
struct sway_container *workspace = output->children->items[i];
|
||||
|
|
@ -315,7 +315,7 @@ void arrange_and_commit(struct sway_container *container) {
|
|||
|
||||
void remove_gaps(struct sway_container *c) {
|
||||
if (c->current_gaps == 0) {
|
||||
wlr_log(L_DEBUG, "Removing gaps: not gapped: %p", c);
|
||||
wlr_log(WLR_DEBUG, "Removing gaps: not gapped: %p", c);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -326,12 +326,12 @@ void remove_gaps(struct sway_container *c) {
|
|||
|
||||
c->current_gaps = 0;
|
||||
|
||||
wlr_log(L_DEBUG, "Removing gaps %p", c);
|
||||
wlr_log(WLR_DEBUG, "Removing gaps %p", c);
|
||||
}
|
||||
|
||||
void add_gaps(struct sway_container *c) {
|
||||
if (c->current_gaps > 0 || c->type == C_CONTAINER) {
|
||||
wlr_log(L_DEBUG, "Not adding gaps: %p", c);
|
||||
wlr_log(WLR_DEBUG, "Not adding gaps: %p", c);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -348,5 +348,5 @@ void add_gaps(struct sway_container *c) {
|
|||
c->height -= 2 * gaps;
|
||||
c->current_gaps = gaps;
|
||||
|
||||
wlr_log(L_DEBUG, "Adding gaps: %p", c);
|
||||
wlr_log(WLR_DEBUG, "Adding gaps: %p", c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue