changeset 24214:f8ffea0d1c65

Fix a bug in the irssi plugin where the windows wouldn't expand when the terminal was resized to increase the size.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 04 Oct 2008 23:36:52 +0000
parents 3a5ae157b730
children 95da3ec97c27
files finch/libgnt/wms/irssi.c
diffstat 1 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/wms/irssi.c	Thu Oct 02 01:02:44 2008 +0000
+++ b/finch/libgnt/wms/irssi.c	Sat Oct 04 23:36:52 2008 +0000
@@ -1,3 +1,25 @@
+/*
+ * GNT - The GLib Ncurses Toolkit
+ *
+ * GNT is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 /**
  * 1. Buddylist is aligned on the left.
  * 2. The rest of the screen is split into MxN grid for conversation windows.
@@ -136,6 +158,7 @@
 				gnt_widget_set_position(win, x, y);
 				mvwin(win->window, y, x);
 			} else {
+				gnt_window_set_maximize(GNT_WINDOW(win), GNT_WINDOW_MAXIMIZE_Y);
 				remove_border_set_position_size(wm, win, 0, 0, -1, getmaxy(stdscr) - 1);
 				gnt_widget_get_size(win, &((Irssi*)wm)->buddylistwidth, NULL);
 				draw_line_separators((Irssi*)wm);
@@ -251,9 +274,29 @@
 }
 
 static void
+refresh_window(GntWidget *widget, GntNode *node, Irssi *irssi)
+{
+	int vert, hor;
+	int x, y, w, h;
+
+	if (!GNT_IS_WINDOW(widget))
+		return;
+
+	if (is_budddylist(widget)) {
+		return;
+	}
+
+	find_window_position(irssi, widget, &hor, &vert);
+	get_xywh_for_frame(irssi, hor, vert, &x, &y, &w, &h);
+	gnt_wm_move_window(GNT_WM(irssi), widget, x, y);
+	gnt_wm_resize_window(GNT_WM(irssi), widget, w, h);
+}
+
+static void
 irssi_terminal_refresh(GntWM *wm)
 {
 	draw_line_separators((Irssi*)wm);
+	g_hash_table_foreach(wm->nodes, (GHFunc)refresh_window, wm);
 }
 
 static void