im.pidgin.pidgin: 81354ef444517d1122c9f56ca7320d5b5694387b

sadrul at pidgin.im sadrul at pidgin.im
Mon Nov 12 11:45:45 EST 2007


-----------------------------------------------------------------
Revision: 81354ef444517d1122c9f56ca7320d5b5694387b
Ancestor: 535e513c571856e9e31d51a83dca552c8a8433dc
Author: sadrul at pidgin.im
Date: 2007-11-10T23:48:57
Branch: im.pidgin.pidgin

Modified files:
        finch/libgnt/gntwidget.c finch/libgnt/gntwm.c

ChangeLog: 

Fix size calculation when shadow is enabled.
Also, when the terminal is resized, the SIGWINCH callback needs to refresh
after endwin to get the correct new size of the terminal.

-------------- next part --------------
============================================================
--- finch/libgnt/gntwidget.c	b9f967c6e38de0751e9e05523742cb0c1f07d45e
+++ finch/libgnt/gntwidget.c	f30e3d47ef942aa4b386705d18d149be8bbdce16
@@ -466,7 +466,6 @@ gnt_widget_get_size(GntWidget *wid, int 
 		*width = wid->priv.width + shadow;
 	if (height)
 		*height = wid->priv.height + shadow;
-	
 }
 
 static void
============================================================
--- finch/libgnt/gntwm.c	e40c2819c36ef29f35a608f64549769ad1cfd829
+++ finch/libgnt/gntwm.c	44e53f08c882bafe7de0c026b6fbd99269989276
@@ -109,12 +109,10 @@ gnt_wm_copy_win(GntWidget *widget, GntNo
 gnt_wm_copy_win(GntWidget *widget, GntNode *node)
 {
 	WINDOW *src, *dst;
-	int shadow;
 	if (!node)
 		return;
 	src = widget->window;
 	dst = node->window;
-	shadow = gnt_widget_has_shadow(widget) ? 1 : 0;
 	copywin(src, dst, node->scroll, 0, 0, 0, getmaxy(dst) - 1, getmaxx(dst) - 1, 0);
 }
 
@@ -1004,9 +1002,9 @@ refresh_screen(GntBindable *bindable, GL
 	GntWM *wm = GNT_WM(bindable);
 
 	endwin();
-
-	g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL);
 	refresh();
+
+	g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, GINT_TO_POINTER(TRUE));
 	g_signal_emit(wm, signals[SIG_TERMINAL_REFRESH], 0);
 	update_screen(wm);
 	gnt_ws_draw_taskbar(wm->cws, TRUE);
@@ -1622,13 +1620,11 @@ gnt_wm_new_window_real(GntWM *wm, GntWid
 			shadow = FALSE;
 		x = widget->priv.x;
 		y = widget->priv.y;
-		w = widget->priv.width;
-		h = widget->priv.height;
+		w = widget->priv.width + shadow;
+		h = widget->priv.height + shadow;
 
-		getmaxyx(stdscr, maxy, maxx);
-		maxy -= 1;              /* room for the taskbar */
-		maxy -= shadow;
-		maxx -= shadow;
+		maxx = getmaxx(stdscr);
+		maxy = getmaxy(stdscr) - 1;              /* room for the taskbar */
 
 		x = MAX(0, x);
 		y = MAX(0, y);
@@ -1639,7 +1635,7 @@ gnt_wm_new_window_real(GntWM *wm, GntWid
 
 		w = MIN(w, maxx);
 		h = MIN(h, maxy);
-		node->window = newwin(h + shadow, w + shadow, y, x);
+		node->window = newwin(h, w, y, x);
 		gnt_wm_copy_win(widget, node);
 	}
 #endif
@@ -1884,9 +1880,8 @@ void gnt_wm_resize_window(GntWM *wm, Gnt
 {
 	gboolean ret = TRUE;
 	GntNode *node;
-	int shadow;
 	int maxx, maxy;
-	
+
 	while (widget->parent)
 		widget = widget->parent;
 	node = g_hash_table_lookup(wm->nodes, widget);
@@ -1900,9 +1895,8 @@ void gnt_wm_resize_window(GntWM *wm, Gnt
 	gnt_widget_set_size(widget, width, height);
 	gnt_widget_draw(widget);
 
-	shadow = gnt_widget_has_shadow(widget) ? 1 : 0;
-	maxx = getmaxx(stdscr) - shadow;
-	maxy = getmaxy(stdscr) - 1 - shadow;
+	maxx = getmaxx(stdscr);
+	maxy = getmaxy(stdscr) - 1;
 	height = MIN(height, maxy);
 	width = MIN(width, maxx);
 	wresize(node->window, height, width);


More information about the Commits mailing list