Repository navigation
[pyroot] Allow toggling batch mode from True to False in middle of session - #23789
Open
muntasir-396 wants to merge 1 commit into
Open
muntasir-396 wants to merge 1 commit into
muntasir-396 wants to merge 1 commit into
Conversation
…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.
muntasir-396
requested review from
guitargeek,
siliataider and
vepadulano
as code owners
October 21, 2026 16:33
This branch has not been 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.
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. WhenROOT.gROOT.SetBatch(False)is subsequently called, the graphics subsystem remains uninitialized, preventing new canvases from being displayed.Solution
TROOTpythonization that interceptsSetBatch(batch)and lazily invokesapp.init_graphics()when batch mode is toggled back toFalse.PyROOTApplication.init_graphicsidempotent with a guard flag (_graphics_initialized) to prevent redundant hook registrations across repeated toggles.Checklist