# HG changeset patch # User Sadrul Habib Chowdhury # Date 1231255812 0 # Node ID dcf2f613a6a61ca15c016ec919e7eb761f43260b # Parent 55f4261e13588da4dff48ec26e866cd1a5f1b373 Don't crash on screen refresh if buddylist is maximized. Fixes #8003. diff -r 55f4261e1358 -r dcf2f613a6a6 finch/libgnt/wms/irssi.c --- a/finch/libgnt/wms/irssi.c Mon Jan 05 14:43:15 2009 +0000 +++ b/finch/libgnt/wms/irssi.c Tue Jan 06 15:30:12 2009 +0000 @@ -71,7 +71,12 @@ width = (getmaxx(stdscr) - irssi->buddylistwidth) / irssi->horiz; height = (getmaxy(stdscr) - 1) / irssi->vert; - rx = irssi->buddylistwidth; + if (width) { + rx = irssi->buddylistwidth; + } else { + rx = 0; + width = getmaxx(stdscr) / irssi->horiz; + } if (hor) rx += hor * width; if (rx) @@ -234,7 +239,7 @@ height = (getmaxy(stdscr) - 1) / irssi->vert; if (h) - *h = (x - irssi->buddylistwidth) / width; + *h = width ? (x - irssi->buddylistwidth) / width : x / (getmaxx(stdscr) / irssi->horiz); if (v) *v = y / height; } @@ -278,6 +283,7 @@ { int vert, hor; int x, y, w, h; + const char *name; if (!GNT_IS_WINDOW(widget)) return; @@ -286,10 +292,13 @@ 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); + name = gnt_widget_get_name(widget); + if (name && strstr(name, "conversation-window")) { + 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