Module Name:    src
Committed By:   nia
Date:           Sat May  8 14:38:26 UTC 2021

Modified Files:
        src/usr.bin/aiomixer: draw.c

Log Message:
aiomixer: do not adjust class widget pad height, draw to end of screen

ncurses refuses to paint pads if the height argument extends beyond
the bounds of the screen. it's probably not good for our curses either.

libcurses wresize() refuses to resize a pad beyond the bounds of the
screen even if it was created with a larger size. this is probably
a bug.

found by uwe


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/aiomixer/draw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/aiomixer/draw.c
diff -u src/usr.bin/aiomixer/draw.c:1.4 src/usr.bin/aiomixer/draw.c:1.5
--- src/usr.bin/aiomixer/draw.c:1.4	Sat May  8 13:28:45 2021
+++ src/usr.bin/aiomixer/draw.c	Sat May  8 14:38:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: draw.c,v 1.4 2021/05/08 13:28:45 nia Exp $ */
+/* $NetBSD: draw.c,v 1.5 2021/05/08 14:38:26 nia Exp $ */
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -137,7 +137,7 @@ draw_screen(struct aiomixer *aio)
 	pnoutrefresh(aio->classes[aio->curclass].widgetpad,
 	    aio->class_scroll_y, 0,
 	    3, 0,
-	    1 + aio->classes[aio->curclass].height, getmaxx(stdscr));
+	    getmaxy(stdscr) - 3, getmaxx(stdscr));
 	doupdate();
 }
 
@@ -360,7 +360,13 @@ create_widgets(struct aiomixer *aio)
 			control->widget_y = class->height;
 			class->height += control->height;
 		}
+#ifdef notyet
+		/*
+		 * NetBSD curses wresize() bounds the pad to the height of
+		 * the screen even though it's already taller. Probably a bug.
+		 */
 		wresize(class->widgetpad, class->height, getmaxx(stdscr));
+#endif
 	}
 
 	aio->last_max_x = getmaxx(stdscr);

Reply via email to