From eb3b08b45e955de3d8d5c8e97ece406200a51fc3 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Thu, 21 May 2009 11:59:21 +0200 Subject: [PATCH] clear window title at exit --- configure.in | 2 +- src/ncmpcpp.cpp | 1 + src/status.cpp | 22 ++++++++++------------ src/status.h | 6 ++++++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 1890ca59..b91f03e3 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(ncmpcpp, 0.3.4) +AM_INIT_AUTOMAKE(ncmpcpp, 0.3.5_pre) AC_PREREQ(2.59) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index fb01ecb2..36f9e99c 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -1782,6 +1782,7 @@ int main(int argc, char *argv[]) errorlog.close(); Mpd->Disconnect(); DestroyScreen(); + WindowTitle(""); return 0; } diff --git a/src/status.cpp b/src/status.cpp index 9235ade0..8259024b 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -51,20 +51,18 @@ namespace bool block_statusbar_update = 0; bool block_progressbar_update = 0; bool allow_statusbar_unlock = 1; - -# ifndef USE_PDCURSES - void WindowTitle(const string &status) - { - static const string term_type = getenv("TERM") ? getenv("TERM") : ""; - - if (term_type != "linux" && Config.set_window_title) - std::cout << "\033]0;" << status << "\7"; - } -# else -# define WindowTitle(x); -# endif // USE_PDCURSES } +#ifndef USE_PDCURSES +void WindowTitle(const string &status) +{ + static const string term_type = getenv("TERM") ? getenv("TERM") : ""; + + if (term_type != "linux" && Config.set_window_title) + std::cout << "\033]0;" << status << "\7"; +} +#endif // !USE_PDCURSES + void StatusbarGetStringHelper(const std::wstring &) { TraceMpdStatus(); diff --git a/src/status.h b/src/status.h index b8d1d6fb..41990e63 100644 --- a/src/status.h +++ b/src/status.h @@ -24,6 +24,12 @@ #include "mpdpp.h" #include "ncmpcpp.h" +#ifndef USE_PDCURSES + void WindowTitle(const std::string &); +#else +# define WindowTitle(x); +#endif // USE_PDCURSES + void LockProgressbar(); void UnlockProgressbar();