Skip to content

[pyroot] Allow toggling batch mode from True to False in middle of session - #23789

Open
muntasir-396 wants to merge 1 commit into
root-project:masterfrom
muntasir-396:fix/pyroot-toggle-batch-mode
Open

muntasir-396 wants to merge 1 commit into
root-project:masterfrom
muntasir-396:fix/pyroot-toggle-batch-mode

Conversation

@muntasir-396

Copy link
Copy Markdown

Summary

Fixes #18900.

Problem

In PyROOT, if a session starts in batch mode (ROOT.gROOT.SetBatch(True)), app.init_graphics(...) is skipped during initial setup. When ROOT.gROOT.SetBatch(False) is subsequently called, the graphics subsystem remains uninitialized, preventing new canvases from being displayed.

Solution

  • Implemented a TROOT pythonization that intercepts SetBatch(batch) and lazily invokes app.init_graphics() when batch mode is toggled back to False.
  • Made PyROOTApplication.init_graphics idempotent with a guard flag (_graphics_initialized) to prevent redundant hook registrations across repeated toggles.

Checklist

  • Tested batch toggle behavior
  • Verified clean git diff

…ssion

Fixes root-project#18900

Pythonize TROOT to hook SetBatch so that when batch mode is disabled mid-session (SetBatch(False)), interactive graphics are initialized via app.init_graphics(). Also ensure init_graphics is idempotent to avoid duplicate registrations.

This branch has not been deployed

No deployments
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.

Allow batch mode (gROOT::SetBatch) to be changed from true to false in middle of session

2 participants