initialize screens only if necessary

This commit is contained in:
Andrzej Rybczak
2009-06-26 18:48:00 +02:00
parent 1147795fc6
commit 450bf1b636
26 changed files with 99 additions and 41 deletions

View File

@@ -53,6 +53,7 @@ void Clock::Init()
w = new Window((COLS-Width)/2, (LINES-Height)/2, Width, Height-1, "", Config.main_color, Border(Config.main_color));
w->SetTimeout(ncmpcpp_window_timeout);
isInitialized = 1;
}
void Clock::Resize()
@@ -80,6 +81,9 @@ void Clock::SwitchTo()
if (myScreen == this)
return;
if (!isInitialized)
Init();
if (hasToBeResized)
Resize();