summaryrefslogtreecommitdiff
path: root/src/status.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2009-04-28 16:22:06 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2009-04-28 16:22:06 +0200
commitab7dbe9cbec9302234a7f68d69540641b88b5629 (patch)
tree357175f8449eab47c2885f1f0b823bbc8ffe7a55 /src/status.cpp
parent7e479de3e0ce89b850c1e6aeea23e58ebff5b292 (diff)
redraw statusbar after terminal resize
previous changes broke this, so here is the fix.
Diffstat (limited to 'src/status.cpp')
-rw-r--r--src/status.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/status.cpp b/src/status.cpp
index 97de7de4..cc65a023 100644
--- a/src/status.cpp
+++ b/src/status.cpp
@@ -41,6 +41,7 @@ using std::string;
string Global::VolumeState;
bool Global::UpdateStatusImmediately = 0;
+bool Global::RedrawStatusbar = 0;
namespace
{
@@ -360,7 +361,7 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *)
}
static time_t now, past = 0;
time(&now);
- if ((now > past || changed.SongID) && Mpd->GetState() > psStop)
+ if (((now > past || changed.SongID) && Mpd->GetState() > psStop) || RedrawStatusbar)
{
time(&past);
if (np.Empty())
@@ -373,7 +374,7 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *)
int mpd_elapsed = Mpd->GetElapsedTime();
if (elapsed < mpd_elapsed-2 || elapsed+1 > mpd_elapsed)
elapsed = mpd_elapsed;
- else if (Mpd->GetState() == psPlay)
+ else if (Mpd->GetState() == psPlay && !RedrawStatusbar)
elapsed++;
if (!block_statusbar_update && Config.statusbar_visibility)
@@ -412,6 +413,7 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *)
}
wFooter->SetColor(Config.statusbar_color);
}
+ RedrawStatusbar = 0;
}
else
{