Skip to content

Fix recursive input event loop causing stack overflow in ColorPickerSlider - #2288

Open
Rakosn1cek wants to merge 2 commits into
PintaProject:masterfrom
Rakosn1cek:master
Open

Fix recursive input event loop causing stack overflow in ColorPickerSlider#2288
Rakosn1cek wants to merge 2 commits into
PintaProject:masterfrom
Rakosn1cek:master

Conversation

@Rakosn1cek

Copy link
Copy Markdown

Description of Changes

Interacting with the colour picker wheel or slider resulted in an immediate crash due to stack overflow.

When updating colours programmatically, ColorPickerSlider.Color calls Gtk.Entry.SetText(). Under GTK4, setting text fires the OnInputFieldChanged signal even when the entry is not being actively focused or edited by the user. This re-invoked OnColorChanged, updating ColorPickerDialog, which then assigned back to Color in an infinite recursion.

This patch introduces a suppress_input_events guard to ignore input change notifications during programmatic text updates in both the Color setter and slider drag handlers, preventing the feedback loop.

Checklist

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.

1 participant