comparison mcabber/src/screen.c @ 833:63707a595c2e

Fix a display bug when resizing the buffer window The g_list_position() trick was stupid, it cannot work because all the non-persistent lines are removed anyway. Let's always use the "previous persistent" line.
author Mikael Berthe <mikael@lilotux.net>
date Thu, 04 May 2006 16:02:22 +0200
parents 7c210263c661
children 915a7f17474a
comparison
equal deleted inserted replaced
832:7c210263c661 833:63707a595c2e
808 if (cols < 1) cols = 1; 808 if (cols < 1) cols = 1;
809 809
810 for (wblp = winbuflst; wblp; wblp = g_slist_next(wblp)) { 810 for (wblp = winbuflst; wblp; wblp = g_slist_next(wblp)) {
811 wbp = wblp->data; 811 wbp = wblp->data;
812 if (wbp->win) { 812 if (wbp->win) {
813 GList *rescue_top;
814 // Resize/move buddy window 813 // Resize/move buddy window
815 wresize(wbp->win, lines, cols); 814 wresize(wbp->win, lines, cols);
816 mvwin(wbp->win, 0, Roster_Width); 815 mvwin(wbp->win, 0, Roster_Width);
817 werase(wbp->win); 816 werase(wbp->win);
818 // If a panel exists, replace the old window with the new 817 // If a panel exists, replace the old window with the new
819 if (wbp->panel) 818 if (wbp->panel)
820 replace_panel(wbp->panel, wbp->win); 819 replace_panel(wbp->panel, wbp->win);
821 // Redo line wrapping 820 // Redo line wrapping
822 rescue_top = hbuf_previous_persistent(wbp->top); 821 wbp->top = hbuf_previous_persistent(wbp->top);
823 hbuf_rebuild(&wbp->hbuf, maxX - Roster_Width - PREFIX_WIDTH); 822 hbuf_rebuild(&wbp->hbuf, maxX - Roster_Width - PREFIX_WIDTH);
824 if (g_list_position(g_list_first(wbp->hbuf), wbp->top) == -1) {
825 wbp->top = rescue_top;
826 }
827 } 823 }
828 } 824 }
829 825
830 // Refresh current buddy window 826 // Refresh current buddy window
831 if (chatmode) 827 if (chatmode)