Issue #14463: is_dirty() returns wrong value for newly loaded image.

I've been hesitating because we can consider this an API behavior
change. On the other hand, it just feels like an obvious bug. It makes
sense that all images loaded with gimp_file_load() are loaded clean and
without any undo history. So let's just fix it.
This commit is contained in:
Jehan 2025-10-23 01:52:51 +02:00
parent d63a82d53e
commit 822c26f709
2 changed files with 10 additions and 0 deletions

View file

@ -32,6 +32,7 @@
#include "pdb-types.h"
#include "core/gimp.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "core/gimpparamspecs.h"
@ -122,6 +123,10 @@ file_load_invoker (GimpProcedure *procedure,
if (! gimp_image_get_file (image))
gimp_image_set_imported_file (image, file);
gimp_image_clean_all (image);
gimp_image_undo_disable (image);
gimp_image_undo_enable (image);
}
}

View file

@ -114,6 +114,10 @@ HELP
if (! gimp_image_get_file (image))
gimp_image_set_imported_file (image, file);
gimp_image_clean_all (image);
gimp_image_undo_disable (image);
gimp_image_undo_enable (image);
}
}
@ -441,6 +445,7 @@ CODE
@headers = qw("core/gimp.h"
"core/gimpimage-undo.h"
"plug-in/gimppluginmanager-file.h"
"file/file-open.h"
"file/file-save.h"