Mercurial > hg
comparison mcabber/src/screen.c @ 724:264375fe7159
Fix a roster refresh issue
Calling scr_UpdateChatStatus() after clearing the roster window was
causing an unneeded screen update.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 05 Mar 2006 16:54:01 +0100 |
parents | 23068490d063 |
children | 1aff92625bdb |
comparison
equal
deleted
inserted
replaced
723:23068490d063 | 724:264375fe7159 |
---|---|
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 // scr_UpdateMainStatus() | 533 // scr_UpdateMainStatus() |
534 // Redraw the main (bottom) status line. | 534 // Redraw the main (bottom) status line. |
535 void scr_UpdateMainStatus(void) | 535 void scr_UpdateMainStatus(int forceupdate) |
536 { | 536 { |
537 const char *sm = jb_getstatusmsg(); | 537 const char *sm = jb_getstatusmsg(); |
538 | 538 |
539 werase(mainstatusWnd); | 539 werase(mainstatusWnd); |
540 mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s", | 540 mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s", |
541 (unread_msg(NULL) ? '#' : ' '), | 541 (unread_msg(NULL) ? '#' : ' '), |
542 imstatus2char[jb_getstatus()], (sm ? sm : "")); | 542 imstatus2char[jb_getstatus()], (sm ? sm : "")); |
543 top_panel(inputPanel); | 543 if (forceupdate) { |
544 update_panels(); | 544 top_panel(inputPanel); |
545 doupdate(); | 545 update_panels(); |
546 doupdate(); | |
547 } | |
546 } | 548 } |
547 | 549 |
548 // scr_DrawMainWindow() | 550 // scr_DrawMainWindow() |
549 // Set fullinit to TRUE to also create panels. Set it to FALSE for a resize. | 551 // Set fullinit to TRUE to also create panels. Set it to FALSE for a resize. |
550 // | 552 // |
732 char status; | 734 char status; |
733 char *buf; | 735 char *buf; |
734 | 736 |
735 // Usually we need to update the bottom status line too, | 737 // Usually we need to update the bottom status line too, |
736 // at least to refresh the pending message flag. | 738 // at least to refresh the pending message flag. |
737 scr_UpdateMainStatus(); | 739 scr_UpdateMainStatus(FALSE); |
738 | 740 |
739 fullname = buddy_getname(BUDDATA(current_buddy)); | 741 fullname = buddy_getname(BUDDATA(current_buddy)); |
740 btype = buddy_gettype(BUDDATA(current_buddy)); | 742 btype = buddy_gettype(BUDDATA(current_buddy)); |
741 | 743 |
742 isgrp = btype & ROSTER_TYPE_GROUP; | 744 isgrp = btype & ROSTER_TYPE_GROUP; |
813 getmaxyx(rosterWnd, maxy, maxx); | 815 getmaxyx(rosterWnd, maxy, maxx); |
814 maxx--; // Last char is for vertical border | 816 maxx--; // Last char is for vertical border |
815 | 817 |
816 cursor_backup = curs_set(0); | 818 cursor_backup = curs_set(0); |
817 | 819 |
820 if (!buddylist) | |
821 offset = 0; | |
822 else | |
823 scr_UpdateChatStatus(FALSE); | |
824 | |
818 // Cleanup of roster window | 825 // Cleanup of roster window |
819 werase(rosterWnd); | 826 werase(rosterWnd); |
820 | 827 |
821 if (Roster_Width) { | 828 if (Roster_Width) { |
822 // Redraw the vertical line (not very good...) | 829 // Redraw the vertical line (not very good...) |
823 wattrset(rosterWnd, COLOR_PAIR(COLOR_GENERAL)); | 830 wattrset(rosterWnd, COLOR_PAIR(COLOR_GENERAL)); |
824 for (i=0 ; i < CHAT_WIN_HEIGHT ; i++) | 831 for (i=0 ; i < CHAT_WIN_HEIGHT ; i++) |
825 mvwaddch(rosterWnd, i, Roster_Width-1, ACS_VLINE); | 832 mvwaddch(rosterWnd, i, Roster_Width-1, ACS_VLINE); |
826 } | 833 } |
827 | |
828 if (!buddylist) | |
829 offset = 0; | |
830 else | |
831 scr_UpdateChatStatus(FALSE); | |
832 | 834 |
833 // Leave now if buddylist is empty or the roster is hidden | 835 // Leave now if buddylist is empty or the roster is hidden |
834 if (!buddylist || !Roster_Width) { | 836 if (!buddylist || !Roster_Width) { |
835 update_panels(); | 837 update_panels(); |
836 doupdate(); | 838 doupdate(); |