Skip to content

Fix AUI repaint cascade, refcount input filter, log silent exceptions#408

Merged
realcarbonneau merged 1 commit intomasterfrom
fix-aui-cascade-input-filter
Mar 13, 2026
Merged

Fix AUI repaint cascade, refcount input filter, log silent exceptions#408
realcarbonneau merged 1 commit intomasterfrom
fix-aui-cascade-input-filter

Conversation

@realcarbonneau
Copy link
Copy Markdown
Contributor

Replace the rebuild_guard context manager with a self-contained 3-layer architecture in treectrl/frame:

  1. Paint suppression: suppress ALL tree paints during refresh with empty PaintDC (breaks the self-sustaining AUI cascade where each 280ms tree paint triggers GDK damage → child repaint → repeat). One clean Refresh() fires when __refreshing clears.

  2. Per-widget idle lifecycle: each RefreshAllItems binds its own EVT_IDLE handler that monitors _dirty + one extra cycle, then clears __refreshing and releases the input filter.

  3. Refcounted EventFilter: each widget acquire()s on rebuild start and release()s on idle completion. Last widget triggers a 1s deferred deactivation to cover the post-rebuild settling period.

Also:

  • Remove rebuild_guard from viewer.refresh() and CalendarViewer.reconfig()
  • Remove dead code: rebuild_guard, _rebuild_guard_state, idle handler, contextmanager import from frame.py
  • Log all silent 'except RuntimeError: pass' via DEAD-OBJ prefix
  • Harden log_step() for Windows consoles (UnicodeEncodeError)
  • Replace em-dash with ASCII dash in log messages for portability
  • Use nonlocal instead of dict hack in sash throttle closure
  • Update LIST_MANAGEMENT.md with current architecture and 12 failed approaches

Error on startup with new installation on Windows #406

Replace the rebuild_guard context manager with a self-contained
3-layer architecture in treectrl/frame:

1. Paint suppression: suppress ALL tree paints during refresh with
   empty PaintDC (breaks the self-sustaining AUI cascade where each
   280ms tree paint triggers GDK damage → child repaint → repeat).
   One clean Refresh() fires when __refreshing clears.

2. Per-widget idle lifecycle: each RefreshAllItems binds its own
   EVT_IDLE handler that monitors _dirty + one extra cycle, then
   clears __refreshing and releases the input filter.

3. Refcounted EventFilter: each widget acquire()s on rebuild start
   and release()s on idle completion.  Last widget triggers a 1s
   deferred deactivation to cover the post-rebuild settling period.

Also:
- Remove rebuild_guard from viewer.refresh() and CalendarViewer.reconfig()
- Remove dead code: rebuild_guard, _rebuild_guard_state, idle handler,
  contextmanager import from frame.py
- Log all silent 'except RuntimeError: pass' via DEAD-OBJ prefix
- Harden log_step() for Windows consoles (UnicodeEncodeError)
- Replace em-dash with ASCII dash in log messages for portability
- Use nonlocal instead of dict hack in sash throttle closure
- Update LIST_MANAGEMENT.md with current architecture and 12 failed
  approaches
@realcarbonneau realcarbonneau merged commit 3538262 into master Mar 13, 2026
25 checks passed
@realcarbonneau realcarbonneau deleted the fix-aui-cascade-input-filter branch March 13, 2026 17:15
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