aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-03 14:28:49 +0200
committerMax Kellermann <max@duempel.org>2008-10-03 14:28:49 +0200
commit66f34ee6b418742d44f38ec3bdec5a8ea541bfcc (patch)
tree825976289312f2e716710d613ce1fd8bdc54367d /src/screen.c
parent0ae851aa39de5dfdf6b97c3e774aa322c820f410 (diff)
downloadmpd-66f34ee6b418742d44f38ec3bdec5a8ea541bfcc.tar.gz
mpd-66f34ee6b418742d44f38ec3bdec5a8ea541bfcc.tar.xz
mpd-66f34ee6b418742d44f38ec3bdec5a8ea541bfcc.zip
screen: removed "painted" flag
Repaint immediately instead of setting "painted=0".
Diffstat (limited to '')
-rw-r--r--src/screen.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/screen.c b/src/screen.c
index 2fd4b571f..90788b086 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -76,11 +76,12 @@ screen_switch(const struct screen_functions *sf, struct mpdclient *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
@@ -372,7 +373,7 @@ screen_exit(void)
}
void
-screen_resize(void)
+screen_resize(struct mpdclient *c)
{
if (COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS) {
screen_exit();
@@ -416,7 +417,7 @@ screen_resize(void)
curs_set(1);
curs_set(0);
- screen.painted = 0;
+ screen_paint(c);
}
void
@@ -459,7 +460,6 @@ screen_init(mpdclient_t *c)
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;
@@ -550,7 +550,6 @@ screen_paint(mpdclient_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);
@@ -566,9 +565,6 @@ screen_update(mpdclient_t *c)
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) {
@@ -788,7 +784,7 @@ screen_cmd(mpdclient_t *c, command_t cmd)
_("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);