Skip to content

[designspace] Fix fast successive put/delete glyph and false positives in reload-on-external-change#2374

Merged
justvanrossum merged 6 commits intomainfrom
fix-scheduling-and-reload
Jan 13, 2026
Merged

[designspace] Fix fast successive put/delete glyph and false positives in reload-on-external-change#2374
justvanrossum merged 6 commits intomainfrom
fix-scheduling-and-reload

Conversation

@justvanrossum
Copy link
Copy Markdown
Member

The context is: deleting ar pasting a bunch of glyphs in the font overview, and then doing Undo before the write to the backend has completed. This is quite possible with complex designspaces (when a single glyph is stored as many .glif files), since writing glyphs is quite slow (in this backend), although the user generatty doesn't notice as it happens in the background. This caused a variety of problems due to a design flaw and a bug. This PR fixes both.

  1. When scheduling writes to the backend, The FontHandler can cause a putGlyph call to be skipped it it is succeeded by a deleteGlyph. This would cause a KeyError if the glyph didn't exist in the first place. Change the behavior of deleteGlyph() so it doesn't raise KeyError when passed an unknown glyph.
  2. The external file watch logic would in some cases emit a "reload glyph map" message when the change was in fact caused by the backend itself. This causes unnecessary reloads from the front end with bad timing, and causing the undo stack to be reset unnecessarily.

@justvanrossum justvanrossum merged commit d0f1fad into main Jan 13, 2026
4 checks passed
@justvanrossum justvanrossum deleted the fix-scheduling-and-reload branch January 13, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant