changeset 15791:9de8f4e810cb

This takes way too much memory, especially with ncursesw. I hadn't noticed, because apparently I was using ncurses.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 15 Mar 2007 01:52:21 +0000
parents 465a58f2c711
children 15ed2cc560ce
files console/libgnt/gntwidget.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntwidget.c	Wed Mar 14 07:56:48 2007 +0000
+++ b/console/libgnt/gntwidget.c	Thu Mar 15 01:52:21 2007 +0000
@@ -357,7 +357,7 @@
 			g_signal_emit(widget, signals[SIG_SIZE_CHANGED], 0, oldw, oldh);
 		}
 #else
-		widget->window = newpad(150, 350);  /* XXX: */
+		widget->window = newpad(widget->priv.height + 20, widget->priv.width + 20);  /* XXX: */
 #endif
 		init_widget(widget);
 	}
@@ -520,6 +520,10 @@
 
 		widget->priv.width = width;
 		widget->priv.height = height;
+		if (width >= getmaxx(widget->window) || height >= getmaxy(widget->window)) {
+			delwin(widget->window);
+			widget->window = newpad(height + 20, width + 20);
+		}
 
 		g_signal_emit(widget, signals[SIG_SIZE_CHANGED], 0, oldw, oldh);
 
@@ -581,7 +585,8 @@
 
 	if (!g_object_get_data(G_OBJECT(widget), "gnt:queue_update"))
 		return FALSE;
-	gnt_screen_update(widget);
+	if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_MAPPED))
+		gnt_screen_update(widget);
 	g_object_set_data(G_OBJECT(widget), "gnt:queue_update", NULL);
 	return FALSE;
 }