summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-03-14 19:16:58 -0700
committerVito Caputo <vcaputo@gnugeneration.com>2017-03-14 19:26:08 -0700
commitecd88826ac1f0bf3513c23a5ee90ae360422f618 (patch)
tree81a1bb3d7612ba27d9ec4fb43f66fbc85199d82b
parent01cdfeea061ab3339b4e5cbf0964005d4c15bd5e (diff)
overlay: fix heirarchy tee/cap drawing bug
If walking ancestors never entered the loop, bar_y isn't set. Set the bar_y once per row, and independent of ancestors. This is obviously more correct and fixes a situation where the siblings have children but there are no ancestors (siblings under the root). Surprisingly this isn't generally observed in vwm, but was noticed in vmon development.
-rw-r--r--src/overlay.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/overlay.c b/src/overlay.c
index 1ff8443..2dc572e 100644
--- a/src/overlay.c
+++ b/src/overlay.c
@@ -347,7 +347,7 @@ static void draw_heirarchy_row(vwm_t *vwm, vwm_xwindow_t *xwin, vmon_proc_t *pro
vmon_proc_t *ancestor, *sibling, *last_sibling = NULL;
struct list_head *rem;
int needs_tee = 0;
- int bar_x = 0, bar_y = 0;
+ int bar_x = 0, bar_y = (row + 1) * OVERLAY_ROW_HEIGHT;
int sub;
/* XXX: everything done in this code block only dirties _this_ process' row in the rendered overlay output */
@@ -357,7 +357,6 @@ static void draw_heirarchy_row(vwm_t *vwm, vwm_xwindow_t *xwin, vmon_proc_t *pro
for (sub = 1, ancestor = proc->parent; ancestor && ancestor != xwin->monitor; ancestor = ancestor->parent) {
sub++;
bar_x = (depth - sub) * (OVERLAY_ROW_HEIGHT / 2) + 4;
- bar_y = (row + 1) * OVERLAY_ROW_HEIGHT;
/* determine if the ancestor has remaining siblings which are not stale, if so, draw a connecting bar at its depth */
for (rem = ancestor->siblings.next; rem != &ancestor->parent->children; rem = rem->next) {
© All Rights Reserved