diff --git a/src/slic3r/GUI/ConfigWizardWebViewPage.cpp b/src/slic3r/GUI/ConfigWizardWebViewPage.cpp index c765c4784c..0c5823b7d6 100644 --- a/src/slic3r/GUI/ConfigWizardWebViewPage.cpp +++ b/src/slic3r/GUI/ConfigWizardWebViewPage.cpp @@ -106,13 +106,24 @@ void ConfigWizardWebViewPage::load_error_page() { m_load_error_page = true; } +constexpr bool is_linux = +#if defined(__linux__) +true; +#else +false; +#endif + void ConfigWizardWebViewPage::on_idle(wxIdleEvent &WXUNUSED(evt)) { if (!m_browser) return; if (m_browser->IsBusy()) { - wxSetCursor(wxCURSOR_ARROWWAIT); + if constexpr (!is_linux) { + wxSetCursor(wxCURSOR_ARROWWAIT); + } } else { - wxSetCursor(wxNullCursor); + if constexpr (!is_linux) { + wxSetCursor(wxNullCursor); + } if (!m_vetoed && m_load_error_page) { m_load_error_page = false; diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index c244fe79d6..623187ee61 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -148,14 +148,25 @@ WebViewDialog::~WebViewDialog() { } +constexpr bool is_linux = +#if defined(__linux__) +true; +#else +false; +#endif + void WebViewDialog::on_idle(wxIdleEvent& WXUNUSED(evt)) { if (!m_browser) return; if (m_browser->IsBusy()) { - wxSetCursor(wxCURSOR_ARROWWAIT); - } else { - wxSetCursor(wxNullCursor); + if constexpr (!is_linux) { + wxSetCursor(wxCURSOR_ARROWWAIT); + } + } else { + if constexpr (!is_linux) { + wxSetCursor(wxNullCursor); + } if (m_load_error_page) { m_load_error_page = false; m_browser->LoadURL(GUI::format_wxstr("file://%1%/web/error_no_reload.html", boost::filesystem::path(resources_dir()).generic_string())); diff --git a/src/slic3r/GUI/WebViewPanel.cpp b/src/slic3r/GUI/WebViewPanel.cpp index 7666e799b7..bafc1de21c 100644 --- a/src/slic3r/GUI/WebViewPanel.cpp +++ b/src/slic3r/GUI/WebViewPanel.cpp @@ -218,6 +218,7 @@ void WebViewPanel::on_show(wxShowEvent& evt) { m_shown = evt.IsShown(); if (!m_shown) { + wxSetCursor(wxNullCursor); return; } if (m_do_late_webview_create) { @@ -238,29 +239,36 @@ void WebViewPanel::on_idle(wxIdleEvent& WXUNUSED(evt)) { if (!m_browser || m_do_late_webview_create) return; - if (m_browser->IsBusy()) { - wxSetCursor(wxCURSOR_ARROWWAIT); - } else { - wxSetCursor(wxNullCursor); - if (m_shown && m_load_error_page) { - m_load_error_page = false; - if (m_load_default_url_on_next_error) { - m_load_default_url_on_next_error = false; - load_default_url(); - } else { - load_url(GUI::format_wxstr("file://%1%/web/%2%.html", boost::filesystem::path(resources_dir()).generic_string(), m_error_html)); - // This is a fix of broken message handling after error. - // F.e. if there is an error but we do AddUserScript & Reload, the handling will break. - // So we just reset the handler here. - if (!m_script_message_hadler_names.empty()) { - m_browser->RemoveScriptMessageHandler(Slic3r::GUI::from_u8(m_script_message_hadler_names.front())); - m_browser->AddScriptMessageHandler(Slic3r::GUI::from_u8(m_script_message_hadler_names.front())); - } - - } + // The busy cursor on webview is switched off on Linux. + // Because m_browser->IsBusy() is almost always true on Printables / Connect. +#ifndef __linux__ + if (m_shown) { + if (m_browser->IsBusy()) { + wxSetCursor(wxCURSOR_ARROWWAIT); + } else { + wxSetCursor(wxNullCursor); } } +#endif // !__linux__ + + if (m_shown && m_load_error_page && !m_browser->IsBusy()) { + m_load_error_page = false; + if (m_load_default_url_on_next_error) { + m_load_default_url_on_next_error = false; + load_default_url(); + } else { + load_url(GUI::format_wxstr("file://%1%/web/%2%.html", boost::filesystem::path(resources_dir()).generic_string(), m_error_html)); + // This is a fix of broken message handling after error. + // F.e. if there is an error but we do AddUserScript & Reload, the handling will break. + // So we just reset the handler here. + if (!m_script_message_hadler_names.empty()) { + m_browser->RemoveScriptMessageHandler(Slic3r::GUI::from_u8(m_script_message_hadler_names.front())); + m_browser->AddScriptMessageHandler(Slic3r::GUI::from_u8(m_script_message_hadler_names.front())); + } + } + } + #ifdef DEBUG_URL_PANEL m_button_stop->Enable(m_browser->IsBusy()); #endif