Commit fe7959a2 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Remove SidebarNeedsRedraw.

The menu stack can be used to flag a redraw of the sidebar window.
parent 107e64ca
......@@ -27,6 +27,7 @@
#include "mx.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#ifdef USE_SIDEBAR
#include "sidebar.h"
......@@ -580,7 +581,7 @@ int mutt_buffy_check (int force)
(orig_count != tmp->msg_count) ||
(orig_unread != tmp->msg_unread) ||
(orig_flagged != tmp->msg_flagged))
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
#endif
if (!tmp->new)
......
......@@ -622,7 +622,7 @@ int mutt_index_menu (void)
}
#ifdef USE_SIDEBAR
if (menu->redraw & REDRAW_SIDEBAR || SidebarNeedsRedraw)
if (menu->redraw & REDRAW_SIDEBAR)
{
mutt_sb_set_buffystats (Context);
menu_redraw_sidebar (menu);
......
......@@ -22,6 +22,7 @@
#include "mutt.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "sort.h"
#include "mx.h"
......@@ -273,7 +274,7 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
{
mutt_set_header_color(ctx, h);
#ifdef USE_SIDEBAR
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
#endif
}
......
......@@ -226,7 +226,6 @@ WHERE short ScoreThresholdFlag;
#ifdef USE_SIDEBAR
WHERE short SidebarWidth;
WHERE LIST *SidebarWhitelist INITVAL(0);
WHERE int SidebarNeedsRedraw INITVAL (0);
#endif
#ifdef USE_IMAP
......
......@@ -26,6 +26,7 @@
#endif
#include "mutt.h"
#include "mutt_menu.h"
#include "imap_private.h"
#include "mx.h"
#include "buffy.h"
......@@ -1004,7 +1005,7 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s)
if ((inc->new != new) ||
(inc->msg_count != status->messages) ||
(inc->msg_unread != status->unseen))
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
#endif
inc->new = new;
if (new_msg_count)
......
......@@ -1804,7 +1804,7 @@ static void mutt_restore_default (struct option_t *p)
mutt_reflow_windows ();
#ifdef USE_SIDEBAR
if (p->flags & R_SIDEBAR)
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
#endif
}
......@@ -2582,7 +2582,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err)
mutt_reflow_windows ();
#ifdef USE_SIDEBAR
if (MuttVars[idx].flags & R_SIDEBAR)
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
#endif
}
}
......
......@@ -242,7 +242,7 @@ void menu_redraw_status (MUTTMENU *menu)
#ifdef USE_SIDEBAR
void menu_redraw_sidebar (MUTTMENU *menu)
{
SidebarNeedsRedraw = 0;
menu->redraw &= ~REDRAW_SIDEBAR;
mutt_sb_draw ();
}
#endif
......@@ -924,7 +924,7 @@ int menu_redraw (MUTTMENU *menu)
if (menu->redraw & REDRAW_STATUS)
menu_redraw_status (menu);
#ifdef USE_SIDEBAR
if (menu->redraw & REDRAW_SIDEBAR || SidebarNeedsRedraw)
if (menu->redraw & REDRAW_SIDEBAR)
menu_redraw_sidebar (menu);
#endif
if (menu->redraw & REDRAW_INDEX)
......
......@@ -1801,10 +1801,9 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
}
#ifdef USE_SIDEBAR
if ((pager_menu->redraw & REDRAW_SIDEBAR) || SidebarNeedsRedraw)
if (pager_menu->redraw & REDRAW_SIDEBAR)
{
SidebarNeedsRedraw = 0;
mutt_sb_draw ();
menu_redraw_sidebar (pager_menu);
}
#endif
......
......@@ -909,7 +909,7 @@ void mutt_sb_change_mailbox (int op)
default:
return;
}
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
}
/**
......@@ -1048,5 +1048,5 @@ void mutt_sb_notify_mailbox (BUFFY *b, int created)
Entries[del_index] = Entries[del_index + 1];
}
SidebarNeedsRedraw = 1;
mutt_set_current_menu_redraw (REDRAW_SIDEBAR);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment