diff --git a/src/browser/client.cxx b/src/browser/client.cxx index 2e8e28a..24a1fff 100644 --- a/src/browser/client.cxx +++ b/src/browser/client.cxx @@ -1,5 +1,7 @@ #include "client.hxx" +#include + #include const char* app_overlay_html = "
"; @@ -85,6 +87,9 @@ Browser::Client::Client() { }; this->app_overlay_url = "http://bolt/app"; this->apps.push_back(Browser::Window(this, details)); + this->apps.push_back(Browser::Window(this, details)); + this->apps.push_back(Browser::Window(this, details)); + this->apps.push_back(Browser::Window(this, details)); } CefRefPtr Browser::Client::GetLifeSpanHandler() { @@ -106,8 +111,14 @@ bool Browser::Client::DoClose(CefRefPtr browser) { } void Browser::Client::OnBeforeClose(CefRefPtr browser) { - // note: last callback while the browser exists - it's too late to send process messages at this point fmt::print("[B] OnBeforeClose for browser {}\n", browser->GetIdentifier()); + this->apps.erase( + std::remove_if( + this->apps.begin(), + this->apps.end(), + [&browser](const Browser::Window& window){ return window.IsClosingWithHandle(browser->GetIdentifier()); } + ) + ); } bool Browser::Client::OnProcessMessageReceived(CefRefPtr browser, CefRefPtr frame, CefProcessId, CefRefPtr message) {