Skip to content

[6.42] [gui] [pad] fix text insert via tool button - #24059

Open
root-project-bot wants to merge 2 commits into
root-project:v6-42-00-patchesfrom
root-project-bot:BP_6.42_pull_24032
Open

root-project-bot wants to merge 2 commits into
root-project:v6-42-00-patchesfrom
root-project-bot:BP_6.42_pull_24032

Conversation

@root-project-bot

Copy link
Copy Markdown

Backport of #24032, requested by @linev.

linev added 2 commits November 9, 2026 06:18
kEditor was exists before, but not supported in TROOT::SetEditorMode

(cherry picked from commit 76798d5)
When TLatex tool button was clicked before,
any following mouse click on the pad insert new TLatex object
keeping previous one with empty text. As a result - after many clicks
dozens of dummy TLatex object were remain in the pad (just try gPad->ls())
Plus static fgText pointer used in TCreatePrimitives can store invalid pointer
and may lead to ROOT crash.

Therefore rewrite TCreatePrimitives::Text() functionality using
`TPad::Interactive()` features. Like with objects dragging add temporary
`TTextEditInteractive` instance which holds pointer on TLatex. Any keyboard
press will be handled only when interactive object exists.

Also avoid create multiple `TLatex` by multiple mouse clicking on pad.
If latex was created, then second click will just finish editing of this latex object.

(cherry picked from commit b0827a0)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants