diff options
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 068fb39c..07534620 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -40,7 +40,7 @@ static void output_layout_change_notify(struct wl_listener *listener, void *data | |||
40 | output_container->height = output_box->height; | 40 | output_container->height = output_box->height; |
41 | } | 41 | } |
42 | 42 | ||
43 | arrange_windows(&root_container, -1, -1); | 43 | container_arrange_windows(&root_container, -1, -1); |
44 | } | 44 | } |
45 | 45 | ||
46 | void init_layout(void) { | 46 | void init_layout(void) { |
@@ -79,7 +79,7 @@ static int index_child(const struct sway_container *child) { | |||
79 | return i; | 79 | return i; |
80 | } | 80 | } |
81 | 81 | ||
82 | struct sway_container *add_sibling(struct sway_container *fixed, struct sway_container *active) { | 82 | struct sway_container *container_add_sibling(struct sway_container *fixed, struct sway_container *active) { |
83 | // TODO handle floating | 83 | // TODO handle floating |
84 | struct sway_container *parent = fixed->parent; | 84 | struct sway_container *parent = fixed->parent; |
85 | int i = index_child(fixed); | 85 | int i = index_child(fixed); |
@@ -88,7 +88,7 @@ struct sway_container *add_sibling(struct sway_container *fixed, struct sway_con | |||
88 | return active->parent; | 88 | return active->parent; |
89 | } | 89 | } |
90 | 90 | ||
91 | void add_child(struct sway_container *parent, struct sway_container *child) { | 91 | void container_add_child(struct sway_container *parent, struct sway_container *child) { |
92 | wlr_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)", | 92 | wlr_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)", |
93 | child, child->type, child->width, child->height, | 93 | child, child->type, child->width, child->height, |
94 | parent, parent->type, parent->width, parent->height); | 94 | parent, parent->type, parent->width, parent->height); |
@@ -102,7 +102,7 @@ void add_child(struct sway_container *parent, struct sway_container *child) { | |||
102 | */ | 102 | */ |
103 | } | 103 | } |
104 | 104 | ||
105 | struct sway_container *remove_child(struct sway_container *child) { | 105 | struct sway_container *container_remove_child(struct sway_container *child) { |
106 | int i; | 106 | int i; |
107 | struct sway_container *parent = child->parent; | 107 | struct sway_container *parent = child->parent; |
108 | for (i = 0; i < parent->children->length; ++i) { | 108 | for (i = 0; i < parent->children->length; ++i) { |
@@ -115,7 +115,7 @@ struct sway_container *remove_child(struct sway_container *child) { | |||
115 | return parent; | 115 | return parent; |
116 | } | 116 | } |
117 | 117 | ||
118 | enum sway_container_layout default_layout(struct sway_container *output) { | 118 | enum sway_container_layout container_get_default_layout(struct sway_container *output) { |
119 | /* TODO WLR | 119 | /* TODO WLR |
120 | if (config->default_layout != L_NONE) { | 120 | if (config->default_layout != L_NONE) { |
121 | //return config->default_layout; | 121 | //return config->default_layout; |
@@ -146,7 +146,7 @@ static int sort_workspace_cmp_qsort(const void *_a, const void *_b) { | |||
146 | return retval; | 146 | return retval; |
147 | } | 147 | } |
148 | 148 | ||
149 | void sort_workspaces(struct sway_container *output) { | 149 | void container_sort_workspaces(struct sway_container *output) { |
150 | list_stable_sort(output->children, sort_workspace_cmp_qsort); | 150 | list_stable_sort(output->children, sort_workspace_cmp_qsort); |
151 | } | 151 | } |
152 | 152 | ||
@@ -160,7 +160,7 @@ static void apply_vert_layout(struct sway_container *container, const double x, | |||
160 | const double height, const int start, | 160 | const double height, const int start, |
161 | const int end); | 161 | const int end); |
162 | 162 | ||
163 | void arrange_windows(struct sway_container *container, double width, double height) { | 163 | void container_arrange_windows(struct sway_container *container, double width, double height) { |
164 | int i; | 164 | int i; |
165 | if (width == -1 || height == -1) { | 165 | if (width == -1 || height == -1) { |
166 | width = container->width; | 166 | width = container->width; |
@@ -184,7 +184,7 @@ void arrange_windows(struct sway_container *container, double width, double heig | |||
184 | struct sway_container *output = container->children->items[i]; | 184 | struct sway_container *output = container->children->items[i]; |
185 | wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", | 185 | wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", |
186 | output->name, output->x, output->y); | 186 | output->name, output->x, output->y); |
187 | arrange_windows(output, -1, -1); | 187 | container_arrange_windows(output, -1, -1); |
188 | } | 188 | } |
189 | return; | 189 | return; |
190 | case C_OUTPUT: | 190 | case C_OUTPUT: |
@@ -198,12 +198,12 @@ void arrange_windows(struct sway_container *container, double width, double heig | |||
198 | // arrange all workspaces: | 198 | // arrange all workspaces: |
199 | for (i = 0; i < container->children->length; ++i) { | 199 | for (i = 0; i < container->children->length; ++i) { |
200 | struct sway_container *child = container->children->items[i]; | 200 | struct sway_container *child = container->children->items[i]; |
201 | arrange_windows(child, -1, -1); | 201 | container_arrange_windows(child, -1, -1); |
202 | } | 202 | } |
203 | return; | 203 | return; |
204 | case C_WORKSPACE: | 204 | case C_WORKSPACE: |
205 | { | 205 | { |
206 | struct sway_container *output = sway_container_parent(container, C_OUTPUT); | 206 | struct sway_container *output = container_parent(container, C_OUTPUT); |
207 | struct wlr_box *area = &output->sway_output->usable_area; | 207 | struct wlr_box *area = &output->sway_output->usable_area; |
208 | wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", | 208 | wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", |
209 | area->width, area->height, area->x, area->y); | 209 | area->width, area->height, area->x, area->y); |
@@ -284,9 +284,9 @@ static void apply_horiz_layout(struct sway_container *container, | |||
284 | 284 | ||
285 | if (i == end - 1) { | 285 | if (i == end - 1) { |
286 | double remaining_width = x + width - child_x; | 286 | double remaining_width = x + width - child_x; |
287 | arrange_windows(child, remaining_width, height); | 287 | container_arrange_windows(child, remaining_width, height); |
288 | } else { | 288 | } else { |
289 | arrange_windows(child, child->width * scale, height); | 289 | container_arrange_windows(child, child->width * scale, height); |
290 | } | 290 | } |
291 | child_x += child->width; | 291 | child_x += child->width; |
292 | } | 292 | } |
@@ -334,9 +334,9 @@ void apply_vert_layout(struct sway_container *container, | |||
334 | 334 | ||
335 | if (i == end - 1) { | 335 | if (i == end - 1) { |
336 | double remaining_height = y + height - child_y; | 336 | double remaining_height = y + height - child_y; |
337 | arrange_windows(child, width, remaining_height); | 337 | container_arrange_windows(child, width, remaining_height); |
338 | } else { | 338 | } else { |
339 | arrange_windows(child, width, child->height * scale); | 339 | container_arrange_windows(child, width, child->height * scale); |
340 | } | 340 | } |
341 | child_y += child->height; | 341 | child_y += child->height; |
342 | } | 342 | } |
@@ -362,7 +362,7 @@ static struct sway_container *get_swayc_in_output_direction(struct sway_containe | |||
362 | 362 | ||
363 | struct sway_container *ws = sway_seat_get_focus_inactive(seat, output); | 363 | struct sway_container *ws = sway_seat_get_focus_inactive(seat, output); |
364 | if (ws->type != C_WORKSPACE) { | 364 | if (ws->type != C_WORKSPACE) { |
365 | ws = sway_container_parent(ws, C_WORKSPACE); | 365 | ws = container_parent(ws, C_WORKSPACE); |
366 | } | 366 | } |
367 | 367 | ||
368 | if (ws == NULL) { | 368 | if (ws == NULL) { |
@@ -410,7 +410,7 @@ static void get_layout_center_position(struct sway_container *container, int *x, | |||
410 | *x = container->x + container->width/2; | 410 | *x = container->x + container->width/2; |
411 | *y = container->y + container->height/2; | 411 | *y = container->y + container->height/2; |
412 | } else { | 412 | } else { |
413 | struct sway_container *output = sway_container_parent(container, C_OUTPUT); | 413 | struct sway_container *output = container_parent(container, C_OUTPUT); |
414 | if (container->type == C_WORKSPACE) { | 414 | if (container->type == C_WORKSPACE) { |
415 | // Workspace coordinates are actually wrong/arbitrary, but should | 415 | // Workspace coordinates are actually wrong/arbitrary, but should |
416 | // be same as output. | 416 | // be same as output. |
@@ -496,7 +496,7 @@ static struct sway_container *get_swayc_in_direction_under(struct sway_container | |||
496 | /* | 496 | /* |
497 | if (container->type == C_VIEW && swayc_is_fullscreen(container)) { | 497 | if (container->type == C_VIEW && swayc_is_fullscreen(container)) { |
498 | wlr_log(L_DEBUG, "Moving from fullscreen view, skipping to output"); | 498 | wlr_log(L_DEBUG, "Moving from fullscreen view, skipping to output"); |
499 | container = sway_container_parent(container, C_OUTPUT); | 499 | container = container_parent(container, C_OUTPUT); |
500 | get_layout_center_position(container, &abs_pos); | 500 | get_layout_center_position(container, &abs_pos); |
501 | struct sway_container *output = swayc_adjacent_output(container, dir, &abs_pos, true); | 501 | struct sway_container *output = swayc_adjacent_output(container, dir, &abs_pos, true); |
502 | return get_swayc_in_output_direction(output, dir); | 502 | return get_swayc_in_output_direction(output, dir); |