Commit graph

56165 commits

Author SHA1 Message Date
Gabriele Barbero
a193d45ab8 tools: implement restore option for on-canvas text editor ...
... to reset its position via right-click menu

This commit adds the ability to restore the original position of the
on-canvas text editor after it has been moved, by accessing the option
from the context menu opened with a right-click on the text box.
2025-10-31 15:39:10 +01:00
Gabriele Barbero
83497695fd tools: store the on-canvas text editor position per text layer
Once the on-canvas text editor has been moved, its position should be
preserved across editing sessions. This commit stores the editor's
position per text layer and restores it when the layer is activated again.
2025-10-31 15:39:10 +01:00
Gabriele Barbero
bd6fc8594a tools: fix on-canvas text editor position on screen after being moved
After the on-canvas text editor has been moved, it should remain fixed
on the screen when zooming or panning the canvas. This commit preserves
the current behavior when the editor is in its original position, and
fixes its position on-screen after it has been moved.
2025-10-31 15:39:10 +01:00
Gabriele Barbero
dae8472d58 tools: allow on-canvas text editor to move
This commit implements the ability to freely move the on-canvas
text editor across the screen by introducing a drag-and-drop mechanism.
2025-10-31 15:39:10 +01:00
Jehan
bfd414ead9 Issue #9463: select back the previous tool when halting a layer effect.
This implies both when canceling or committing a filter.

Part of the fix is that we don't store filter tools as part of the tool
history, which means that when we swap back to the previous tool, the
filter tool info is dropped as though we never went through it. This
way, filter tools don't actually look as other tools (even though they
technically still are, since this is how we can implement canvas
interaction for some of the filters).
2025-10-31 13:54:59 +01:00
Jehan
dddca29423 app: move the tool swapping code to tool manager and action to tools-action.
Per review, let's avoid having all the tools history in every
GimpContext.

Also a further commit will work on special-casing filter tools, which is
why we are storing up to 3 tool infos, instead of only 2.
2025-10-31 13:54:59 +01:00
Jehan
eeb419a363 Bug 373060 - allow to easily switch to last used tool.
New action "Last Tool" ("context-tools-swap"), defaulted to <shift>X.
Thanks to Damien de Lemeny for the original patch and Alexander Hämmerle
for the test case in test-ui.c.
2025-10-31 13:54:59 +01:00
Martin
5085b2c6f4 Update Slovenian translation 2025-10-31 10:15:47 +00:00
Martin
418307a5f4 Update Slovenian translation 2025-10-31 10:08:42 +00:00
Jehan
381fad7253 plug-ins: fix memory cleanup.
This issue was raised by Anders in #15152 and it was a mean one, because
it really looked like file-ani-export was crashing inside
_gimp_procedure_config_end_export() (so after its main run function),
but somehow only when being called from another plug-in (in particular
here, from the file-compressor plug-in). So it looked like a bug
somewhere in libgimp.

It turned out to be a "simple" memory corruption which was not
immediately showing its consequences.
2025-10-31 00:32:04 +01:00
Jehan
a5fe4f1ca5 Issue #11613: crashing when freeing window handle (again).
This is a followup of commit 0ff960c45b which was the right fix, except
that we must make sure that gimp_widget_free_native_handle() is called
**before** chaining up with the widget's parent dispose().

Failing to do so, the first parent's dispose() was destroying the
associated GdkWindow, which made it impossible to call
gdk_wayland_window_unexport_handle() on it. And therefore we were still
getting handle callbacks possibly run after the window was destroyed, if
we were very fast enough to destroy a window immediately when it is
being shown.

I was still experiencing a crash when closing the Export file dialog
very fast with Esc while it was reappearing after canceling a plug-in's
export dialog.

This followup commit reorders the one case where we still had the crash
because of this order issue, and adds some docs comment to tell
developers how to use the freeing function.
2025-10-30 18:53:00 +01:00
Alx Sa
b420a7738c app, pdb: fix gimp_drawable_get_sub_thumbnail() on high-bit depth drawable.
Resolves #13598
Applies the same logic designed by Jehan
in f78a0629 to the gimp_drawable_get_sub_thumbnail
function.
This allows GimpZoomPreview and
GimpDrawablePreview in older
plug-ins to show correct previews for
images that are larger than 8-bit.
2025-10-30 01:16:25 +00:00
Jehan
8d37eab190 app: store meta extensions in pluginrc.
This is a followup to commit 9a36698915. Without this, we get shown the
meta extensions only on the first run after an update.
2025-10-29 23:25:36 +01:00
Jehan
f78a062950 app, pdb: fix gimp_drawable_get_thumbnail() on high-bit depth drawable.
This bug had several causes:

* gimp_drawable_get_thumbnail_data() is pretty crappy as it just returns
  dimensions and bpp. You get no real format information.
* When using it to create a GdkPixbuf, which seems like the most common
  usage, only sRGB (with or without alpha) in 8-bit is supported by
  GdkPixbuf.

So I'm just making sure that private _gimp_drawable_thumbnail() PDB proc
is only returning 8-bit sRGB(A) data. For thumbnailing, this is probably
fine anyway.

Fixes when calling gimp_drawable_get_thumbnail() on an item from a
high-bit depth image:

> LibGimp-CRITICAL **: 20:12:21.028: file ../../../../../../../dev/src/gimp/libgimp/gimppixbuf.c: line 112 (_gimp_pixbuf_from_data): should not be reached
2025-10-29 20:13:17 +01:00
Jehan
dcec82a6a1 Issue #15179: GExiv2Metadata is not seen as GimpMetadata parent in bindings. 2025-10-29 18:15:52 +01:00
Alx Sa
4812fddc5c widgets, actions: Allow multi-select in Document History
This patch enables multiple selections in
the GimpDocumentView widget and dockable.
It also updates the "documents-open" and
"documents-remove" actions to check if the
GimpContainerView has more than
one selection, and if so, tries to load/remove
all of those images. The action wording is
slightly edited to indicate multiple
images can now be opened/removed.
2025-10-29 14:40:19 +00:00
Sabri Ünal
94c9d225c8 plug-ins:imagemap: Use proper command title
This string is a bit tricky to find.

Go to "Menu > Filters > Web > Image Map."

This filter opens a dialog with a menu.

Go to "Menu > Tools > Use GIMP Guides..."

You can see that the command entry in the filter's menu is
"Use GIMP Guides," but it changes to
"Use Gimp Guides" in the dialog box title.

This patch fixes it.
2025-10-28 22:22:07 +03:00
Jehan
149a1b9c9a NEWS: update. 2025-10-28 16:25:46 +01:00
Jehan
578aee8c62 app, libgimp, pdb: make an early check on parasite name.
Let's make sure we won't trigger CRITICALs on core from a plug-in.
2025-10-28 16:17:16 +01:00
Jehan
95d580aa3a Issue #14014: fix removing parasite using already freed parasite's name.
gimp_image_set_simulation_intent() attachs a "image-simulation-intent"
parasite which means that it first detaches and frees the one which was
deserialized from the XCF. When calling gimp_parasite_get_name() on this
later on, we were working on a dangling pointer. It means that the fact
we didn't have crashes most of the time was the unexpected part, not the
crash itself!

Same for gimp_image_set_simulation_bpc() and "image-simulation-bpc"
parasite.

The fix is to swap the order of statements to first detach the parasite.
2025-10-28 15:57:27 +01:00
Jehan
db8310a545 app: indentation fix.
Was just itching when looking at it!
2025-10-28 14:13:13 +01:00
Jehan
1fa3bc8e51 Issue #14014: do not allow NULL or empty parasite name.
This reverts commit 7b023177a8 and reimplement it as a CRITICAL because
if this happens, a bug has occured. If so, we don't want to hide the
bug, we want to be warned of it so that we can investigate further.

Clearly it should simply not be possible to create a parasite with a
NULL name. First if we look at xcf_load_parasite(), we were already
returning early when the name was NULL. Also even the constructor
gimp_parasite_new() has an early check and will return NULL on a NULL or
empty name.

So the question is: how come we had a parasite with NULL name (if that
is really the problem)? I don't have the answer to this and it's
possible that this bug had already been fixed somehow. But in any case,
if it happens again, we'll want this CRITICAL to run.
2025-10-28 13:48:48 +01:00
Jehan
d320b85115 app: also check for an empty name.
I'm looking at #14014. It's probably not the problem either, especially
as gimp_parasite_new() would return a NULL parasite anyway with an empty
name.

But better be thorough and output a sensible error as soon as possible
when loading a XCF.
2025-10-28 13:48:48 +01:00
Marco Ciampa
272deddee1 Updated Italian translation 2025-10-28 13:40:33 +01:00
Jehan
9a36698915 Issue #15152: Export to bzip2, gzip, xz gives warnings.
We could have tweaked further the code to guess what is a meta file
procedure or not (what we have done until now) but I decided to be more
explicit and added gimp_file_procedure_[gs]et_meta() functions to
libgimp to tag a specific import/export procedure to implement a meta
format.

gimp_file_procedure_set_extensions() would still be used to list well
known formats using this meta format, for instance "hgt.zip" or
"xcf.xz,xcfxz" but the meta extension (simply "zip" or "xz"
respectively) would be used as such. No more "guessing" using the list
of extensions and assuming that at least one of them would have a dot
within.
2025-10-28 12:34:58 +01:00
Sabri Ünal
3e19611609 plug-in sphere-designer: Make a string clearer
Exp. is mostly like a short for of exponent. We have a lot of area on GUI.

Let's make it more obvious.
2025-10-28 10:36:06 +00:00
Gabriele Barbero
7b023177a8 core: check for NULL name in gimp_parasite_list_remove
Sometimes, probably due to a metadata corruption, a pasarite with a NULL
name can be present in the parasite list. This causes a crash when
trying to remove it, because `gimp_parasite_list_find` does not accept NULL
keys. This commit adds a check for NULL names in `gimp_parasite_list_remove`.
2025-10-28 00:27:51 +00:00
Jehan
8f9b742b51 Issue #14799: sync source and filtered container freeze count at creation.
This one was happening very rarely, which made it hard to track, though
I think it would happen more frequently to people with a lot of fonts
(and therefore font loading would take a lot of time) since the
problematic situation occured when the thread callback
gimp_font_factory_load_async_callback() would run after the
corresponding tagged container was created in constructor
gimp_data_factory_view_constructor().

When this happened, the source and filtered containers were not
synchronized regarding their freeze count. And in particular, the
filtered container would have one less freeze and would try to thaw once
the thread callback ran and thaw the source container, which was
provoking the CRITICAL.
2025-10-27 16:39:55 +01:00
Alx Sa
cb552d3dc0 widgets: Turn off default search in ComponentEditor
Resolves #9324
In GTK3, a default "Search" is enabled by default in GtkTreeView.
While in most places we override this with our own search feature,
it was not explicitly set for the GtkTreeView in the GimpComponentEditor
in the Channel dockable. So, it defaulted to TRUE and created an
unnecessary pop-up whenever you typed after clicking a channel.

This patch calls gtk_tree_view_set_enable_search () and turns off
this default feature.
2025-10-27 13:27:45 +00:00
Jehan
fe4924a0f2 plug-ins: don't close a NULL FILE.
In this code path, fp is NULL and failed to be opened.
2025-10-27 12:17:02 +01:00
luming zh
130cd0ec95 Update Chinese (China) translation 2025-10-27 00:20:26 +00:00
Anders Jonsson
35e793e360 po: update POTFILES.in 2025-10-25 21:25:04 +02:00
Alx Sa
96a9000169 plug-ins: Add import support for PVR textures 2025-10-25 17:50:47 +00:00
Alx Sa
0b51633021 text, pdb: Connect text outline unit to PDB 2025-10-25 12:00:52 -04:00
Anders Jonsson
9bf1152dd8 po-python: fix segmentation fault in Dzongkha language
Fixes https://gitlab.gnome.org/Teams/Translation/dz/-/issues/3

The plural form for po-python/dz.po causes a segfault when trying
to run the Python console, so change it to the plural form used
in the other Dzongkha files in GIMP.
2025-10-25 13:53:34 +02:00
Sabri Ünal
0f07df00d9 appdata: Add release URLs
This URLs are useful when users want to see more information about
release notes. They are visible on software stores like GNOME Software
and software websites like Flathub.
2025-10-25 01:47:58 +03:00
Kolbjørn Stuestøl
1737bda5b4 Update Norwegian Nynorsk translation 2025-10-24 16:01:36 +00:00
Marco Ciampa
9673001501 Small fix in Italian translation 2025-10-24 12:31:08 +02:00
Marco Ciampa
86ddbca6a1 Updater Italian translation 2025-10-24 11:24:00 +02:00
Ekaterine Papava
9183cfbab9 Update Georgian translation 2025-10-24 07:03:38 +00:00
Ekaterine Papava
92c4232e06 Update Georgian translation 2025-10-24 07:02:58 +00:00
Ekaterine Papava
b1830c1d27 Update Georgian translation 2025-10-24 07:01:14 +00:00
Jehan
a02ba3f985 NEWS: update. 2025-10-24 03:47:50 +02:00
Jehan
81795bfb9f app, libgimp, pdb: also mark images returned by a GimpLoadProcedure as clean…
… and reset their undo stack.

This is a followup to #14463 as I realized that images opened directly
by a load procedure may still be dirty, first if the plug-in developers
didn't think of cleaning themselves the image at the end, but even as we
add some metadata which adds an undo step too. So even if the plug-in
developer made a perfect job, the image would still end up dirty if it
has metadata!

Let's just make so that GimpLoadProcedure clean the image explicitly.

Note that other types of plug-ins creating images won't have such code
as we cannot anticipate every case. In fact, in some use case, maybe
someone may want a plug-in to return a dirty image with undo steps! At
least for load procedures, we can consider these pretty standardized,
knowing we want them clean upon loading.
2025-10-24 03:25:15 +02:00
Jehan
313445b4cf app, libgimp, pdb: fix docs of gimp_file_load() and gimp_image_is_dirty().
See commit 822c26f709. We decided to solve #14463 by having
gimp_file_load() always force-clean the image and reset the undo stack.
Therefore fix the docs again.
2025-10-24 03:00:16 +02:00
Jacob Boerema
9cbc928758 app, libgimp, pdb: improve Image class API docs
This mostly turns references into clickable links in the online
documentation for the Image class.
2025-10-24 00:45:15 +00:00
Jacob Boerema
2d850fe2de pdb, libgimp, app: update API docs for is_dirty and file_load
Closes #14463
2025-10-24 00:45:15 +00:00
Jehan
a9dce982a6 Issue #13787: ignore GimpControllerMouse when migrating controllerrc.
As said in previous commit, this controller was removed as commit
76ddf4421c. Unfortunately we can't easily remove the full
(GimpControllerInfo) record, unless we were to redo or enhance the
migration code, because current code works line by line.

Nevertheless this change is enough to render the GimpControllerInfo
object invalid in a way where we can detect and clean it out (cf.
previous commit).
2025-10-24 02:24:53 +02:00
Jehan
57f8e233f7 app: clean the controller manager off invalid controllers after…
… controllerrc config file deserialization.

This is the first part to handle #13787 and not a bad idea by itself
per-se, since we remove one way to crash GIMP by creating an invalid
controllerrc file.
2025-10-24 02:24:53 +02:00
Jehan
5831b7ddcb libgimpconfig: better error message when a GObject property tries to…
… deserialize with a wrong or unknown type.

The error message in issue #13787 was about trying to deserialize a
GimpControllerMouse object as GimpControllerInfo's controller. Yet
GimpControllerMouse was removed with commit 76ddf4421c so this was
failing.

With this change, such error would be more explicit, with an error
saying:

> Unknown object type: GimpControllerMouse

… instead of:

> unexpected character ')', expecting string constant

(which was very confusing to the actual issue)
2025-10-24 02:24:53 +02:00