summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e6d6231)
raw | patch | inline | side by side (parent: e6d6231)
author | Max Kellermann <max@duempel.org> | |
Mon, 22 Sep 2008 08:05:48 +0000 (10:05 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 22 Sep 2008 08:05:48 +0000 (10:05 +0200) |
Since the input_timestamp is only used by screen_play, move it there.
src/screen.c | patch | blob | history | |
src/screen.h | patch | blob | history | |
src/screen_play.c | patch | blob | history |
diff --git a/src/screen.c b/src/screen.c
index a76438b9c6f9b095f016fbaea11d6f364b5cf6c2..c7fece70eb83c4b9fd939f0ca6d84c626fb7f459 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
screen.findbuf = NULL;
screen.painted = 0;
screen.start_timestamp = time(NULL);
- screen.input_timestamp = time(NULL);
screen.last_cmd = CMD_NONE;
/* create top window */
void
screen_cmd(mpdclient_t *c, command_t cmd)
{
- screen.input_timestamp = time(NULL);
screen.last_cmd = cmd;
welcome = FALSE;
diff --git a/src/screen.h b/src/screen.h
index 6f98d1e4d5a238f4b6db32f0a28c2b807a3ae4fe..0165abb21df673c098d52ae886bd105cdc0b3a09 100644 (file)
--- a/src/screen.h
+++ b/src/screen.h
/* GTime is equivalent to time_t */
GTime start_timestamp;
GTime status_timestamp;
- GTime input_timestamp;
GTime last_cmd;
int cols, rows;
diff --git a/src/screen_play.c b/src/screen_play.c
index 11d4754783d15c855bda56c9e35bdf3f8433eff0..7c2dc426fcea7b1a285bdf98f2ce3d1d0ce37877 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
mpdclient_t *c;
} completion_callback_data_t;
+static GTime input_timestamp;
static list_window_t *lw = NULL;
static long long playlist_id;
{
static gboolean install_cb = TRUE;
+ input_timestamp = time(NULL);
+
if (install_cb) {
mpdclient_install_playlist_callback(c, playlist_changed_callback);
install_cb = FALSE;
/* hide the cursor when mpd are playing and the user are inactive */
if (options.hide_cursor > 0 &&
(c->status != NULL && c->status->state == MPD_STATUS_STATE_PLAY) &&
- time(NULL)-screen->input_timestamp >= options.hide_cursor ) {
+ time(NULL) - input_timestamp >= options.hide_cursor ) {
lw->flags |= LW_HIDE_CURSOR;
} else {
lw->flags &= ~LW_HIDE_CURSOR;
static int
play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
{
+ input_timestamp = time(NULL);
+
switch(cmd) {
case CMD_PLAY:
mpdclient_cmd_play(c, lw->selected);