Skip to content

Skip EnsureMinSize calls on mobile#6236

Merged
dweymouth merged 1 commit intofyne-io:developfrom
MaxGyver83:skip-ensureminsize-on-mobile
Mar 29, 2026
Merged

Skip EnsureMinSize calls on mobile#6236
dweymouth merged 1 commit intofyne-io:developfrom
MaxGyver83:skip-ensureminsize-on-mobile

Conversation

@MaxGyver83
Copy link
Copy Markdown
Contributor

Description:

When the RichText widget of this test app is being dragged, *driver.handlePaint draws become very slow on Android, see #6233. While dragging, canvasNeedRefresh is true and c.EnsureMinSize() is called. These EnsureMinSize calls take 4.36 ms on average (for the test app). Instead of trying to optimize EnsureMinSize (as in #6234), this PR is more radical: It skips EnsureMinSize calls completely (on mobile).

This might be wrong for some reason. But so far, I couldn't find any problems with it. Resizing the window in mobile simulation on Linux still works. Even split windows on Android work with this PR.

This should improve scrolling performance.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.
Copy link
Copy Markdown
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

It's drastic but I cannot think of a reason not to - it is all fixed size screens...

Anyone else have an opinion before we just merge this idea in?

@dweymouth
Copy link
Copy Markdown
Contributor

It's drastic but I cannot think of a reason not to - it is all fixed size screens...

Anyone else have an opinion before we just merge this idea in?

No reason not to if for all mobile OS, they are in full control of window size anyway

@dweymouth dweymouth merged commit 1a17fc7 into fyne-io:develop Mar 29, 2026
11 checks passed
@MaxGyver83 MaxGyver83 deleted the skip-ensureminsize-on-mobile branch March 30, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants