ref: cd65c5b2f3bb2dc39a08f4fa57eef5029e40df79
parent: 3908c5dbe3fb58e12b9cd95a5cfaeb11ad307682
author: Igor Böhm <igor@9lab.org>
date: Tue Mar 15 06:49:00 EDT 2022
acme: fix hiding of top windows when loading a dump file (thanks Xiao-Yong) When loading an acme dump file that contains a window with only one tag line, there are cases where acme hides that window (i.e. not even its tag is visible). The following commands reproduce the issue: % ed <<EOE 1 i /tmp /lib/font/bit/pelm/unicode.8.font /lib/font/bit/pelm/unicode.8.font 0 f 0 5 175 175 1 5 40 175 1 0 /sys/src/cmd/acme/ Del Snarf Get | Look f 0 4 330 330 3 4 27 330 1 0 /tmp/ Del Snarf Get | Look . ,w /tmp/test.dump Q EOE % window -dx 900 -dy 600 'acme -l /tmp/test.dump' This issue was introduced in commit 346215170bbc91f0f7970f4e5d73bf1903e5d01c.
--- a/sys/src/cmd/acme/wind.c
+++ b/sys/src/cmd/acme/wind.c
@@ -188,6 +188,8 @@
w->taglines = wintaglines(w, r);
r1.max.y = min(r.max.y, r1.min.y + w->taglines*font->height);
}
+ if(Dy(r1) < font->height)
+ r1.max.y = r1.min.y+font->height;
/* If needed, resize & redraw tag. */
y = r1.max.y;
if(!safe || !w->tagsafe || !eqrect(w->tag.r, r1)){
--
⑨