X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Flayout.c;h=bae1d2adc643ec19cffcb5692e6bf574b01d5c45;hp=50fd0b61bdbed1152ff7f8a4300082c43d2a35f6;hb=8ab1ab66eb1c4b95f9b2a5ed9c2b2cf1dfa74544;hpb=fbb57685ed2c5633f7c76acb7cf2c9bd9d4897b3 diff --git a/lib-ui/layout.c b/lib-ui/layout.c index 50fd0b6..bae1d2a 100644 --- a/lib-ui/layout.c +++ b/lib-ui/layout.c @@ -30,8 +30,8 @@ WINDOW *sidebar_w, *main_w; void mutt_need_hard_redraw(void) { - keypad(stdscr, true); - clearok(stdscr, true); + keypad(main_w, true); + clearok(main_w, true); set_option(OPTNEEDREDRAW); } @@ -49,26 +49,28 @@ void mutt_refresh(void) return; /* else */ - wrefresh(stdscr); if (sidebar_w) - wrefresh(sidebar_w); - wrefresh(main_w); - main_w = NULL; + wnoutrefresh(sidebar_w); + if (main_w) + wnoutrefresh(main_w); + wrefresh(stdscr); } void mutt_endwin(const char *msg) { if (!option(OPTNOCURSES)) { - CLEARLINE(LINES - 1); + CLEARLINE(main_w, LINES - 1); if (sidebar_w) { delwin(sidebar_w); sidebar_w = NULL; } +#if 0 if (main_w) { delwin(main_w); main_w = NULL; } +#endif wattrset(stdscr, A_NORMAL); mutt_refresh(); @@ -83,12 +85,11 @@ void mutt_endwin(const char *msg) void ui_layout_init(void) { - SETCOLOR(MT_COLOR_NORMAL); - wclear(stdscr); + main_w = newwin(LINES - 1, COLS, 0, 0); + SETCOLOR(main_w, MT_COLOR_NORMAL); + wclear(main_w); mutt_error = mutt_curses_error; mutt_message = mutt_curses_message; - - main_w = newwin(LINES - 1, COLS, 0, 0); } void ui_layout_resize(void) @@ -113,7 +114,7 @@ void ui_layout_resize(void) resizeterm(rows, cols); SigWinch = 0; /* force a real complete redraw. */ - clearok(stdscr, true); + clearok(main_w, true); } } @@ -126,6 +127,7 @@ WINDOW *ui_layout_sidebar_w(void) if (!sidebar_w) { sidebar_w = newwin(LINES - 1, SidebarWidth, 0, 0); wresize(main_w, LINES - 1, COLS - SidebarWidth); + mvwin(main_w, 0, SidebarWidth); } getmaxyx(sidebar_w, sh, sw); @@ -133,12 +135,14 @@ WINDOW *ui_layout_sidebar_w(void) if (sh != LINES - 1 || sw != SidebarWidth) { wresize(sidebar_w, LINES - 1, SidebarWidth); wresize(main_w, LINES - 1, COLS - SidebarWidth); + mvwin(main_w, 0, SidebarWidth); } } else { if (sidebar_w) { delwin(sidebar_w); sidebar_w = NULL; wresize(main_w, LINES - 1, COLS); + mvwin(main_w, 0, 0); } } return sidebar_w;