Re: Bug in color display filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 21, 2000 at 02:43:09AM +0100, David Odin wrote:
> 
> 
>       Hi,
> 
>   I've found a sure way to make Gimp segfault (today's CVS):
>     start Gimp
>     File->Dialog->Display filter
>     Add a filter
>     select it on the right list
>     Click on Remove
>     Click on Remove again->Segfault.
> 
> A little bit of GDB shows that this patch solve this:
> ---------------------------------------------------------
> --- gimp/app/gdisplay_color.c.orig      Tue Nov 21 02:19:41 2000
> +++ gimp/app/gdisplay_color.c   Tue Nov 21 02:19:59 2000
> @@ -231,6 +231,7 @@
>                                ColorDisplayNode *node)
>  {
>    g_return_if_fail (gdisp != NULL);
> +  g_return_if_fail (node != NULL);
> 
>    gdisplay_color_detach_real (gdisp, node, TRUE);
>    gdisp->cd_list = g_list_remove (gdisp->cd_list, node);
> --------------------------------------------------------
> 
>   However, even if this patch works (and it does work, I've tested it),
> it only hide the problem. I guess a more appropriate patch would be to
> update cdd->dest_row to -1 after the removing of a filter as the
> following patch shows:
> --------------------------------------------------------
> --- gimp/app/gdisplay_color_ui.c.orig   Tue Nov 21 02:33:16 2000
> +++ gimp/app/gdisplay_color_ui.c        Tue Nov 21 02:34:09 2000
> @@ -310,6 +310,7 @@
>    else
>      gdisplay_color_detach_destroy (gdisp, node);
> 
> +  cdd->dest_row = -1;
>    UPDATE_DISPLAY (gdisp);
>  }
> --------------------------------------------------------
> 
  I've found another oddity in gimp/app/gdisplay_color_ui.c:

When you have a filter installed and an opened image, if you 
open the display filter window to only configure the filter and then
click on OK, the image (well the view of the image...) isn't updated
until the display is updated in a wway or another.
This is due to a missing UPDATE_DISPLAY (gdisp); in
color_display_configure_callback(), so the following patch would be more
accurate:
--------------------------------------------------------
diff -u gimp/app/gdisplay_color_ui.c.orig gimp/app/gdisplay_color_ui.c
--- gimp/app/gdisplay_color_ui.c.orig   Tue Nov 21 02:33:16 2000
+++ gimp/app/gdisplay_color_ui.c        Tue Nov 21 03:16:58 2000
@@ -310,6 +310,7 @@
   else
     gdisplay_color_detach_destroy (gdisp, node);

+  cdd->dest_row = -1;
   UPDATE_DISPLAY (gdisp);
 }

@@ -358,6 +359,7 @@
                                  gpointer   data)
 {
   ColorDisplayDialog *cdd = data;
+  GDisplay *gdisp = cdd->gdisp;
   ColorDisplayNode *node;

   if (cdd->dest_row < 0)
@@ -371,6 +373,9 @@
   cdd->conf_nodes = g_list_append (cdd->conf_nodes, node);

   gdisplay_color_configure (node, NULL, NULL, NULL, NULL);
+
+  cdd->modified = TRUE;
+  UPDATE_DISPLAY (gdisp);
 }

 void
--------------------------------------------------------

  You still need to applied the patch for gdisplay_color.c, though.

         Best Regards,

	         DindinX

-- 
David.Odin@xxxxxxxxxxx


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux