X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=screen.c;h=aabc6f0334b5b53e3a2fd46cef6730f832ec9e20;hb=589bbc3fa5acf9a1a4f402ecee097d9db9639291;hp=8d14376ff95c5650950f32023e1b7c605b68c0f8;hpb=b24947b96670b3e2f7fe7d23c06e1ec2b4b7c262;p=ncmpc.git diff --git a/screen.c b/screen.c index 8d14376..aabc6f0 100644 --- a/screen.c +++ b/screen.c @@ -192,7 +192,7 @@ paint_status_window(mpd_client_t *c) mvwaddstr(w, 0, x, screen->buf); } -#if 1 +#if 0 else if( c->status->state == MPD_STATUS_STATE_STOP ) { time_t timep; @@ -220,9 +220,9 @@ screen_exit(void) screen->playlist = list_window_free(screen->playlist); screen->filelist = list_window_free(screen->filelist); screen->helplist = list_window_free(screen->helplist); - free(screen->buf); - free(screen->findbuf); - free(screen); + g_free(screen->buf); + g_free(screen->findbuf); + g_free(screen); screen = NULL; } return 0; @@ -311,12 +311,12 @@ screen_init(void) exit(EXIT_FAILURE); } - screen = malloc(sizeof(screen_t)); + screen = g_malloc(sizeof(screen_t)); memset(screen, 0, sizeof(screen_t)); screen->mode = SCREEN_PLAY_WINDOW; screen->cols = COLS; screen->rows = LINES; - screen->buf = malloc(screen->cols); + screen->buf = g_malloc(screen->cols); screen->buf_size = screen->cols; screen->findbuf = NULL; screen->painted = 0; @@ -347,7 +347,7 @@ screen_init(void) screen->main_window.cols, screen->main_window.rows ); - leaveok(screen->main_window.w, TRUE); + // leaveok(screen->main_window.w, TRUE); temporary disabled keypad(screen->main_window.w, TRUE); /* create progress window */ @@ -408,6 +408,7 @@ screen_paint(mpd_client_t *c) paint_progress_window(c); paint_status_window(c); screen->painted = 1; + wmove(screen->main_window.w, 0, 0); wnoutrefresh(screen->main_window.w); doupdate(); } @@ -416,6 +417,7 @@ screen_update(mpd_client_t *c) { static int repeat = -1; static int random = -1; + list_window_t *lw = NULL; if( !screen->painted ) return screen_paint(c); @@ -440,10 +442,12 @@ screen_update(mpd_client_t *c) case SCREEN_PLAY_WINDOW: paint_top_window(TOP_HEADER_PLAY, c->status->volume, 0); play_update(screen, c); + lw = screen->playlist; break; case SCREEN_FILE_WINDOW: paint_top_window(file_get_header(c), c->status->volume, 0); file_update(screen, c); + lw = screen->filelist; break; case SCREEN_SEARCH_WINDOW: paint_top_window(TOP_HEADER_SEARCH, c->status->volume, 0); @@ -452,10 +456,13 @@ screen_update(mpd_client_t *c) case SCREEN_HELP_WINDOW: paint_top_window(TOP_HEADER_HELP, c->status->volume, 0); help_update(screen, c); + lw = screen->helplist; break; } paint_progress_window(c); paint_status_window(c); + wmove(screen->main_window.w, LW_ROW(lw), 0); + wnoutrefresh(screen->main_window.w); doupdate(); }