aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-04-06 13:57:04 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-04-06 13:57:04 -0400
commitc8be7bfc1e0c65730a5bf713e61105cd38bf9f4f (patch)
tree5fa4acddfe3f9d94cb3d641980038a0c9435a637
parentFix moving into right end of container (diff)
downloadsway-c8be7bfc1e0c65730a5bf713e61105cd38bf9f4f.tar.gz
sway-c8be7bfc1e0c65730a5bf713e61105cd38bf9f4f.tar.zst
sway-c8be7bfc1e0c65730a5bf713e61105cd38bf9f4f.zip
Fix another of @orestisf1993's issues
-rw-r--r--sway/debug-tree.c19
-rw-r--r--sway/tree/layout.c9
2 files changed, 17 insertions, 11 deletions
diff --git a/sway/debug-tree.c b/sway/debug-tree.c
index aea6a8b1..00501d9c 100644
--- a/sway/debug-tree.c
+++ b/sway/debug-tree.c
@@ -38,9 +38,19 @@ static int draw_container(cairo_t *cairo, struct sway_container *container,
38 container_type_to_str(container->type), container->id, container->name, 38 container_type_to_str(container->type), container->id, container->name,
39 layout_to_str(container->layout), 39 layout_to_str(container->layout),
40 container->width, container->height, container->x, container->y); 40 container->width, container->height, container->x, container->y);
41 cairo_rectangle(cairo, x, y, text_width, text_height); 41 cairo_rectangle(cairo, x + 2, y, text_width - 2, text_height);
42 cairo_set_source_u32(cairo, 0xFFFFFFE0); 42 cairo_set_source_u32(cairo, 0xFFFFFFE0);
43 cairo_fill(cairo); 43 cairo_fill(cairo);
44 int height = text_height;
45 if (container->children) {
46 for (int i = 0; i < container->children->length; ++i) {
47 struct sway_container *child = container->children->items[i];
48 height += draw_container(cairo, child, focus, x + 10, y + height);
49 }
50 }
51 cairo_set_source_u32(cairo, 0xFFFFFFE0);
52 cairo_rectangle(cairo, x, y, 2, height);
53 cairo_fill(cairo);
44 cairo_move_to(cairo, x, y); 54 cairo_move_to(cairo, x, y);
45 if (focus == container) { 55 if (focus == container) {
46 cairo_set_source_u32(cairo, 0xFF0000FF); 56 cairo_set_source_u32(cairo, 0xFF0000FF);
@@ -51,13 +61,6 @@ static int draw_container(cairo_t *cairo, struct sway_container *container,
51 container_type_to_str(container->type), container->id, container->name, 61 container_type_to_str(container->type), container->id, container->name,
52 layout_to_str(container->layout), 62 layout_to_str(container->layout),
53 container->width, container->height, container->x, container->y); 63 container->width, container->height, container->x, container->y);
54 int height = text_height;
55 if (container->children) {
56 for (int i = 0; i < container->children->length; ++i) {
57 struct sway_container *child = container->children->items[i];
58 height += draw_container(cairo, child, focus, x + 10, y + height);
59 }
60 }
61 return height; 64 return height;
62} 65}
63 66
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index f4049c71..b03b80d9 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -364,8 +364,8 @@ void container_move(struct sway_container *container,
364 return; 364 return;
365 } 365 }
366 } else { 366 } else {
367 wlr_log(L_DEBUG, "Selecting sibling");
368 sibling = parent->children->items[index + offs]; 367 sibling = parent->children->items[index + offs];
368 wlr_log(L_DEBUG, "Selecting sibling id:%zd", sibling->id);
369 } 369 }
370 } else { 370 } else {
371 wlr_log(L_DEBUG, "Moving up to find a parallel container"); 371 wlr_log(L_DEBUG, "Moving up to find a parallel container");
@@ -419,9 +419,12 @@ void container_move(struct sway_container *container,
419 container_remove_child(container); 419 container_remove_child(container);
420 struct sway_container *focus_inactive = seat_get_focus_inactive( 420 struct sway_container *focus_inactive = seat_get_focus_inactive(
421 config->handler_context.seat, sibling); 421 config->handler_context.seat, sibling);
422 wlr_log(L_DEBUG, "Focus inactive: %zd", focus_inactive ?
423 focus_inactive->id : 0);
424 if (focus_inactive) { 422 if (focus_inactive) {
423 while (focus_inactive->parent != sibling) {
424 focus_inactive = focus_inactive->parent;
425 }
426 wlr_log(L_DEBUG, "Focus inactive: id:%zd",
427 focus_inactive->id);
425 sibling = focus_inactive; 428 sibling = focus_inactive;
426 continue; 429 continue;
427 } else if (sibling->children->length) { 430 } else if (sibling->children->length) {