summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0ae851a)
raw | patch | inline | side by side (parent: 0ae851a)
author | Max Kellermann <max@duempel.org> | |
Fri, 3 Oct 2008 12:28:49 +0000 (14:28 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 3 Oct 2008 12:28:49 +0000 (14:28 +0200) |
Repaint immediately instead of setting "painted=0".
src/main.c | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen.h | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 3a6243c37fbe8065397ebff4d71e5262ada591eb..9839234372c05fb87719f8702a78b38211059fd9 100644 (file)
--- a/src/main.c
+++ b/src/main.c
reset_prog_mode(); /* restore tty modes */
refresh();
#endif
- screen_resize();
+ screen_resize(mpd);
}
void
endwin();
refresh();
- screen_resize();
+ screen_resize(mpd);
return FALSE;
}
g_timeout_add(10000, timer_check_key_bindings, NULL);
idle_source_id = g_timeout_add(idle_interval, timer_idle, NULL);
+ screen_paint(mpd);
+
g_main_loop_run(main_loop);
/* cleanup */
diff --git a/src/screen.c b/src/screen.c
index 2fd4b571f3123324f410d27e0504399e0ff4a710..90788b0868496a5a6a3b9f6cb422d64e24e42bbb 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
/* get functions for the new mode */
mode_fn = sf;
- screen.painted = 0;
/* open the new mode */
if (mode_fn->open != NULL)
mode_fn->open(&screen, c);
+
+ screen_paint(c);
}
static int
}
void
-screen_resize(void)
+screen_resize(struct mpdclient *c)
{
if (COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS) {
screen_exit();
curs_set(1);
curs_set(0);
- screen.painted = 0;
+ screen_paint(c);
}
void
screen.buf = g_malloc(screen.cols);
screen.buf_size = screen.cols;
screen.findbuf = NULL;
- screen.painted = 0;
screen.start_timestamp = time(NULL);
screen.last_cmd = CMD_NONE;
paint_progress_window(c);
paint_status_window(c);
- screen.painted = 1;
wmove(screen.main_window.w, 0, 0);
wnoutrefresh(screen.main_window.w);
static int crossfade = -1;
static int dbupdate = -1;
- if( !screen.painted )
- screen_paint(c);
-
/* print a message if mpd status has changed */
if (c->status != NULL) {
if (repeat < 0) {
_("Auto center mode: Off"));
break;
case CMD_SCREEN_UPDATE:
- screen.painted = 0;
+ screen_paint(c);
break;
case CMD_SCREEN_PREVIOUS:
screen_next_mode(c, -1);
diff --git a/src/screen.h b/src/screen.h
index 6d264570201c37bab473967fb4af5dbbd465559b..4ad376ba8e9d09ddb9d3d86c8fc6e658acdfd5df 100644 (file)
--- a/src/screen.h
+++ b/src/screen.h
char *findbuf;
GList *find_history;
-
- int painted;
} screen_t;
extern const struct screen_functions screen_playlist;
void screen_init(mpdclient_t *c);
void screen_exit(void);
-void screen_resize(void);
+void screen_resize(struct mpdclient *c);
void screen_status_message(const char *msg);
void screen_status_printf(const char *format, ...);
char *screen_error(void);