Repository navigation
Fix hang/crash when renaming a sketch (#582) - #585
Merged
Merged
Conversation
Double-clicking a word inside a sketch's rename entry opened the sketch editor: the layer column's capture-phase click gesture treated the click as a row activation and switched the window to the sketch page, hiding the bottom panel that held the focused rename entry mid-event. GTK then spun in focus-handling assertion failures, hanging the application (issue #582). The column's click handler now returns early when the clicked row's in-place name editor is open, leaving the event to the entry.
🤖 Estimated LLM implementation costReplayed each of the 1 commits in this pull request and counted the code lines each commit added or rewrote:
Added lines by language: Python 86 Full estimate
Cost model: ≈10 tokens per code line at $15/Mtok output and $3/Mtok input (assuming heavy prompt caching); input ≈ 15× output for conversation replay; a review round ≈ 42,000 tokens; a failed CI run ≈ 21,000 tokens; file reads capped at 20 kB each. Active window from first commit to merge: <1 day.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #582
Problem
Renaming a sketch from the layer column hung the application:
endless stream of
Gtk-CRITICALassertion failures(
gtk_widget_get_parent/gtk_widget_set_focus_child/gtk_widget_unset_state_flags), exactly as in the reporter's debug log.Root cause
LayerColumninstalls its click gesture in the capture phase, so itsees every click inside the column before the widgets in the rows do. A
double click on a workpiece row is treated as row activation and, for
sketch workpieces, opens the sketch editor:
_on_column_clicked→_on_workpiece_double_clicked→edit_item_requested→enter_sketch_mode→set_sketch→open_modal_page("sketch")Because the capture-phase gesture fires even when the double click landed
on the rename
Gtk.Entryitself, the double click meant to select aword in the rename editor instead switched the main window to the sketch
page. That hides the bottom panel containing the focused rename entry in
the middle of an active click sequence, and GTK's focus handling spins on
the torn-down widget.
The crash log confirms the chain:
SketchStudio.set_sketchis invokedimmediately before the assertion-failure storm begins.
Fix
WorkpieceRowandGroupRowget anis_renaming()helper.LayerColumn._on_column_clickedreturns early when the clicked row'sin-place name editor is open. The event is left to the entry, so
clicking and double-clicking inside the rename editor no longer change
the canvas selection or open the sketch editor, while rename commit
(Enter), cancel (Escape), and click-outside-to-commit behavior are
unchanged.
Testing
tests/ui_gtk/doceditor/test_layer_column_rename.py:edit_item_requested,select_items_requested,editor (guard does not over-block).
pixi run lintpasses;pixi run uitest tests/ui_gtk/doceditor(103 passed) and
pixi run test tests/core(929 passed).