mirror of
https://github.com/swaywm/sway.git
synced 2024-11-23 08:21:28 +00:00
Fix another of @orestisf1993's issues
This commit is contained in:
parent
1f70b94f34
commit
c8be7bfc1e
|
@ -38,9 +38,19 @@ static int draw_container(cairo_t *cairo, struct sway_container *container,
|
||||||
container_type_to_str(container->type), container->id, container->name,
|
container_type_to_str(container->type), container->id, container->name,
|
||||||
layout_to_str(container->layout),
|
layout_to_str(container->layout),
|
||||||
container->width, container->height, container->x, container->y);
|
container->width, container->height, container->x, container->y);
|
||||||
cairo_rectangle(cairo, x, y, text_width, text_height);
|
cairo_rectangle(cairo, x + 2, y, text_width - 2, text_height);
|
||||||
cairo_set_source_u32(cairo, 0xFFFFFFE0);
|
cairo_set_source_u32(cairo, 0xFFFFFFE0);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
int height = text_height;
|
||||||
|
if (container->children) {
|
||||||
|
for (int i = 0; i < container->children->length; ++i) {
|
||||||
|
struct sway_container *child = container->children->items[i];
|
||||||
|
height += draw_container(cairo, child, focus, x + 10, y + height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cairo_set_source_u32(cairo, 0xFFFFFFE0);
|
||||||
|
cairo_rectangle(cairo, x, y, 2, height);
|
||||||
|
cairo_fill(cairo);
|
||||||
cairo_move_to(cairo, x, y);
|
cairo_move_to(cairo, x, y);
|
||||||
if (focus == container) {
|
if (focus == container) {
|
||||||
cairo_set_source_u32(cairo, 0xFF0000FF);
|
cairo_set_source_u32(cairo, 0xFF0000FF);
|
||||||
|
@ -51,13 +61,6 @@ static int draw_container(cairo_t *cairo, struct sway_container *container,
|
||||||
container_type_to_str(container->type), container->id, container->name,
|
container_type_to_str(container->type), container->id, container->name,
|
||||||
layout_to_str(container->layout),
|
layout_to_str(container->layout),
|
||||||
container->width, container->height, container->x, container->y);
|
container->width, container->height, container->x, container->y);
|
||||||
int height = text_height;
|
|
||||||
if (container->children) {
|
|
||||||
for (int i = 0; i < container->children->length; ++i) {
|
|
||||||
struct sway_container *child = container->children->items[i];
|
|
||||||
height += draw_container(cairo, child, focus, x + 10, y + height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,8 +364,8 @@ void container_move(struct sway_container *container,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wlr_log(L_DEBUG, "Selecting sibling");
|
|
||||||
sibling = parent->children->items[index + offs];
|
sibling = parent->children->items[index + offs];
|
||||||
|
wlr_log(L_DEBUG, "Selecting sibling id:%zd", sibling->id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wlr_log(L_DEBUG, "Moving up to find a parallel container");
|
wlr_log(L_DEBUG, "Moving up to find a parallel container");
|
||||||
|
@ -419,9 +419,12 @@ void container_move(struct sway_container *container,
|
||||||
container_remove_child(container);
|
container_remove_child(container);
|
||||||
struct sway_container *focus_inactive = seat_get_focus_inactive(
|
struct sway_container *focus_inactive = seat_get_focus_inactive(
|
||||||
config->handler_context.seat, sibling);
|
config->handler_context.seat, sibling);
|
||||||
wlr_log(L_DEBUG, "Focus inactive: %zd", focus_inactive ?
|
|
||||||
focus_inactive->id : 0);
|
|
||||||
if (focus_inactive) {
|
if (focus_inactive) {
|
||||||
|
while (focus_inactive->parent != sibling) {
|
||||||
|
focus_inactive = focus_inactive->parent;
|
||||||
|
}
|
||||||
|
wlr_log(L_DEBUG, "Focus inactive: id:%zd",
|
||||||
|
focus_inactive->id);
|
||||||
sibling = focus_inactive;
|
sibling = focus_inactive;
|
||||||
continue;
|
continue;
|
||||||
} else if (sibling->children->length) {
|
} else if (sibling->children->length) {
|
||||||
|
|
Loading…
Reference in a new issue