Commit graph

25843 commits

Author SHA1 Message Date
Bruno Lopes
811c0c8546 app: Use posix_spawn on macOS
Fixes a Apple Clang warning.
vfork is considered deprecated and unsafe on such platform
2026-03-30 16:09:13 -03:00
Bruno Lopes
74efec2b76 app: Fix mixed declaration and code of infoCount 2026-03-29 21:07:00 -03:00
Bruno Lopes
e6eeaba58e app: Explicity cast third argument of gimp_enum_radio_box_add to gint
To fix a Apple Clang warning.

gint is what the function on app/widgets/gimpwidgets-utils.h expects.
2026-03-29 21:07:00 -03:00
Bruno Lopes
6300b7377f app: Fix mix of declaration and code on *request and *session 2026-03-29 21:07:00 -03:00
Bruno Lopes
9e664f140d app: Do not set max_n_props array length with const as per Apple Clang warning 2026-03-29 21:07:00 -03:00
Bruno Lopes
a71ecd0dda app: Import all Foundation headers needed for NSLocale
The previous NSLocale.h include was limited and not enough,
causing warnings from Apple Clang. Let's fix that.
2026-03-29 18:56:51 -03:00
Bruno Lopes
c69549aff5 app, libgimpwidgets: Fix some declarations mixed with code 2026-03-29 17:19:42 -03:00
Bruno Lopes
af1dac3c51 app, plug-ins: Comment unused stuff on macOS
This fixes Apple Clang warnings about:

- idx
- count_large
- count_nan
- n
- iteration
- original_id
- real_pos
2026-03-29 17:19:42 -03:00
Bruno Lopes
f4f1baf5ef app, libgimp, libgimpbase, libgimpwidgets, plug-ins: Add macro to unused code
This fixes Apple Clang warnings about:

- xdiff
- ydiff
- gimp_ui_get_foreign_window
- locale_parser_parse
- use_app_menu
- gimp_unique_dbus*
- transient_set
- gimp_get_foreign_window
- support
2026-03-29 17:19:42 -03:00
Alx Sa
8eae22306a widgets: Block signals when changing visible filters
eec9d512 did not block calls to
gimp_drawable_filters_editor_visible_all_toggled () when
updating the "All Visible" toggle button in
gimp_drawable_filters_editor_set_sensitive (). This resulted
in unexpected visibility changes in some combinations of
filters being turned on and off.
This patch adds the blocking calls around the call to
gtk_toggle_button_set_active () to keep this consistent.
2026-03-29 12:36:39 +00:00
Anders Jonsson
69c32c89eb app, etc: fix presets typo in blurb 2026-03-29 01:03:59 +01:00
Bruno Lopes
e64058d23b app: Silence variable is not needed and will not be emitted warnings 2026-03-28 19:51:25 -03:00
Bruno Lopes
2381ec5c7c app: Convert history_duration to gdouble for unambiguous division 2026-03-28 19:51:25 -03:00
Bruno Lopes
3835167be6 app: Convert some vars to guint so make bitwise operation unambiguous
Silences a GNU Clang warning.
2026-03-28 19:51:25 -03:00
Bruno Lopes
0530069052 app: Convert color_type to signed int so make the check meaningful
This fixes a GNU Clang warning:

warning: result of comparison of unsigned enum expression >= 0 is always true
2026-03-28 19:51:25 -03:00
Bruno Lopes
0834c7c954 app, plug-ins: Use GINT_TO_POINTER / GPOINTER_TO_INT for portability
Doing traditional explicit conversion (casting) causes warnings.
See: https://docs.gtk.org/glib/conversion-macros.html
2026-03-28 19:51:25 -03:00
Bruno Lopes
c8c420aa18 app, plug-ins: Comment pixel, total, flags and count unused variables 2026-03-28 19:51:25 -03:00
Alx Sa
6369574261 dialogs: Make Metadata Rotation images clickable
This patch makes it so that you can click the preview for
Original and Rotated images in the Metadata Rotation Import Dialog,
and have it open the image rotated as shown in the preview.
This supplements the existing button options, and matches how other
software works.
When hovering over the images, the cursor turns into a pointer to
further suggest it is clickable.
2026-03-27 21:21:39 +00:00
Aditya Tiwari
48e194532e app: show "Tab" accelerator label for windows-hide-docks
Tab was intentionally removed from the action entry to avoid overriding
its standard accessibility usage across the software, leaving the menu
item and shortcut editor showing no shortcut. This adds a cosmetic hint
in gimp_action_get_display_accels() to show 'Tab' without registering a
real accelerator.
2026-03-27 18:06:17 +01:00
Jehan
75eb99dca3 app: use build-time paths, not run-time ones for the gimprc man dump.
The problem especially occurs for our new build rule where we generate
the gimprc man page from within the build. In particular, it uses a
temporary config folder generated on the fly (with a random folder name)
and sets various environment variables such as GIMP3_SYSCONFDIR. So if
we use the runtime paths, our man page will be full of bogus paths.

In any case, for a man page, it just makes sense to use the real install
prefix. This of course assumes non-relocatable builds, and an
XDG-compliant installation (as it uses the $XDG_CONFIG_HOME variable),
but that was already what we were showing in the template man page, and
man pages are mostly for Linux, *BSD, etc. So that works fine.
2026-03-27 16:03:33 +00:00
v4vansh
f3b14044e4 app/config: natively expand paths in gimprc manpage 2026-03-27 16:03:33 +00:00
v4vansh
fa097df908 app/config, docs: fix gimprc manpage regeneration 2026-03-27 16:03:33 +00:00
Alx Sa
ca5438c6da widgets: Prevent deleting temporary filters
Resolves #12791 (again)
After cleaning up and separating the filter pop-up code
from GimpItemTreeView to GimpDrawableTreeView-Filters,
we accidentally lost the checks that prevent deleting filters
that have not yet been applied (thus causing a crash).
This patch restores the checks for the filter to not be temporary
before you can delete it.
2026-03-26 15:26:10 +00:00
balooii
8bdb5cbfd7 app: Fix duplicating vector layers 2026-03-26 11:52:24 -03:00
Alx Sa
d1662f8f2c core: Stop double-resizing on Fit Canvas to Layers
Resolves #16018
This patch extends a2c5d70c to also apply to the
"Fit Canvas to Layers" action. It prevents the non-rasterized
vector layer from being shifted out of place when the
canvas is resized.
2026-03-26 05:44:27 +00:00
Alx Sa
a131100075 core: Prevent double-resizing on vector image crop
Resolves #16045
This patch extends a2c5d70c to also apply to the Crop Tool.
It prevents the non-rasterized vector layer from being shifted
out of place when cropped.
2026-03-26 05:02:52 +00:00
balooii balooii
a2c5d70c92 core, path: Fix image transforms with vector layers
(Modified by CmykStudent from balooii's original merge request)
When performing image-level operations (resize, crop, scale, flip,
rotate, arbitrary transform), paths referenced by non-rasterized vector
layers were being transformed twice:

1. Via the vector layer's overrides, which explicitly transforms
   the referenced path to keep it in sync
2. Via the image-level queue that processes all paths independently

This patch adds a check for whether the layer has been rasterized.
If so, we bypass the vector layer's transform so the path is not
transformed a second time.
2026-03-25 20:29:17 -04:00
Alx Sa
c3cbd5c21f core: Use selection when counting colors...
...in Histogram Editor.
The 2.10 Colorcube Analysis plug-in took into
account the selection when displaying the colors.
The Histogram Editor itself does as well, but our
unique color count did not.
This patch adds a check in gimp_histogram_unique_colors ()
to see if there's an active selection in the image.
If so, we get its area and use that as the bounds in
gegl_buffer_iterator_new () instead of setting it to NULL.
2026-03-25 12:43:00 +00:00
Jehan
7f67536f1a Issue #16010: do not mind buffers with non-0 offsets in the case of group layers.
In fact, the previous commit was unneeded and we could have done without
reverting the old commit. On the other hand, a buffer using another
buffer as "source" may be nicer in memory.

But the previous commit alone was not right as group boundaries were
wrong. In fact, right now, we can see that group boundaries are computed
using only the children layers (except for pass-through of course), not
including any effects they might have. And the buffer passed to
gimp_drawable_set_buffer_full() was the projection's buffer itself — it
was shared, which was also why copying at setting time was wrong —, in
the case of a group layer. That means that when we translated to (0, 0)
offset, either we would have moved the render to the wrong place, or
moved the boundaries to the wrong place.
The offset needs to stay what it is, even when it's not (0, 0), for
group layers.

Another alternative fix would be instead to fix layer groups' boundaries
to encompass the full projection's render. But I just went with this
special-casing of group layers instead.
2026-03-24 20:41:53 +01:00
Jehan
af44043108 Issue #16010: adding a layer with filter to a group makes it invisible.
Part of it reverts commit 3a53e4743e.
Another part is a fix to the CRITICAL mentioned in this commit.

This being said, it's clearly not entirely right yet. The boundaries of
the layer when the filter is merged are not correct, which is especially
visible when trying to draw on this layer afterwards.
Also the layer group boundaries (when reproducing the steps in #16010)
are clearly wrong too.
2026-03-24 20:37:00 +01:00
Bruno Lopes
1d4b1e098b app: Add support to installing gimp-help on GIMP*_DIRECTORY
See: https://gitlab.gnome.org/GNOME/gimp-help/-/issues/553

This is needed for some read-only packages.
2026-03-22 22:20:18 -03:00
Bruno Lopes
b697dc8a48 app: Fix critical at user_install_detect_old on distro and Flatpak packages
Closes: #16067

This fixes a regression introduced by 62467359
2026-03-22 08:17:15 -03:00
Alx Sa
7f39ea1fa9 path: Conditionally scale imported paths
The Path Import dialog has an option to choose whether
the imported paths scale to match the dimensions of the
image or not. While this variable guards scaling the paths
themselves, it did not prevent the viewbox from being scaled
Thus, the paths always appeared to be scaled.

This patch adds a check for the scale parameter in parse_svg_viewbox ()
and conditionally scales the viewbox based on user input.
2026-03-22 01:51:21 +00:00
Bruno Lopes
85044d78d1 app, build/macos: Move PYTHONHOME logic from .patch to core code
This was tested with both in-house MacPorts, in-house HomeBrew and
legacy CircleCI builds and I confirmed it works (it is needed only
by the in-house MacPorts builds).
2026-03-21 17:34:30 -03:00
Bruno Lopes
dd5349a9f5 app, build: Use gimp_installation_directory() on macOS wrapper
It is more packaging-agnostic than the previous hardcoded code.
I confirmed it works with both in-house and CircleCI builds.
2026-03-19 21:06:40 -03:00
Jehan
040fac494e app: do not leak string allocated by g_ascii_strdown(). 2026-03-18 23:36:56 +01:00
Jehan
f4f83b973c app: SwatchBooker support also uses libarchive and has similar bugs! 2026-03-18 23:11:20 +01:00
Jehan
b3eaf3a577 app: better handle error cases for invalid Swatches palette.
My use case was loading a 0-bytes swatches palette. This would crash
GIMP. And so would likely a zip archive suffixed .swatches with no .json
file in it, or a corrupted archive which would return ARCHIVE_FATAL when
attempting to read entries…

This patch fixes these edge cases. It also better handle the various
return values of libarchive. E.g. we should not abandon reading when we
get ARCHIVE_RETRY; and ARCHIVE_WARN is also a success case (despite
having some warning message).

Finally I break from the archive reading loop at the first JSON file, so
that we don't leak memory if there are several JSON file. It does raise
the question if this palette format allows such use case (several
palettes in a single .swatches archive).
2026-03-18 22:41:14 +01:00
Jehan
591518fdb1 app: fix failure to read a Procreate palette with no profiles.
The sample in the description of !2613 was failing to load with a bunch
of criticals. That was because when profiles == NULL, we would call
json_reader_end_member() while we never called the associated
json_reader_read_member(). Inverting the order of tests fix this.
2026-03-18 22:32:31 +01:00
Jehan
fdda75deb8 app: localize some more strings.
Also give a bit more accurate error message when possible, e.g. when we
may have an error message from libarchive.
2026-03-18 17:57:23 +01:00
Jehan
c837fda1e4 app: localize some error messages.
Also use the proper and more common wording "circular reference".
2026-03-18 17:17:13 +01:00
Jehan
b822a56d10 app: localize "Pressure Curve" instead of breaking into 2 words.
Much easier to localize, and it's actually our only case for input
device axis curve so far. Let's simplify.
2026-03-18 16:34:55 +01:00
Alx Sa
1d6e8a3a9c display: Simplify vector code from 916cf84e
This patch updates the vector layer DnD code to
use gimp_vector_layer_set (), instead of grabbing
the VectorLayerOptions and then FillOptions objects.
2026-03-18 02:48:56 +00:00
Alx Sa
eec9d51236 widgets: Sync filter visibility with toggle button
Resolves #16002

Since the "Toggle All Filter Visibility" button's state
is only updated when the NDE filter popover first
appears, it could get out of sync with the current state
of the filter stack.
(For instance, if you open the popover and turn all the
filters' visibility off, then clicked the button, it would try
to turn them off again)

This patch adds a check for gimp_drawable_has_visible_filters ()
whenever the filter changes, and updates the toggle button
with that value.

This patch also condenses the filter visibility check to use
the existing function rather than its own custom code.
2026-03-18 01:11:18 +00:00
balooii balooii
4026ec4828 Issue #15328: Fix crash with smudge tool and auto expand layers 2026-03-17 22:18:53 +00:00
Alx Sa
ff647fccb0 path, core: Create gimp_vector_layer_set ()
Currently to change vector layer properties,
you need to grab the VectorLayerOptions
and then grab its FillOptions or the
StrokeOptions to make changes.
To make this process more self-contained,
this patch creates a gimp_vector_layer_set ()
function that operates in the same manner
as gimp_text_layer_set (). 
This patch adds properties for Fill -
Stroke properties will be added in a
follow-up commit.
This also adds
automatic tracking for Undoing/Redoing
vector property settings.
A demonstration of its use in DnD colors
and patterns onto the layer dock is
included.
2026-03-17 19:32:51 +00:00
Bruno Lopes
3fef9e5dc6 meson, app: Remove Wintel emulation layer after TWAIN disabling
Since we will not distribute 32-bit TWAIN with the intaller anymore,
GIMP is now architecture-native on Windows like on Linux and macOS,
so there is no use for WoW64 emulation on native 64-bit installations.

Users that need to use TWAIN can build GIMP on MINGW32 shell,
using -Dtwain-unmaintained=true build option at meson setup.
2026-03-17 09:56:20 -03:00
Alx Sa
81cdda873d path: Don't transform rasterized vector layers...
...as vectors
Resolves #15997

For vector layers, we transform either the path
or the layer pixels depending on whether it is
rasterized or not. However, the check for this had
not been updated to account for the new
GimpRasterizable interface, so it did not work
properly.

This patch updates the check to use
gimp_item_is_vector_layer () instead of just
checking if the path exists, as this function
also verifies it hasn't been rasterized yet.
2026-03-15 01:40:32 +00:00
Alx Sa
4cff7cc2b5 widgets: Allow DnD pattern for vector layers in dock
Building on d8d8e7a0, we add a gimp_layer_tree_drop_viewables ()
function to handle dragging and dropping a pattern onto a Vector
layer in the layer dock.
2026-03-14 03:52:46 +00:00
Alx Sa
d8d8e7a0e8 widgets: Allow DnD for vector layers in dock
916cf84e handles dragging and dropping colors
onto vector layers on the canvas. However, we did
not handle what happens if you drag and drop onto
the layer dock.
This patch adds logic to gimp_layer_tree_view_drop_color ()
so that it also updates the vector layer fill, instead of
treating the vector layer like a raster layer and filling the
whole layer with the color.
2026-03-14 02:13:54 +00:00