diff options
author | Kalle Wallin <kaw@linux.se> | 2005-06-03 16:20:42 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2005-06-03 16:20:42 +0000 |
commit | e116ea99668266f41966bd62d0e4759e3bd3a4e7 (patch) | |
tree | b06ea42cb903fba36f264ade5536505c165b7108 /src/screen_play.c | |
parent | d2ac8d20ee1a039df0df24a44d9f2ef901f69276 (diff) | |
download | mpd-e116ea99668266f41966bd62d0e4759e3bd3a4e7.tar.gz mpd-e116ea99668266f41966bd62d0e4759e3bd3a4e7.tar.xz mpd-e116ea99668266f41966bd62d0e4759e3bd3a4e7.zip |
Added a "hide cursor" feature #0000417
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3307 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/screen_play.c')
-rw-r--r-- | src/screen_play.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/screen_play.c b/src/screen_play.c index b86c876de..51c722df5 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -21,6 +21,7 @@ #include <ctype.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <glib.h> #include <ncurses.h> #include <panel.h> @@ -341,6 +342,18 @@ play_paint(screen_t *screen, mpdclient_t *c) static void play_update(screen_t *screen, mpdclient_t *c) { + /* hide the cursor when mpd are playing and the user are inactive */ + if( options.hide_cursor>0 && c->status->state == MPD_STATUS_STATE_PLAY && + time(NULL)-screen->input_timestamp >= options.hide_cursor ) + { + lw->flags |= LW_HIDE_CURSOR; + } + else + { + lw->flags &= ~LW_HIDE_CURSOR; + } + + /* center the cursor */ if( options.auto_center ) { static int prev_song_id = 0; |