colorpicker icon indicating copy to clipboard operation
colorpicker copied to clipboard

Fix GTK callback error

Open vinnydiehl opened this issue 3 months ago • 0 comments

gtk_timeout_add expects its callback to match the type GtkFunction, which is:

typedef gboolean (*GtkFunction)(gpointer data);

But the function is declared as gint preview_rectangle_refresh(), which is an incompatible pointer type (int (*)(void) vs int (*)(void *)).

This is causing an error:

expected ‘GtkFunction’ {aka ‘int (*)(void *)’}
but argument is of type ‘gint (*)(void)’ {aka ‘int (*)(void)’}

This is fixed in this commit. Also, destroyed pixel to prevent leaks.

vinnydiehl avatar Oct 02 '25 09:10 vinnydiehl