Fix crash on Linux when switching between tabs in printer config (#6437)

* Fix crash due to the wrong window get returned in `PointCtrl` (SoftFever/OrcaSlicer#6261).
`getWindow()` must return the control itself, not its child control; otherwise the child control will be destroyed twice when the tab container is destroyed.

* Fix another crash on Linux caused by unused undo button
This commit is contained in:
Noisyfox 2024-08-18 16:30:45 +08:00 committed by GitHub
parent 01b16814ad
commit 4dd7d79d76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -506,6 +506,7 @@ public:
TextInput* x_input{nullptr};
TextInput* y_input{nullptr};
wxWindow* window{nullptr};
void BUILD() override;
bool value_was_changed(wxTextCtrl* win);
// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
@ -524,7 +525,7 @@ public:
x_textctrl->Disable();
y_textctrl->Disable(); }
wxSizer* getSizer() override { return sizer; }
wxWindow* getWindow() override { return dynamic_cast<wxWindow*>(x_textctrl); }
wxWindow* getWindow() override { return window; }
};
class StaticText : public Field {