mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-29 13:52:07 +00:00
fix linux crash bug,update linux version info.
This commit is contained in:
@@ -38,9 +38,9 @@
|
|||||||
<color type="primary" scheme_preference="light">#009688</color>
|
<color type="primary" scheme_preference="light">#009688</color>
|
||||||
</branding>
|
</branding>
|
||||||
<releases>
|
<releases>
|
||||||
<release version="2.2.1" date="2025-12-26">
|
<release version="2.2.4" date="2026-3-4">
|
||||||
<description>
|
<description>
|
||||||
<p>Version 2.2.1 release with improvements and bug fixes.</p>
|
<p>Version 2.2.4 release with improvements and bug fixes.</p>
|
||||||
</description>
|
</description>
|
||||||
</release>
|
</release>
|
||||||
</releases>
|
</releases>
|
||||||
|
|||||||
@@ -330,11 +330,25 @@ bool CheckboxFileDialog::get_checkbox_value() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// GTK requires width >= -1 and height > 0 for gtk_window_resize/set_size_request.
|
||||||
|
// Use minimum 100 to avoid 0 or negative dimensions from bad config or Intersect().
|
||||||
|
static const int WINDOW_MIN_WIDTH = 100;
|
||||||
|
static const int WINDOW_MIN_HEIGHT = 100;
|
||||||
|
|
||||||
|
static void clamp_rect_to_minimum_size(wxRect &rect)
|
||||||
|
{
|
||||||
|
if (rect.width < WINDOW_MIN_WIDTH)
|
||||||
|
rect.width = WINDOW_MIN_WIDTH;
|
||||||
|
if (rect.height < WINDOW_MIN_HEIGHT)
|
||||||
|
rect.height = WINDOW_MIN_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
WindowMetrics WindowMetrics::from_window(wxTopLevelWindow *window)
|
WindowMetrics WindowMetrics::from_window(wxTopLevelWindow *window)
|
||||||
{
|
{
|
||||||
WindowMetrics res;
|
WindowMetrics res;
|
||||||
res.rect = window->GetScreenRect();
|
res.rect = window->GetScreenRect();
|
||||||
res.maximized = window->IsMaximized();
|
res.maximized = window->IsMaximized();
|
||||||
|
clamp_rect_to_minimum_size(res.rect);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,6 +376,7 @@ boost::optional<WindowMetrics> WindowMetrics::deserialize(const std::string &str
|
|||||||
|
|
||||||
WindowMetrics res;
|
WindowMetrics res;
|
||||||
res.rect = wxRect(metrics[0], metrics[1], metrics[2], metrics[3]);
|
res.rect = wxRect(metrics[0], metrics[1], metrics[2], metrics[3]);
|
||||||
|
clamp_rect_to_minimum_size(res.rect);
|
||||||
res.maximized = metrics[4] != 0;
|
res.maximized = metrics[4] != 0;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@@ -370,6 +385,11 @@ boost::optional<WindowMetrics> WindowMetrics::deserialize(const std::string &str
|
|||||||
void WindowMetrics::sanitize_for_display(const wxRect &screen_rect)
|
void WindowMetrics::sanitize_for_display(const wxRect &screen_rect)
|
||||||
{
|
{
|
||||||
rect = rect.Intersect(screen_rect);
|
rect = rect.Intersect(screen_rect);
|
||||||
|
// Intersect can yield 0 or negative width/height; GTK asserts on that.
|
||||||
|
clamp_rect_to_minimum_size(rect);
|
||||||
|
// Keep within display (e.g. after monitor change)
|
||||||
|
rect.x = std::max(screen_rect.x, std::min(rect.x, screen_rect.x + screen_rect.width - rect.width));
|
||||||
|
rect.y = std::max(screen_rect.y, std::min(rect.y, screen_rect.y + screen_rect.height - rect.height));
|
||||||
|
|
||||||
// Prevent the window from going too far towards the right and/or bottom edge
|
// Prevent the window from going too far towards the right and/or bottom edge
|
||||||
// It's hardcoded here that the threshold is 80% of the screen size
|
// It's hardcoded here that the threshold is 80% of the screen size
|
||||||
|
|||||||
@@ -554,6 +554,9 @@ void ObjectDataViewModel::UpdateBitmapForNode(ObjectDataViewModelNode *node)
|
|||||||
scaled_bitmap_name += std::to_string(vol_type);
|
scaled_bitmap_name += std::to_string(vol_type);
|
||||||
scaled_bitmap_name += (wxGetApp().dark_mode() ? "-dm" : "-lm");
|
scaled_bitmap_name += (wxGetApp().dark_mode() ? "-dm" : "-lm");
|
||||||
|
|
||||||
|
if (!m_bitmap_cache)
|
||||||
|
return;
|
||||||
|
|
||||||
wxBitmap* bmp = m_bitmap_cache->find(scaled_bitmap_name);
|
wxBitmap* bmp = m_bitmap_cache->find(scaled_bitmap_name);
|
||||||
if (bmp == nullptr) {
|
if (bmp == nullptr) {
|
||||||
std::vector<wxBitmap> bmps;
|
std::vector<wxBitmap> bmps;
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ PrinterCloudAuthDialog::PrinterCloudAuthDialog(wxWindow* parent, PrintHost* host
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_browser->Hide();
|
m_browser->Hide();
|
||||||
m_browser->SetSize(0, 0);
|
// GTK asserts on width < -1 and height <= 0; use minimal size for hidden widget
|
||||||
|
m_browser->SetSize(1, 1);
|
||||||
|
|
||||||
// Connect the webview events
|
// Connect the webview events
|
||||||
Bind(wxEVT_WEBVIEW_NAVIGATING, &PrinterCloudAuthDialog::OnNavigationRequest, this, m_browser->GetId());
|
Bind(wxEVT_WEBVIEW_NAVIGATING, &PrinterCloudAuthDialog::OnNavigationRequest, this, m_browser->GetId());
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_browser->Hide();
|
m_browser->Hide();
|
||||||
m_browser->SetSize(0, 0);
|
// GTK asserts on width < -1 and height <= 0; use minimal size for hidden widget
|
||||||
|
m_browser->SetSize(1, 1);
|
||||||
|
|
||||||
SetSizer(topsizer);
|
SetSizer(topsizer);
|
||||||
|
|
||||||
@@ -496,7 +497,7 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGetApp().fltviews().reload_all();
|
wxGetApp().fltviews().relead_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->EndModal(wxID_OK);
|
this->EndModal(wxID_OK);
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ WebPresetDialog::WebPresetDialog(GUI_App* pGUI, long style)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_browser->Hide();
|
m_browser->Hide();
|
||||||
m_browser->SetSize(0, 0);
|
// GTK asserts on width < -1 and height <= 0; use minimal size for hidden widget
|
||||||
|
m_browser->SetSize(1, 1);
|
||||||
|
|
||||||
SetSizer(topsizer);
|
SetSizer(topsizer);
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ SMUserLogin::SMUserLogin(bool isLogout) : wxDialog((wxWindow *) (wxGetApp().main
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_browser->Hide();
|
m_browser->Hide();
|
||||||
m_browser->SetSize(0, 0);
|
// GTK asserts on width < -1 and height <= 0; use minimal size for hidden widget
|
||||||
|
m_browser->SetSize(1, 1);
|
||||||
|
|
||||||
// Log backend information
|
// Log backend information
|
||||||
// wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
// wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ ZUserLogin::ZUserLogin() : wxDialog((wxWindow *) (wxGetApp().mainframe), wxID_AN
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_browser->Hide();
|
m_browser->Hide();
|
||||||
m_browser->SetSize(0, 0);
|
// GTK asserts on width < -1 and height <= 0; use minimal size for hidden widget
|
||||||
|
m_browser->SetSize(1, 1);
|
||||||
|
|
||||||
// Log backend information
|
// Log backend information
|
||||||
// wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
// wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
||||||
|
|||||||
Reference in New Issue
Block a user