Unlike other dockables such as brush and patterns,
deleting a palette color does not automatically select
the next one. This makes it difficult to delete multiple
colors in a row. This patch gets the current index before
deleting the color, and then uses it to select the next entry
afterwards.
(cherry picked from commit a39355ca4d)
gimp_file_proc_view_process_procedure() can return NULL in case a file
loading procedure does not have any extensions set.
(cherry picked from commit 073a7a208f)
Currently, some GEGL filters must always be merged because
we don't yet have a way to store GimpDrawables with filters.
When creating these filters as part of the Filter Tool, we were
changing the "merge-filter" property directly. This mean that
if you had previously set the Filter Tool to be non-destructive,
it would be destructive the next time you added a filter (even if
the filter supported NDE).
This patch creates a separate boolean variable (initialized to the
current state of "merge-filter") and uses that instead in the
gimp_filter_tool_create_filter () function. This allows us to still
force filters with aux pads to always merge, while not affecting
the user's preferences for other NDE filters.
(cherry picked from commit 58a0c1d31e)
By being in GimpContainerIconView, the toggle was only being shown in
grid view, even though it also affected the list view. So we move it up
to the container, next to the query tag entry.
Also I am adding a function to make this toggle visible only when
requested. And so far, we only request it for the Brushes dockable,
because it doesn't do anything on other data dockables (we added some
code to follow theme, for instance in Palettes dockable, but it doesn't
depend on this setting, because it doesn't touch data render, only GUI
render where it's normal to follow theme).
The latter function fixes issue #14260.
(cherry picked from commit 1b9c78dc12)
Since these functions used in gimpbrush-load will also be used in
Photoshop pattern loading, move them to gimp-utils.
At the same time, change the signature to return a boolean which
indicates TRUE on success and make the returned value a parameter.
This makes it easier to check multiple read calls for success.
(cherry picked from commit 934c4a90cd)
Some filters such as Color to Alpha require
an alpha channel. Now that we have NDE,
filters can exist separately from layers
until they're merged down. This means
the layer itself may not have an alpha
channel, causing distortions on merge.
This patch adds a method to check if
the filter requires an alpha channel, and
adds it to the layer on merge or export if
it has such a filter.
(cherry picked from commit c2b9c21b5b)
Resolves#14240
This patch extends a9056419 to use the existing filter's
drawable (if it exists) on all other on-canvas widgets instead
of always using the selected layer.
(cherry picked from commit 9a349e812b)
… passed "0" as argument.
Adding support of none_ok for arguments of type sample_point, allowing
to pass 0 as a special value and use it on this function.
(cherry picked from commit bf14d3db20)
This reverts commit 69894d8bbf.
Let's not randomly make our API less strict on types as a workaround for
a bug. If there are specific cases where it's needed to accept 0, then
these are the cases we have to handle.
Also unlike what the commit message was saying, it's not true that this
was only affecting Script-Fu. Any change to the PDB affects by
definition the whole PDB, as well as libgimp and all bindings (over PDB
or libgimp alike). And yes, this change **was** of "real consequence".
I'll do further commits for the proper fixes to #14205.
(cherry picked from commit 2d2f1d048d)
Since MR !2158, we set the desktop name as prgname, because that's what
is expected for Wayland. But this doesn't work on Flatpak where the
desktop file is renamed (and even to different names for the stable/beta
vs. nightly flatpaks). This commit adds some special-casing when we
detect we are inside a flatpak environment.
Note that on X11 (whether or not we are in flatpak), we just always use
the original desktop name, because then it will be set as windows'
WM_CLASS which will also match the StartupWMClass key we set in the
desktop file (cf. previous commit).
(cherry picked from commit 2244d70a94)
The Foreground Selection algorithm was being run when
users switched to a different tool, even if no strokes had been
painted. This caused an unnecessary delay, since no selection
will be generated.
This patch adds a check to verify we have at least one foreground
stroke made by the user before trying to create the selection.
(cherry picked from commit 0370aed02d)
This patch removes restrictions on applying
NDE filters to channels in the GUI. Note
that layer masks are still restricted, not for
technical reasons but because UX/UI needs
to be considered further.
(cherry picked from commit 54c95577df)
Resolves#14206
If the user clicks the Fx icon in the DrawableTreeView
repeatedly (and quickly enough), the "closed" signal
function that cleans up the Filter popover does not
run before the next creation code is started. This can
results in the previous view being left in editor->vbox,
leading to duplication.
This patch checks if the editor and view already exist when
the popover opens, and if so, it runs the clean-up code first.
(cherry picked from commit 6e58d05a56)
Three types declared in pdbgen perl code,
for sample-point, guides, and tatto objects,
declare too restrictive a range of permissible values.
They should allow the value 0, which the API uses as a sentinel value,
to represent "invalid object ID".
The types are for object ID's, which are unsigned.
GObject checks the declared range when you chunk into a GValueArray,
to call the PDB.
Declaring the attribute in the perl .pdb "no-validate"
is not sufficient since GObject doesn't understand
GIMP_PARAM_NO_VALIDATE, that flag is distinct from G_PARAM_NO_VALIDATE.
Only affects the ScriptFu binding to PDB.
The GI binding to libgimp is not affected.
The declared range is no more restrictive than the underlying type
"unsigned int 32."
So of no real consequence.
The API could be changed to return a list which the caller
would iterate on.
(cherry picked from commit 69894d8bbf)
In 756fed0c, we removed code that automatically added an
alpha channel for transformed layers, as it relied on the user
setting interpolation to anything other than NONE.
This patch attempts to restore this behavior with a different
check. If gimp_matrix_is_simple () returns FALSE, it means that
the transformation requires some form of interpolation, and thus
requires an alpha channel. Flipping and translating do not trigger
a change in the alpha channel, but rotation, shearing, and perspective
transforms do (even if the tool's interpolation is set to NONE).
(cherry picked from commit 4e1967bf70)
Fixes:
> app/core/gimp-user-install.c:762:1: warning: no previous declaration for ‘user_update_post_process_menurc_over20’ [-Wmissing-declarations]
(cherry picked from commit 2056fb1dd3)
It is unused and setting it on the new toggle button doesn't seem to
work anyway as the dockable's help ID is called. Improving the help page
for this dockable, rather than adding a specific help page, seems a
better fit anyway.
(cherry picked from commit d45ff5b5cd)
Commit 80fca449a4 had a few issues:
- It was using the theme's foreground or background colors as non-entry
color, depending on whether we draw a grid or not. It should just be
the background's color.
- It was still defaulting color to white/black in some places, instead
of fg/bg colors (though I just removed these defaults because the code
just always properly set these colors later on).
- It was using the foreground colors for vertical grid lines, instead of
background color.
- It was coloring horizontal grid lines as black, instead of background
color.
(cherry picked from commit 0f900d2946)
Resolves#14192
In procedure_commands_get_display_args (), one
section missed a check for the argument array length
before trying to access the index. This caused a crash
if there were not enough arguments sent in for a Script-fu
plug-in. This patch adds that array length check to prevent
the crash.
(cherry picked from commit 6192b79d89)
In 2.10, we did not add a Undo History item for "Lock Content"
in the History dockable. In 3.0, we add the item, but Ctrl+Z
doesn't work because we don't actually push the undo item to
the stack.
Comments in fb1a6725 indicate this was intentionally left off
in 2.10. However, it's more consistent in 3.0 to have all locks
behave the same when it comes to undo history.
(cherry picked from commit e8c29f818e)
with a while() loop and get list->next before removing the filter,
because removing deleted "list" under our feet.
(cherry picked from commit d896d60a5c)
The code was still assuming that GimpTempBuf is always 8 bit. Fixed
that, and optimized it to call babl_process() once per line instead of
per pixel. Fixes#13253.
(cherry picked from commit 6151deaff9)
Floating selections are added to the same stack as
non-destructive filters. While the GUI prevents merging
filters when there is a floating selection,
gimp_drawable_merge_filters () did not explicitly prevent
this. This patch replaces the while loop to merge filters with
a for loop, and explicitly checks if the item in the stack is a
drawable filter (and not a temporary one).
(cherry picked from commit ae02db90a3)
instead of using the property dirtectly. Also make sure temporary
filters don't go to the undo stack or to the XCF.
(cherry picked from commit 2baab5aa74)
editable filters, regardless of whether they are currently editable.
Also an ugly hack to make sure the popover resizes corrently with the
number of filters.
(cherry picked from commit 90db039270)
- move the filter popover to its own file
- centralize popover sensitivity settings
- get rid of gimp_item_refresh_filters()
- lots of minor filter fixes/changes
(cherry picked from commit 27b09025be)
Many actions done on layers require refreshing its filters, by toggling
the layer off and on again. When done on an invisible layer, this would
turn it visible, which could not be undone.
Now, the layer remains invisible.
(cherry picked from commit a60c1097ab)
'gtk-menu-images' simply does not
work on GTK3 (tested on AppImage, Flatpak
and Windows) and it is not present on GTK4.
(cherry picked from commit 65feecd32d)