Skip to content

selection-animation#2187

Draft
colin-i wants to merge 2 commits into
PintaProject:masterfrom
colin-i:test
Draft

selection-animation#2187
colin-i wants to merge 2 commits into
PintaProject:masterfrom
colin-i:test

Conversation

@colin-i

@colin-i colin-i commented Jun 12, 2026

Copy link
Copy Markdown

Removing the “marching ants” selection animation significantly reduces CPU usage on low-power devices such as Raspberry Pi.

No additional guard is needed when removing the GLib timer source, since GLib.Source.Remove(0) is defined as a safe no-op:

GLib.Source.Remove(selection_animation_timer_id);

A UI toggle was considered, but there is currently no clear place in the existing UI to expose a global preference of this type:

Selection tools (Rectangle / Ellipse / Lasso / Magic Wand) → too fragmented and tool-specific
Edit menu → closest conceptual match (selection-related operations already live there)
View menu → would be the most appropriate conceptually, but does not currently exist

For now, this is implemented as a configuration-level option.

@cameronwhite cameronwhite 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.

I agree this is a reasonable option to have 👍 , but I think it needs to be exposed somewhere in the UI otherwise it's never going to be discovered by anyone else

This would be a good case for adding a general preferences dialog which has been discussed in some other tickets.
Let me know if you're interested in working on that, or else we can file it as a separate ticket for the future


// Timer for selection outline animation
selection_animation_timer_id = GLib.Functions.TimeoutAdd (GLib.Constants.PRIORITY_DEFAULT, 80, SelectionAnimationTick);
bool selectionAnimation = PintaCore.Settings.GetSetting ( "selection-animation", true);

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.

A couple minor suggestions here:

  • The names of setting keys should go into SettingNames.cs as constants in case they're used in multiple places
  • It might work better to check the setting in the SelectionAnimationTick function, that way changes to the setting (once a UI option is added) are picked up immediately

@colin-i colin-i marked this pull request as draft July 1, 2026 12:36
@colin-i

colin-i commented Jul 1, 2026

Copy link
Copy Markdown
Author

I added an entry in the File menu, but I made it simple, and I don't need this in SelectionAnimationTick. I could add a live-reload option, but that fits more naturally with a libadwaita preferences dialog than with this simple GTK one. Anyway, I converted it to a draft, and I am happy with "edits by maintainers".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants