1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-05 21:02:42 +02:00

25478 Commits

Author SHA1 Message Date
Alx Sa
a5182a010f tools: Fix missing cursor for MyPaint Brush tool
Resolves #15001
In the MyPaint Brushes v2 port (ea8b9dc1),
I implemented a cursor_update () function from the
parent class. However, I did not call the parent's
version of the function afterwards, so the MyPaint
Brush cursor was not being redrawn. This patch
adds the call to fix the cursor display issue.
2025-10-03 22:14:52 +00:00
Øyvind Kolås
9c2c5ff183 meson, app: depend on GEGL-0.4.64 2025-10-03 23:56:36 +02:00
Bruno Lopes
f09007507f Declare gexiv2 dependency on many targets (due to gimpmetadata.h)
Our build files were relying 'sysroot' to find gexiv2.h but this is
not possible with Apple Clang om which sysroot points to macOS SDK.
So, exotic environments like Homebrew were failing. Let's fix this.
2025-10-03 18:31:53 -03:00
Alx Sa
81c67e5614 tools: Don't commit Filter Tool without a filter
The Filter Tool is a "hidden" tool that we switch to
when applying a filter. Like other tools, it commits when
we save our image. However, we may no longer have an
active filter in the tool when we do so (like, after applying
an NDE filter). Because we check the drawable from the
filter to confirm whether we should force NDE or not,
this can cause a CRITICAL when we try to access a now
non-existent filter.

This patch extends the "if (filter_tool->filter)" check to
cover the full commit check process, to prevent the bug.
2025-10-02 12:07:25 +00:00
Øyvind Kolås
67fa72a94e meson, app: depend on babl-0.1.116 2025-10-02 13:22:29 +02:00
Alx Sa
36330a271a tools: Prevent bucket fill on link/vector layers
Resolves #14993
We currently prevent paint tools from painting on
link or vector layers. However, we had not added this
protection to the bucket fill tool. This patch copies over
the relevant if statements to prevent this.
2025-10-01 13:23:09 +00:00
Jehan
baa4825880 app: use the new release/ alias URLs for the "Learn more" link of…
… Release Notes tab.
2025-10-01 14:40:18 +02:00
Jehan
eb0bfe7bdb Issue #13553: pop an error dialog up only for specific GIO error.
This fixes 46d9a09698. There was a reason why this was not implemented
as an assert-type error nor as a user-facing error: network problems
happen.

We cannot pop an error up every time:

* The computer is offline! 😱 GIMP is not made to be run as a connected
  software and working on GIMP with a non-connected computer is a
  perfectly valid way of using GIMP.
* gimp.org is down (it's rare, but it happens and it should not have any
  impact to creators with GIMP).
* You are behind some kind of proxy or other complicated network
  configuration which GIO is not able to pass through.
* And any other reason which could make your GIMP not able to read the
  remote json file…

Instead let's check the more particular domain and error code, though
even this I hesitated between doing this change or simply reverting
commit 46d9a09698.
Indeed it's still quite a generic G_IO_ERROR_NOT_SUPPORTED error, so I
do hope we cannot get it in other normal conditions where reading a
remote link may fail. The last thing we want is GIMP popping up errors
which are neither bugs in our code, nor environment issues for which
anyone can do anything about.
2025-09-29 20:31:40 +02:00
Jehan
f4a7da1ee3 app, pdb: similar to the previous commit, but for files loaded with…
… gimp_file_load().

We make sure that the load procedure associated to the file is the one
used for the inner-file (in case of imbricated files into container
formats).

Also let's set the imported file unless it's a XCF inner format.
2025-09-29 17:46:32 +02:00
Jehan
bb9d8df855 app: make sure we only consider the inner file load procedure to…
… determine if a file is XCF.

This was kinda already working for files loaded through the GUI. Yet the
code in file_open_file_proc_is_import() was assuming a file loaded
through the file-compressor plug-in is necessarily XCF.

Even though it is the original use, the code in file-compressor is
actually generic and is able to load any supported format additionally
compressed with gz, bz2 or xz.
Furthermore, we will soon support zip-ped imaged, explicitly to support
the format .hgt.zip which is quite common (see !2483). So remove any
logic of a file loaded by file-compressor as meaning it's a compressed
XCF.
2025-09-29 17:46:32 +02:00
Bruno Lopes
789af76a32 app: Move "Documentation" link one line up over (community) "Tutorials"
Users were thinking the tutorials are some kind of official docs,
but they are not maintained as the official GIMP help website,
they are more like informal documentation about GIMP made public.

Let's clarify this reordering the buttons.
2025-09-29 07:32:12 -03:00
Bruno Lopes
46d9a09698 app: Use 'g_message' (like the help plug-in) when GVFSd-HTTP is not present
Closes #13553

Such issue tends to affect only AppImage users (e.g. when running it in
KDE installations). This is because AppImage files are not ran by
any host helper (e.g. snapd or flatpak) to connect to GVFSd and is
not possible to bundle GVFSd due to its own nature (it is daemon).

Since GVFS is listed in the INSTALL file as a required dependency, it is
fair enough to be more clear when it is not present, otherwise users will
have outdated GIMP without knowing (like happened in macOS in the past).

We are already doing this with GIMP help plug-in by the way. The
difference is that, at GIMP start, such techinical error message can
be surprising, but even so it is needed as feedback for fail on the
update check button in the end of day. Let's follow GIMP help on this.
2025-09-27 11:39:36 -03:00
Alx Sa
714e9041d8 pdb: Set choice args to default in gimp-file-load
This patch resolves the same issue as 8021b464,
but for `gimp-file-load`.
2025-09-26 23:57:51 +00:00
Jehan
24c8f86c85 app: minor indentation cleanup. 2025-09-26 23:30:37 +02:00
Gabriele
7f8298467b Issue #11869: use a custom AppMenu for macOS 2025-09-26 11:43:47 +00:00
Jehan
0af9261980 app: fix rendering background of Colormap dockable.
The rgba variable would be used uninitialized. This needs to be moved
one loop level up so that the color extracted at each cell start
position is properly reused (and also so that the full transparent color
at no-entry position is properly set and reused too).
2025-09-25 01:27:54 +02:00
luzpaz
155e951fa6 app: Fix description typo
This patch fixes a minor typo in a user-facing description within app/path/gimpvectorlayer.c  
This was found via codespell.
2025-09-24 17:24:28 +00:00
Jehan
5a22a9b931 app: make sure we don't crash dereferencing a NULL GError.
I think most, if not all, failure cases of file_open_with_proc_and_display()
should allocate a GError by now. But just in case we missed some edge
case, better not crash.
For instance, we were crashing when opening a remote file because of
this line before the previous commit was pushed.
2025-09-24 19:15:47 +02:00
Jehan
2187f0a49c app: fix opening remote files.
This got broken with commit 66cdecb0fa. It is now possible to open
remote files again.
2025-09-24 19:10:33 +02:00
luzpaz
91418131a0 app, libgimp*, pdb, themes: Fix description typos
This patch fixes minor typos in user-facing descriptions
and internal comments found by Codespell.
2025-09-24 16:50:15 +00:00
Jehan
28fa2e5fc7 app, libgimp, pdb: new function gimp_link_layer_get_mime_type().
As discussed with NikcDC, this will be useful, for instance for the SVG
export to know the mime type of the linked file. If not PNG, JPG or SVG,
we may want to output a small warning that some viewers may not be able
to read such files, since the SVG spec makes the support of these 3
formats only as mandatory.
2025-09-24 16:11:01 +02:00
Jehan
b121ddd6f8 app, pdb: do not leak a GFile in gimp_temp_file() or any future…
… PDB API which will return a newly allocated GFile.

Though gimp_temp_file() was so far the only such case where a returned
GFile was being leaked, it may happen again. So the PDB must instead
assume that all returned GFile-s have their own reference and take over
said reference.

And therefore update all other functions to increase the internal
GFile-s reference counts.
2025-09-24 02:22:43 +02:00
Jehan
ba1de3b68e app, libgimp, pdb: add GimpLinkLayer base API.
Still more to be done, but this is the basic, working API.
2025-09-24 01:56:52 +02:00
Jehan
789d82355c app, pdb: "Add Layer Mask" dialog asks whether to edit mask immediately.
While there are cases when you want to edit the mask straight away (this is
often the case when starting with a white or black mask), in many other cases,
the mask may be already as you want it per its initialization (e.g. when
initializing with a channel, selection, the alpha channel, etc.).

Until now, the Add Mask dialog was always switching to the "Edit Layer Mask"
mode by default, which forced an additional unneeded click each time you created
a mask (and were in a case where you initialize the mask as you want it
directly).

Now adding "Edit mask immediately" feature in the "Add Layer Mask dialog":

* It's checked by default to keep historical behavior.
* As most other dialogs, the last value is remembered, allowing people with
  repetitive workflow not to have to repeatedly set the settings each and every
  time.
* This default is also visible and settable in Preferences > Interface > Dialog
  Defaults.
2025-09-22 22:04:32 +02:00
Gabriele Barbero
8f57d4bdff gui: fix quit lose unsaved changes macOS
When quitting the application using "Quit" from the dock's right-click menu,
GIMP does not follow our standard quit procedure. Instead, macOS forces the
application to close, which may result in losing unsaved changes.

By adding a delegate that intercepts the applicationShouldTerminate call,
we ensure our quit code is used, preventing macOS from handling the shutdown
directly.
2025-09-22 13:29:52 +00:00
Jehan
dbf0c39bb3 app: use more recent harfbuzz API.
hb_ft_font_lock_face() (and unlock) exists since harfbuzz 2.6.5 and our
current requirement for this dependency is 2.8.2.

Fixes this compilation warning:

> app/text/gimpfont.c:1196:3: warning: ‘hb_ft_font_get_face’ is deprecated: Use 'hb_ft_font_get_ft_face' instead [-Wdeprecated-declarations]
>  1196 |   face = hb_ft_font_get_face (hb_font);
2025-09-22 00:43:11 +02:00
Jehan
a0676125a1 app: fix build warning on Windows.
Fixes following warning, seen on CI:

> ./app/dialogs/about-dialog.c:549:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
2025-09-21 22:46:48 +02:00
Lukas Oberhuber
cacb8d2035 clipboard: Fix #14639
This is the recommended fix from Gtk to use our own mime type rather than depend on a mimetype
that has a different expectation of payload.

This means drag and drop of colors uses `application/x-geglcolor` rather than `application/x-color` which expects an RGBA color rather than a structure.
2025-09-21 00:06:15 +01:00
Alx Sa
bc7cc0b698 path: Update SVG tag when exporting paths
Per Martin Owens of Inkscape and Jonathan Watt,
one of the SVG specification editors
(https://jwatt.org/svg/authoring/#doctype-declaration),
we should not export the DTD with the GimpPath SVG.
This patch also adds an explicit SVG version to the
<svg> tag.
2025-09-15 17:28:33 +00:00
Alx Sa
602300ec8e pdb, app, libgimp, libgimpconfig: Stroke/Fill Vector Layer PDB
This patch adds additional API for setting the stroke/fill
properties of vector layers. You can now set/get color, stroke
width and stroke style via the PDB. Pattern get/set API is not
yet implemented.

This patch also updates a missing parameter check for GimpVectorLayer
in gimp_config_param_spec_duplicate (), and adds additional API
in /app to make it easier to safely retrieve GimpVectorLayerOptions.
2025-09-15 14:14:46 +00:00
Jehan
4ca05cb38d app: fix crash when json parsing fails.
The argument is already a URI, not a GFile.
2025-09-11 23:31:03 +02:00
Jehan
bb9aad1e87 app: fix crash on invalid previously picked layer.
This happened to our artist in residency. She had a crash when
gimp_image_pick_layer() was apparently run with a non-NULL yet invalid
previously_picked layer. So let's make sure that we clear the stored
item pointer when the object gets finalized.
2025-09-11 23:31:03 +02:00
Jehan
7c947ef1af app, libgimpbase, plug-ins: deprecate GimpPixPipe.
This really feels like internal API which we'd want to keep private (and
used by core plug-ins only).

Also as Jacob noticed, it's not even included in libgimpbase/gimpbase.h
so plug-ins wishing to use this API need to include this file
specifically anyway (but the header is still installed and the API is
introspected).

Since we cannot remove these functions now that GIMP 3 was published,
for API stability, I am only deprecating them both in the C API with
macros and in the bindings with GObject Introspection annotations.
Therefore any third-party plug-in developer trying to use these
functions in a plug-in will get build-time or run-time warnings.

Then when we'll move on to GIMP 4 development, we can remove the
deprecation and simply make this file private-only use instead.
2025-09-11 16:23:57 +02:00
Estecka
0fd280db5c Issue #14777: Fix bad axis centering on zoom-out.
This was simply caused by two variables having been swapped.

Gimp 2 used to work properly because there were two separate mix-ups that
cancelled each other: one in the function arguments, and one in the code
itself. Gimp 3 had fixed the error in the arguments, but not in the code,
thus enabling the bug.
2025-09-09 17:44:55 +00:00
Bruno Lopes
9026d18039 app: Make possible to append _NT_SYMBOL_PATH 2025-09-09 12:57:46 -03:00
Cheesequake
71caf7eb05 Issue #13746: change incorrect variable to check for changes in y-axis 2025-09-08 14:41:41 -03:00
Alx Sa
3e96397770 dialogs: Add palette format filters to import dialog
GIMP supports importing a number of palette formats
such as Adobe Swatch Exchange and SwatchBooker.
However, this is not immediately apparent from the import
palette dialogue.
This patch adds the currently supported palette formats as
filters in the dialogue, both to let users hide irrelevant files from
view and to highlight which formats we support.
2025-09-08 01:40:41 +00:00
Alx Sa
c8cf2219ce libgimpbase, libgimpwidgets, tools, app: Remove warnings
This patch fixes a few (mostly Windows-specific) warnings on build.
* Hides functions like gimp_get_foreign_window () and variables
like transient_set that aren't used in Windows.
* Changes hollow_g_shell_quote () to not return a const gchar *,
since the value it returns is actually not const.
* Cast update_interval to double to remove warning about mixing
enums and doubles in division.
2025-09-07 18:41:13 +00:00
cheesequake
8a3fb8c08e Issue #14763: Clean new images whether linked layers or not.
Moving the gimp_image_undo_free and gimp_image_clean_all
functions outside the link layer check prevents the image getting
dirty. Hence, closing a new linked layer image without changes
doesn't open a save changes dialog anymore.
2025-09-06 17:33:58 +00:00
Alx Sa
0782b9166b display: Guard private->initial_monitor when NULL
On some systems, it is possible for gimp_image_window_switch_page ()
to be signaled when private->initial_monitor has been set to NULL but
we don't yet have a GtkWindow. This eventually produces a CRITICAL
when gimp_dialog_factory_add_foreign () is run with a NULL monitor.

This patch adds a condition so that gimp_image_window_session_update ()
is not run with a NULL monitor in those cases.
2025-09-06 16:01:07 +00:00
Gabriele Barbero
5a34856e38 core: fix wrong if condition in gimp_drawable_duplicate
Probably a typo: the wrong control variable was used in the if statement.
This caused a segfault when duplicating a drawable if new_filter was NULL.
2025-09-06 17:04:51 +02:00
Bruno Lopes
9ec28cec54 app: Fix stuck debug dialog on Xorg (X11) too 2025-09-06 10:45:04 -03:00
Bruno Lopes
d6d959c6c9 app: Add margin around buttons of gimpcriticaldialog
The dialog was inconsistent. Let's fix that.
2025-09-06 10:42:35 -03:00
Jehan
58efcf6312 app: fix dropping a dockable above/below the only dock in a dockbook.
There is no bug report that I know of as it was reported directly by
Aryeom. When a dock had only a single dockbook, if we tried to move one
of the dockable to the above or below target areas, it would fail.

The reason is that we were not counting the dockables correctly so the
code thought we were trying to move from a dockbook containing a single
dockable (single tab).
2025-09-06 12:35:52 +02:00
Alx Sa
599a6c7afe core: Fix Lab & CMYK ACB palette import
Converts the babl formats for Adobe Color Book
Lab and CMYK formats to "float", to prevent a crash
when accessing u8 Lab colors that have negative values
and CMYK colors that are too dark.
2025-09-05 11:02:13 +00:00
Jehan
05e90b1cde app: optimize the detection of filters with aux input.
As reported by Liam, apparently for someone with a lot of filters, these
node creations just to check the aux input may add up noticeable time on
boot (it may also depend on the OS too? I didn't have any noticeable
delay personally).

Unfortunately we cannot know the presence of an aux input just with
class introspection because they can be registered by the op at runtime.

This optimization is therefore twofold:

* Since we know which filters have an aux input among all the ones with
  hardcoded actions, we also hardcode this data. It means we only do the
  actual check on non-hardcoded operations (third-party filters but also
  GEGL operations which are not specifically listed in our code).
* I only do these checks once, stored by name in a hash table, because
  filters_actions_setup() is actually run several times (for different
  menus).

This should improve startup time a lot for people who experienced this
delay.
2025-09-03 18:38:16 +02:00
Jehan
a636aea98d Issue #14781: Moving link layers freezes GIMP.
Though I can't reproduce on Linux, the performance log seems to show we
spend too much time inside filters_actions_update(). Instead of creating
nodes at each update, let's just store the information about which
filter action has pad, since this should not change within the timespan
of a given session.
2025-08-31 11:56:51 -03:00
Ondřej Míchal
d985b9b377 app: Align edit tool button with text entry
The button for opening the edit panel for editing a brush / gradient /
pressure curves looks misaligned because it is added to the end of the
horizontal box and its icon is aligned to the end of the button instead
of its center.

This adds puts the text entry and the edit button into the same
horizontal box and fixes the image alignment.
2025-08-30 19:10:02 +00:00
Liam Quin (ankh/demib0y/barefootliam)
760ef381fe fix crash on build or startup if extensions file does not exist 2025-08-30 18:41:03 +00:00
Jehan
8e2a0381d7 app: generalize code for filter action sensitivity.
Remove most of the per-action special-casing. This won't scale, and in
fact it already doesn't work well with all generated actions from GEGL
operations. Considering that any third-party operation will generate an
action too, this just can't work.

Instead we know that:

- Filters on group, vector and link layers must always be run
  non-destructively.
- Non-interactive filters are always run destructively and therefore
  cannot be run on group, vector or link layers.
- GEGL graph as well, unless a specific environment is set.
- All operations with auxiliary inputs cannot be run non-destructively
  (yet) either and therefore must also be deactivated on these layer
  types.

A few more actions are still special-cased (in particular regarding
being used on grayscale drawable or on formats with an alpha channel),
though it would be nice if we could generalize these somehow eventually
too.
2025-08-30 13:58:02 +02:00