Skip to content

[graphics] fix crash during objects dragging, improve TLine::ExecuteEvent#21872

Merged
linev merged 5 commits intoroot-project:masterfrom
linev:graphics_fixes
Apr 10, 2026
Merged

[graphics] fix crash during objects dragging, improve TLine::ExecuteEvent#21872
linev merged 5 commits intoroot-project:masterfrom
linev:graphics_fixes

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented Apr 9, 2026

For several classes like TBox, TLine, TEllipse ROOT will crash if during mouse dragging one press Esc key
and then will try to click on pad or just do something. Problem is remaining invalid pointer on temporary guideline pad which then accessed by mouse clicking. Fixing all concerned classes, backport for older ROOT versions will be provided.

Adjust TLine::ExecuteEvent:

  • use only TPadPainter functionality, avoid gVirtualX
  • do not change TLine coordinates from/to NDC during dragging
  • fix dragging on pad with log scale (was not working)
  • reduce gPad usage, reduce number of static variables.

Also adjust a bit code in TBox::ExecuteEvent.

One need to fully avoids usage of static variables in ExecuteEvent methods. This will be done in next PRs.

linev added 5 commits April 9, 2026 12:37
One need to cleanup guideline pad and respective objects.
Guideline objects must be cleaned up
One need to cleanup guidelines objects
Use line native coordinates for painting - they are anyway needed when set back
Therefore exclude conversion from NDC to normal coordinates during moving
Simplify/harmonize logic how first/second points are handled during movement
Use more clear conversion of coordinates to pixels.
No need to reset pad painter attributes
@linev linev self-assigned this Apr 9, 2026
@linev linev requested a review from couet as a code owner April 9, 2026 16:20
linev added a commit to linev/root that referenced this pull request Apr 9, 2026
If `Esc` key pressed when dragging object guideline pad not cleaned
correctly and leave invalid pointer.

Also restore NDC flag of TLine in such case.

This is backport of some changes from root-project#21872
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Test Results

    22 files      22 suites   3d 2h 53m 28s ⏱️
 3 833 tests  3 832 ✅  1 💤 0 ❌
75 653 runs  75 635 ✅ 18 💤 0 ❌

Results for commit c2af043.

@linev linev merged commit 4aacb18 into root-project:master Apr 10, 2026
30 of 33 checks passed
@linev linev deleted the graphics_fixes branch April 10, 2026 07:09
linev added a commit that referenced this pull request Apr 10, 2026
If `Esc` key pressed when dragging object guideline pad not cleaned
correctly and leave invalid pointer.

Also restore NDC flag of TLine in such case.

This is backport of some changes from #21872
root-project-bot pushed a commit to root-project-bot/root that referenced this pull request Apr 10, 2026
If `Esc` key pressed when dragging object guideline pad not cleaned
correctly and leave invalid pointer.

Also restore NDC flag of TLine in such case.

This is backport of some changes from root-project#21872

(cherry picked from commit c57c616)
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.

2 participants