X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Flayout.c;h=eb5c2f0dba7964bea4409ba39417fe9f24c44e2b;hp=50fd0b61bdbed1152ff7f8a4300082c43d2a35f6;hb=85707d7504ab7baf1b07e30b1bcab517ef115976;hpb=b2c8662dd3e1d14ed817e9e166f1fd223a5b4754 diff --git a/lib-ui/layout.c b/lib-ui/layout.c index 50fd0b6..eb5c2f0 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,28 +49,29 @@ 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(stdscr, 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(); endwin(); } @@ -83,12 +84,11 @@ void mutt_endwin(const char *msg) void ui_layout_init(void) { - SETCOLOR(MT_COLOR_NORMAL); - wclear(stdscr); + erase(); + main_w = newwin(LINES - 1, COLS, 0, 0); + SETCOLOR(main_w, MT_COLOR_NORMAL); 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 +113,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 +126,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 +134,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;