mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
More container fixes
This commit is contained in:
parent
e34ef65fd9
commit
2c49efc12c
3 changed files with 19 additions and 13 deletions
|
|
@ -92,6 +92,9 @@ struct sway_output *workspace_output_get_highest_available(
|
||||||
|
|
||||||
void workspace_detect_urgent(struct sway_workspace *workspace);
|
void workspace_detect_urgent(struct sway_workspace *workspace);
|
||||||
|
|
||||||
|
void workspace_for_each_tiling_container(struct sway_workspace *ws,
|
||||||
|
void (*f)(struct sway_container *con, void *data), void *data);
|
||||||
|
|
||||||
void workspace_for_each_container(struct sway_workspace *ws,
|
void workspace_for_each_container(struct sway_workspace *ws,
|
||||||
void (*f)(struct sway_container *con, void *data), void *data);
|
void (*f)(struct sway_container *con, void *data), void *data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -694,15 +694,14 @@ static void render_border_texture(struct sway_output *output,
|
||||||
struct wlr_texture *texture, float alpha) {
|
struct wlr_texture *texture, float alpha) {
|
||||||
struct wlr_output *wlr_output = output->wlr_output;
|
struct wlr_output *wlr_output = output->wlr_output;
|
||||||
|
|
||||||
|
box.x -= output->lx;
|
||||||
|
box.y -= output->ly;
|
||||||
scale_box(&box, wlr_output->scale);
|
scale_box(&box, wlr_output->scale);
|
||||||
box.x -= output->lx * wlr_output->scale;
|
|
||||||
box.y -= output->ly * wlr_output->scale;
|
|
||||||
|
|
||||||
// TODO: Fix texture drawing between outputs.
|
// TODO: Fix texture drawing between outputs.
|
||||||
float matrix[9];
|
float matrix[9];
|
||||||
memcpy(matrix, wlr_output->transform_matrix, sizeof(matrix));
|
wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0.0,
|
||||||
wlr_matrix_translate(matrix, box.x, box.y);
|
output->wlr_output->transform_matrix);
|
||||||
wlr_matrix_scale(matrix, box.width, box.height);
|
|
||||||
|
|
||||||
pixman_region32_t texture_damage;
|
pixman_region32_t texture_damage;
|
||||||
pixman_region32_init_rect(&texture_damage, box.x, box.y, box.width, box.height);
|
pixman_region32_init_rect(&texture_damage, box.x, box.y, box.width, box.height);
|
||||||
|
|
@ -796,7 +795,7 @@ static void render_border_textures(struct sway_output *output,
|
||||||
* Render all of the border textures for a container.
|
* Render all of the border textures for a container.
|
||||||
*/
|
*/
|
||||||
static void render_border_textures_for_container(struct sway_container *con,
|
static void render_border_textures_for_container(struct sway_container *con,
|
||||||
pixman_region32_t *damage) {
|
void *data) {
|
||||||
if (container_is_floating(con)) {
|
if (container_is_floating(con)) {
|
||||||
goto bypass_border_checks;
|
goto bypass_border_checks;
|
||||||
}
|
}
|
||||||
|
|
@ -810,8 +809,9 @@ static void render_border_textures_for_container(struct sway_container *con,
|
||||||
temp = temp->parent;
|
temp = temp->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum sway_container_layout ws_layout = con->workspace->layout;
|
||||||
if ((con->layout == L_VERT || con->layout == L_HORIZ) &&
|
if ((con->layout == L_VERT || con->layout == L_HORIZ) &&
|
||||||
container_parent_layout(con) == con->layout) {
|
(ws_layout == L_VERT || ws_layout == L_HORIZ)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -821,6 +821,7 @@ bypass_border_checks:
|
||||||
textures = &config->border_textures.focused;
|
textures = &config->border_textures.focused;
|
||||||
|
|
||||||
struct sway_output *output = con->workspace->output;
|
struct sway_output *output = con->workspace->output;
|
||||||
|
pixman_region32_t *damage = (pixman_region32_t *) data;
|
||||||
struct sway_container_state *state = &con->current;
|
struct sway_container_state *state = &con->current;
|
||||||
struct wlr_box box;
|
struct wlr_box box;
|
||||||
box.x = state->x;
|
box.x = state->x;
|
||||||
|
|
@ -847,10 +848,8 @@ static void render_border_textures_for_workspace(struct sway_output *output,
|
||||||
render_border_textures(output, damage, &box, textures, con->alpha);
|
render_border_textures(output, damage, &box, textures, con->alpha);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < ws->tiling->length; ++i) {
|
workspace_for_each_tiling_container(ws,
|
||||||
struct sway_container *container = ws->tiling->items[i];
|
render_border_textures_for_container, damage);
|
||||||
render_border_textures_for_container(container, damage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void render_container(struct sway_output *output,
|
static void render_container(struct sway_output *output,
|
||||||
|
|
|
||||||
|
|
@ -585,14 +585,18 @@ void workspace_detect_urgent(struct sway_workspace *workspace) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void workspace_for_each_container(struct sway_workspace *ws,
|
void workspace_for_each_tiling_container(struct sway_workspace *ws,
|
||||||
void (*f)(struct sway_container *con, void *data), void *data) {
|
void (*f)(struct sway_container *con, void *data), void *data) {
|
||||||
// Tiling
|
|
||||||
for (int i = 0; i < ws->tiling->length; ++i) {
|
for (int i = 0; i < ws->tiling->length; ++i) {
|
||||||
struct sway_container *container = ws->tiling->items[i];
|
struct sway_container *container = ws->tiling->items[i];
|
||||||
f(container, data);
|
f(container, data);
|
||||||
container_for_each_child(container, f, data);
|
container_for_each_child(container, f, data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void workspace_for_each_container(struct sway_workspace *ws,
|
||||||
|
void (*f)(struct sway_container *con, void *data), void *data) {
|
||||||
|
workspace_for_each_tiling_container(ws, f, data);
|
||||||
// Floating
|
// Floating
|
||||||
for (int i = 0; i < ws->floating->length; ++i) {
|
for (int i = 0; i < ws->floating->length; ++i) {
|
||||||
struct sway_container *container = ws->floating->items[i];
|
struct sway_container *container = ws->floating->items[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue