Defer speed-dial web commands off the webview callback stack

This commit is contained in:
SoftFever
2026-07-17 22:37:56 +08:00
parent dda49a2b7b
commit 2614ef7d63
2 changed files with 21 additions and 0 deletions
+7
View File
@@ -3,6 +3,8 @@
#include <slic3r/GUI/Widgets/WebViewHostDialog.hpp>
#include <nlohmann/json_fwd.hpp>
#include <atomic>
#include <memory>
#include <string>
namespace Slic3r { namespace GUI {
@@ -11,15 +13,20 @@ class SpeedDialWebDialog : public WebViewHostDialog
{
public:
explicit SpeedDialWebDialog(wxWindow* parent);
~SpeedDialWebDialog() override;
void request_show();
private:
void on_script_message(const nlohmann::json& payload) override;
void handle_web_command(const nlohmann::json& payload);
void resize_to_content(int height);
void run_action(const std::string& id, const std::string& title);
void send_actions();
bool m_page_ready{false};
// Guards the CallAfter in on_script_message across dialog destruction, same as
// PluginsDialog::m_alive (PluginsDialog.hpp:249).
std::shared_ptr<std::atomic<bool>> m_alive = std::make_shared<std::atomic<bool>>(true);
};
}}