moved the g_signal_stop_emission_by_name() right before the calls to

2003-08-16  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpwidgets.c (gimp_coordinates_callback): moved
	the g_signal_stop_emission_by_name() right before the calls to
	gimp_size_entry_set_refval() so we only block the duplicate
	"value_changed" signal, not all of them. Fixes bug #107633.
This commit is contained in:
Michael Natterer 2003-08-16 19:46:59 +00:00 committed by Michael Natterer
parent ab566982ef
commit 790491e50f
2 changed files with 32 additions and 21 deletions

View File

@ -1,3 +1,10 @@
2003-08-16 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpwidgets.c (gimp_coordinates_callback): moved
the g_signal_stop_emission_by_name() right before the calls to
gimp_size_entry_set_refval() so we only block the duplicate
"value_changed" signal, not all of them. Fixes bug #107633.
2003-08-16 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/common/blur.c

View File

@ -976,21 +976,16 @@ typedef struct
static void
gimp_coordinates_callback (GtkWidget *widget,
gpointer data)
GimpCoordinatesData *gcd)
{
GimpCoordinatesData *gcd;
gdouble new_x;
gdouble new_y;
gcd = (GimpCoordinatesData *) data;
new_x = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
new_y = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
if (gimp_chain_button_get_active (gcd->chainbutton))
{
g_signal_stop_emission_by_name (widget, "value_changed");
if (gcd->chain_constrains_ratio)
{
if ((gcd->orig_x != 0) && (gcd->orig_y != 0))
@ -999,6 +994,8 @@ gimp_coordinates_callback (GtkWidget *widget,
{
gcd->last_x = new_x;
gcd->last_y = new_y = (new_x * gcd->orig_y) / gcd->orig_x;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1,
new_y);
}
@ -1006,6 +1003,8 @@ gimp_coordinates_callback (GtkWidget *widget,
{
gcd->last_y = new_y;
gcd->last_x = new_x = (new_y * gcd->orig_x) / gcd->orig_y;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0,
new_x);
}
@ -1016,11 +1015,15 @@ gimp_coordinates_callback (GtkWidget *widget,
if (new_x != gcd->last_x)
{
gcd->last_y = new_y = gcd->last_x = new_x;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, new_x);
}
else if (new_y != gcd->last_y)
{
gcd->last_x = new_x = gcd->last_y = new_y;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, new_y);
}
}
@ -1129,7 +1132,8 @@ gimp_coordinates_new (GimpUnit unit,
gtk_widget_show (spinbutton);
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (sizeentry),
(update_policy == GIMP_SIZE_ENTRY_UPDATE_RESOLUTION) || (menu_show_pixels == FALSE) ?
(update_policy == GIMP_SIZE_ENTRY_UPDATE_RESOLUTION) ||
(menu_show_pixels == FALSE) ?
GIMP_UNIT_INCH : GIMP_UNIT_PIXEL);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0, xres, TRUE);