Skip to content

Fix TText::Execute event - #23153

Merged
linev merged 3 commits into
root-project:masterfrom
linev:fix_text_exeuteevent
Aug 26, 2026
Merged

linev merged 3 commits into
root-project:masterfrom
linev:fix_text_exeuteevent

Conversation

@linev

@linev linev commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

In several classes TPad::ModifiedUpdate() used in ExecuteEvent() methods - for instance TText or TLine.
But on the Mac ModifiedUpdate() involves event execution loop - which may lead again to invocation of ExecuteEvent() method of the same object. If static variable used inside - it must be set correctly before invoking ModifiedUpdate().
Such change was implemented in TText and TLine classes.

Without such fix on Mac moving of TText/TLatex objects leads to over-moving -- object is shifted by 100 pixels when mouse moved only by 20-30 pixels.

Adjust implementation of TText::ExecuteEvent() to have better variable management.

linev added 3 commits August 26, 2026 13:04
TText uses static variables to keep previous mouse position.
These variables must be set before calling TPad::ModifiedUpate()
while on Mac it involves mouse events execution.
Therefore new TText::ExecuteEvent can be called and use wrong coordinates.
Results in wrong text moving behaviour

Problem appears only on the Mac.
Like in TText, change static variable before calling
pad.ModifiedUpdate() to exclude problem while on Mac
TLine::ExecuteEvent can be called again
Use less static variables and more local variables
When resize text - use methods to get and set text size in pixels
@linev
linev requested a review from bellenot August 26, 2026 11:10
@linev linev self-assigned this Aug 26, 2026
@linev
linev requested a review from couet as a code owner August 26, 2026 11:10

@bellenot bellenot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with me if it works... But since I can't test on MacOS, I'd like Olivier to review it next week

@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 12h 4m 20s ⏱️
 3 855 tests  3 855 ✅ 0 💤 0 ❌
78 574 runs  78 574 ✅ 0 💤 0 ❌

Results for commit ee9c7cc.

@linev
linev merged commit b377a14 into root-project:master Aug 26, 2026
37 of 38 checks passed
@linev
linev deleted the fix_text_exeuteevent branch August 26, 2026 14:39
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