mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 20:05:59 +08:00
SPE-2575:: Do not allow busy cursor logic in webview on linux
Allow changes of cursor only when panel is shown.
This commit is contained in:
parent
47bba48b34
commit
c8cac7f678
@ -106,13 +106,24 @@ void ConfigWizardWebViewPage::load_error_page() {
|
|||||||
m_load_error_page = true;
|
m_load_error_page = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool is_linux =
|
||||||
|
#if defined(__linux__)
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
|
||||||
void ConfigWizardWebViewPage::on_idle(wxIdleEvent &WXUNUSED(evt)) {
|
void ConfigWizardWebViewPage::on_idle(wxIdleEvent &WXUNUSED(evt)) {
|
||||||
if (!m_browser)
|
if (!m_browser)
|
||||||
return;
|
return;
|
||||||
if (m_browser->IsBusy()) {
|
if (m_browser->IsBusy()) {
|
||||||
|
if constexpr (!is_linux) {
|
||||||
wxSetCursor(wxCURSOR_ARROWWAIT);
|
wxSetCursor(wxCURSOR_ARROWWAIT);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if constexpr (!is_linux) {
|
||||||
wxSetCursor(wxNullCursor);
|
wxSetCursor(wxNullCursor);
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_vetoed && m_load_error_page) {
|
if (!m_vetoed && m_load_error_page) {
|
||||||
m_load_error_page = false;
|
m_load_error_page = false;
|
||||||
|
@ -148,14 +148,25 @@ WebViewDialog::~WebViewDialog()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool is_linux =
|
||||||
|
#if defined(__linux__)
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
|
||||||
void WebViewDialog::on_idle(wxIdleEvent& WXUNUSED(evt))
|
void WebViewDialog::on_idle(wxIdleEvent& WXUNUSED(evt))
|
||||||
{
|
{
|
||||||
if (!m_browser)
|
if (!m_browser)
|
||||||
return;
|
return;
|
||||||
if (m_browser->IsBusy()) {
|
if (m_browser->IsBusy()) {
|
||||||
|
if constexpr (!is_linux) {
|
||||||
wxSetCursor(wxCURSOR_ARROWWAIT);
|
wxSetCursor(wxCURSOR_ARROWWAIT);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if constexpr (!is_linux) {
|
||||||
wxSetCursor(wxNullCursor);
|
wxSetCursor(wxNullCursor);
|
||||||
|
}
|
||||||
if (m_load_error_page) {
|
if (m_load_error_page) {
|
||||||
m_load_error_page = false;
|
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()));
|
m_browser->LoadURL(GUI::format_wxstr("file://%1%/web/error_no_reload.html", boost::filesystem::path(resources_dir()).generic_string()));
|
||||||
|
@ -218,6 +218,7 @@ void WebViewPanel::on_show(wxShowEvent& evt)
|
|||||||
{
|
{
|
||||||
m_shown = evt.IsShown();
|
m_shown = evt.IsShown();
|
||||||
if (!m_shown) {
|
if (!m_shown) {
|
||||||
|
wxSetCursor(wxNullCursor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_do_late_webview_create) {
|
if (m_do_late_webview_create) {
|
||||||
@ -238,12 +239,20 @@ void WebViewPanel::on_idle(wxIdleEvent& WXUNUSED(evt))
|
|||||||
{
|
{
|
||||||
if (!m_browser || m_do_late_webview_create)
|
if (!m_browser || m_do_late_webview_create)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// 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()) {
|
if (m_browser->IsBusy()) {
|
||||||
wxSetCursor(wxCURSOR_ARROWWAIT);
|
wxSetCursor(wxCURSOR_ARROWWAIT);
|
||||||
} else {
|
} else {
|
||||||
wxSetCursor(wxNullCursor);
|
wxSetCursor(wxNullCursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !__linux__
|
||||||
|
|
||||||
if (m_shown && m_load_error_page) {
|
if (m_shown && m_load_error_page && !m_browser->IsBusy()) {
|
||||||
m_load_error_page = false;
|
m_load_error_page = false;
|
||||||
if (m_load_default_url_on_next_error) {
|
if (m_load_default_url_on_next_error) {
|
||||||
m_load_default_url_on_next_error = false;
|
m_load_default_url_on_next_error = false;
|
||||||
@ -257,10 +266,9 @@ void WebViewPanel::on_idle(wxIdleEvent& WXUNUSED(evt))
|
|||||||
m_browser->RemoveScriptMessageHandler(Slic3r::GUI::from_u8(m_script_message_hadler_names.front()));
|
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()));
|
m_browser->AddScriptMessageHandler(Slic3r::GUI::from_u8(m_script_message_hadler_names.front()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef DEBUG_URL_PANEL
|
#ifdef DEBUG_URL_PANEL
|
||||||
m_button_stop->Enable(m_browser->IsBusy());
|
m_button_stop->Enable(m_browser->IsBusy());
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user