diff --git a/Mixer.cpp b/Mixer.cpp index dc1d07b..e93a218 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -54,7 +54,7 @@ static void saveSession(const std::string& filename, Session *session) // set session filename session->setFilename(filename); // cosmetics saved ok - Rendering::manager().setMainWindowTitle(filename); + Rendering::manager().setMainWindowTitle(SystemToolkit::filename(filename)); Settings::application.recentSessions.push(filename); Log::Notify("Session %s saved.", filename.c_str()); @@ -144,8 +144,12 @@ void Mixer::update() swap(); ++View::need_deep_update_; // inform new session filename - Rendering::manager().setMainWindowTitle(session_->filename()); - Settings::application.recentSessions.push(session_->filename()); + if (session_->filename().empty()) { + Rendering::manager().setMainWindowTitle(Settings::application.windows[0].name); + } else { + Rendering::manager().setMainWindowTitle(SystemToolkit::filename(session_->filename())); + Settings::application.recentSessions.push(session_->filename()); + } } } diff --git a/RenderingManager.cpp b/RenderingManager.cpp index cfd70b6..5ea9615 100644 --- a/RenderingManager.cpp +++ b/RenderingManager.cpp @@ -488,9 +488,11 @@ RenderingWindow::~RenderingWindow() void RenderingWindow::setTitle(const std::string &title) { - std::string fulltitle = Settings::application.windows[index_].name; - if ( !title.empty() ) - fulltitle = std::string(APP_NAME) + " -- " + title; + std::string fulltitle; + if ( title.empty() ) + fulltitle = Settings::application.windows[index_].name; + else + fulltitle = title + std::string(" - " APP_NAME); glfwSetWindowTitle(window_, fulltitle.c_str()); } diff --git a/Settings.cpp b/Settings.cpp index c61b5fb..0cee66a 100644 --- a/Settings.cpp +++ b/Settings.cpp @@ -39,13 +39,12 @@ void Settings::Save() { XMLElement *windowsNode = xmlDoc.NewElement( "Windows" ); - for (int i = 0; i < application.windows.size(); i++) + for (int i = 0; i < application.windows.size(); ++i) { const Settings::WindowConfig& w = application.windows[i]; XMLElement *window = xmlDoc.NewElement( "Window" ); window->SetAttribute("id", i); - window->SetAttribute("name", w.name.c_str()); window->SetAttribute("x", w.x); window->SetAttribute("y", w.y); window->SetAttribute("w", w.w); @@ -334,16 +333,18 @@ void Settings::Load() for( ; windowNode ; windowNode=windowNode->NextSiblingElement()) { Settings::WindowConfig w; - w.name = std::string(windowNode->Attribute("name")); windowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is windowNode->QueryIntAttribute("y", &w.y); windowNode->QueryIntAttribute("w", &w.w); windowNode->QueryIntAttribute("h", &w.h); windowNode->QueryBoolAttribute("f", &w.fullscreen); - w.monitor = std::string(windowNode->Attribute("m")); + const char *text = windowNode->Attribute("m"); + if (text) + w.monitor = std::string(text); int i = 0; windowNode->QueryIntAttribute("id", &i); + w.name = application.windows[i].name; // keep only original name application.windows[i] = w; } } diff --git a/Settings.h b/Settings.h index a9a4eab..6a51c9b 100644 --- a/Settings.h +++ b/Settings.h @@ -225,10 +225,10 @@ struct Application current_workspace= 1; brush = glm::vec3(0.5f, 0.1f, 0.f); windows = std::vector(3); - windows[0].name = APP_NAME APP_TITLE; + windows[0].name = APP_TITLE; windows[0].w = 1600; windows[0].h = 900; - windows[1].name = APP_NAME " -- Output"; + windows[1].name = "Output " APP_TITLE; } }; diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index 2fd2896..15918ad 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -1715,7 +1715,7 @@ void UserInterface::RenderMetrics(bool *p_open, int* p_corner, int *p_mode) void UserInterface::RenderAbout(bool* p_open) { ImGui::SetNextWindowPos(ImVec2(1000, 20), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("About " APP_NAME APP_TITLE, p_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize)) + if (!ImGui::Begin("About " APP_TITLE, p_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::End(); return; diff --git a/defines.h b/defines.h index a2ddab9..9069c5f 100644 --- a/defines.h +++ b/defines.h @@ -2,7 +2,7 @@ #define VMIX_DEFINES_H #define APP_NAME "vimix" -#define APP_TITLE " -- Video Live Mixer" +#define APP_TITLE "Video Live Mixer" #define APP_SETTINGS "vimix.xml" #define XML_VERSION_MAJOR 0 #define XML_VERSION_MINOR 2