comparison mcabber/src/screen.c @ 708:ed326697e4ed

scr_RosterVisibility(): do not refresh when it is not needed
author Mikael Berthe <mikael@lilotux.net>
date Tue, 21 Feb 2006 23:05:08 +0100
parents b26a0bde4cdb
children 5aa66101807b
comparison
equal deleted inserted replaced
707:b26a0bde4cdb 708:ed326697e4ed
855 // status=1 Show roster 855 // status=1 Show roster
856 // status=0 Hide roster 856 // status=0 Hide roster
857 // status=-1 Toggle roster status 857 // status=-1 Toggle roster status
858 void scr_RosterVisibility(int status) 858 void scr_RosterVisibility(int status)
859 { 859 {
860 int old_roster_status = roster_hidden;
861
860 if (status > 0) 862 if (status > 0)
861 roster_hidden = FALSE; 863 roster_hidden = FALSE;
862 else if (status == 0) 864 else if (status == 0)
863 roster_hidden = TRUE; 865 roster_hidden = TRUE;
864 else 866 else
865 roster_hidden = !roster_hidden; 867 roster_hidden = !roster_hidden;
866 868
867 // Recalculate windows size and redraw 869 if (roster_hidden != old_roster_status) {
868 scr_Resize(); 870 // Recalculate windows size and redraw
869 redrawwin(stdscr); 871 scr_Resize();
872 redrawwin(stdscr);
873 }
870 } 874 }
871 875
872 inline void scr_WriteMessage(const char *jid, const char *text, 876 inline void scr_WriteMessage(const char *jid, const char *text,
873 time_t timestamp, guint prefix_flags) 877 time_t timestamp, guint prefix_flags)
874 { 878 {