Issue #6280: JPEG preview window doesn't get closed.

The port had a slight error, because in gimp-2-10, the display_ID
actually had 3 states: 0 when gimp_export_image() kept the original
image to which we just add a preview layer, -1 when it created a new
image which we wanted to put in its own display, and the display ID
itself when created.

With the new API where display variable is an object, we can only have 2
cases. So I create an additional variable separate_display to make the
distinction.
This commit is contained in:
Jehan 2021-04-30 01:31:18 +02:00
parent 802c6fe64b
commit aba721ae68
3 changed files with 4 additions and 1 deletions

View File

@ -743,7 +743,7 @@ make_preview (GimpProcedureConfig *config)
g_object_unref (file);
if (! display)
if (separate_display)
display = gimp_display_new (preview_image);
}
else

View File

@ -85,6 +85,7 @@ GIMP_MAIN (JPEG_TYPE)
gboolean undo_touched = FALSE;
GimpDisplay *display = NULL;
gboolean separate_display = FALSE;
GimpImage *orig_image_global = NULL;
GimpDrawable *drawable_global = NULL;
@ -470,6 +471,7 @@ jpeg_save (GimpProcedure *procedure,
}
display = NULL;
separate_display = TRUE;
}
break;

View File

@ -56,6 +56,7 @@ extern GimpLayer * preview_layer;
extern gboolean undo_touched;
extern gboolean load_interactive;
extern GimpDisplay *display;
extern gboolean separate_display;
void destroy_preview (void);