diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index ccf0b26e2..ca1a011b9 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -18,6 +18,7 @@ */ #include +#include #include "rtwindow.h" #include "options.h" #include "preferences.h" @@ -319,22 +320,38 @@ void RTWindow::on_realize () mainWindowCursorManager.init(get_window()); - // Check if first run of this version, then display the Release Notes text - if (options.version != versionString) { + // Display release notes only if new major version. + // Pattern matches "5.1" from "5.1-23-g12345678" + std::string vs[] = {versionString, options.version}; + std::regex pat("(^[0-9.]+).*"); + std::smatch sm; + std::vector vMajor; + for (const auto &v : vs) { + if (std::regex_match(v, sm, pat)) { + if (sm.size() == 2) { + std::ssub_match smsub = sm[1]; + vMajor.push_back(smsub.str()); + } + } + } - // Update the version parameter with the right value - options.version = versionString; + if (vMajor.size() == 2) { + if (vMajor[0] != vMajor[1]) { - splash = new Splash (*this); - splash->set_transient_for (*this); - splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) ); + // Update the version parameter with the right value + options.version = versionString; - if (splash->hasReleaseNotes()) { - splash->showReleaseNotes(); - splash->show (); - } else { - delete splash; - splash = nullptr; + splash = new Splash (*this); + splash->set_transient_for (*this); + splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) ); + + if (splash->hasReleaseNotes()) { + splash->showReleaseNotes(); + splash->show (); + } else { + delete splash; + splash = nullptr; + } } } }