use one global timer instead of several local ones

This commit is contained in:
Andrzej Rybczak
2009-10-26 18:14:06 +01:00
parent a91d02e181
commit 164d32c079
4 changed files with 19 additions and 18 deletions

View File

@@ -277,7 +277,7 @@ int main(int argc, char *argv[])
std::string screen_title;
timeval now, past;
timeval past = { 0, 0 };
// local variables end
# ifndef WIN32
@@ -285,8 +285,6 @@ int main(int argc, char *argv[])
signal(SIGWINCH, sighandler);
# endif // !WIN32
gettimeofday(&now, 0);
MEVENT mouse_event;
mouseinterval(0);
if (Config.mouse_support)
@@ -328,13 +326,12 @@ int main(int argc, char *argv[])
MessagesAllowed = 1;
// header stuff
gettimeofday(&past, 0);
if (((past.tv_sec == now.tv_sec && past.tv_usec >= now.tv_usec+500000) || past.tv_sec > now.tv_sec)
if (((Timer.tv_sec == past.tv_sec && Timer.tv_usec >= past.tv_usec+500000) || Timer.tv_sec > past.tv_sec)
&& (myScreen == myPlaylist || myScreen == myBrowser || myScreen == myLyrics)
)
{
RedrawHeader = 1;
gettimeofday(&now, 0);
gettimeofday(&past, 0);
}
if (Config.header_visibility && RedrawHeader)
{