diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 40ac171264..7dd2b90875 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -93,6 +93,17 @@ DesignCanvas::DesignCanvas(wxWindow* parent) // re-entrancy guard giving up looks like. Refresh() posts a paint event instead: the current // frame finishes, the event loop runs (which is where ImGui's queued characters are consumed), // and the next frame starts clean. + // MEASUREMENT: does a typed character reach the GL canvas at all? Everything downstream of + // this point is known good (ImGui reports want_text=1 and our InputText active), so if these + // lines do not appear the character never got past the panel's CHAR_HOOK / the focus chain, + // and no amount of work inside the field will help. Skips always: a pure observer. + if (m_canvas_widget != nullptr && std::getenv("SNAPORCA_UXTRACE")) { + m_canvas_widget->Bind(wxEVT_CHAR, [](wxKeyEvent& e) { + fprintf(stderr, "[UX] canvas_char key=%d\n", e.GetKeyCode()); + fflush(stderr); + e.Skip(); + }); + } m_inline_editor->request_frame = [this] { // BOTH halves, and the dirty flag first: GLCanvas3D's paint handler returns without // rendering when the canvas is not marked dirty, so a bare Refresh() posts an event that diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 4d767ddd5e..a84d370ea0 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -4184,7 +4184,14 @@ DesignPanel::DesignPanel(wxWindow* parent) fprintf(stderr, "[KEYTRACE] key=%d ui_mode=%d is_sketching=%d in_text=%d inline_busy=%d focus=%s\n", key, int(m_ui_mode), (m_viewport && m_viewport->is_sketching()) ? 1 : 0, in_text ? 1 : 0, (m_viewport && m_viewport->inline_busy()) ? 1 : 0, - fw ? (const char*) fw->GetClassInfo()->GetClassName() : "(none)"); + // wxString, not a cast: GetClassName() returns const wxChar* — wchar_t* in + // this build — and casting THAT to const char* and printing it with %s emits + // the first byte and stops at the padding NUL. Every focus= field this tracer + // has ever printed was a single letter: "wxGLCanvas" came out as "w", and so + // did "wxWindow". An instrument that silently truncates its most important + // field is worse than no instrument, and this one was trusted for a whole + // day's diagnosis. + fw ? wxString(fw->GetClassInfo()->GetClassName()).utf8_str().data() : "(none)"); fflush(stderr); }