Commit Graph

23020 Commits

Author SHA1 Message Date
Jehan 68a7431a10 Issue #5623: https://gimp.org/gimp_versions.json is redirected…
… to www.gimp.org.
2020-09-08 21:13:27 +02:00
Niels De Graef 5d3ca7d714 propwidget: Add gimp_prop_switch_new()
Allow developers to add a `GtkSwitch` based on a property. Also start
using it in the first preferences page.
2020-08-22 23:53:49 +00:00
Jehan e50f522d5b app: "drawable-linked" multi-drawable aware. 2020-08-17 18:28:26 +02:00
Jehan 84e587d255 app: GimpSelectionEditor multi-drawable aware.
When clicking on the selection mask (in the dockable view) or when
dropping a color on this same view, we can now select by color based on
the selected layer composition (not only one single layer, nor the whole
image as sample merged, but also a specific list of composited layers).

gimp_channel_select_by_color() is made multi-drawable aware as a
consequence of this.
2020-08-17 18:22:19 +02:00
Jehan bd452d7df1 app: (selection editor) fix clicking on selection mask or dropping color
I discover that the selection editor has these hidden features that (1)
you can click on the selection mask (in the editor dockable) and it
behaves like the Select by Color tool (not sure exactly how useful this
feature is as you can't really see where you click though) and (2) you
can drop a color and it will select this color also as though clicked by
the Select by Color tool (which looks quite useful!).
These features use the option values as set in the Select by Color tool.

Unfortunately both these features were broken when a non-zero threshold
was set because it expects a [0-1] range whereas threshold is [0-255].
Fix the parameters in gimp_channel_select_by_color() call.
2020-08-17 13:32:36 +02:00
Jehan c5f9b8e190 Issue #5530: do not fail font loading on broken user/GIMP fonts.conf.
Additionally to loading the default fontconfig configuration file, GIMP
also looks up /etc/gimp/<version>/fonts.conf and
$XDG_CONFIG_HOME/GIMP/<version>/fonts.conf (or equivalent in other
OSes). If these don't exist (which is the most common case), this is not
considered a bug. Fontconfig had a regression bug of
FcConfigParseAndLoad() in 2.13.92, which was fixed in a later commit:
fcada52291
As a consequence of this bug, font loading failed in Windows when these
non-mandatory files were absent.

The current commit, originally proposed by Jacob Boerema (@Wormnest) and
slightly reviewed works around the issue, because anyway there is never
any reason why failing to load these files should break font loading as
a general rule. Even if these files exist and are broken (wrong syntax
or whatnot), we should just output some warning on stderr and continue
loading without these additional confs.
With fontconfig 2.13.92, warnings will be also outputted (wrongly), but
at least it won't block loading anymore.

Also let's unref() the `config` object even when the whole font loading
succeeds. Man of FcConfigSetCurrent() clearly says that the reference
count of config is incremented since 2.12.0 (our current minimum
fontconfig is 2.12.4) so let's not leak one reference.
2020-08-16 18:06:09 +02:00
Ell 10d3ae2894 app: during splash-screen lookup, don't leak GFileEnumerator 2020-08-11 21:52:38 +03:00
Felix Yan fe085200c3 Correct typos in layers-commands.c 2020-08-08 10:41:20 +00:00
Jehan c73ac8fdf4 app: action "drawable-visible" now multi-layer aware. 2020-08-03 19:51:18 +02:00
Øyvind Kolås ec746901c3 build, app: depend on GEGL 0.4.26 2020-08-02 22:34:15 +02:00
Liam Quin be0e63aa1c Issue #4328: Distorted path of an open/imported circle from an svg file.
Undoing the apparent mistake (revert 27e78849a2) and changing the 2nd
occurrence instead.
2020-08-02 22:08:34 +02:00
Ell 9e0fdc8e2c app: allow recording GLIB log messages in performance logs
Add a new "Messages" boolean parameter to performance logs, which,
when set, records GLIB log messages in the performance log as
markers, with an accompanying sample capturing their backtrace.
This option is enabled by default.
2020-08-02 11:02:00 +03:00
Ell a143bfdf1d app: add gimp_log_{set,remove}_handler()
... which set/remove a GLIB log handler for all domains used by
GIMP.

Use the new functions in errors.c, instead of using
g_log_set_handler() directly.
2020-08-02 11:01:59 +03:00
Jehan 892fbafdf8 app: some more gimp_image_get_active_drawable() removed.
No logics changed. These are places where we expect single layer
selected.
2020-08-02 01:10:13 +02:00
Jehan 9b55f82579 app: drawables translation with arrow keys multi-layer aware.
We can now move multiple layers selected, together with the arrow keys.
2020-08-01 22:39:21 +02:00
Jehan 8b55346500 app: Color Select tool multi-layer aware.
Similar logics as Fuzzy Select (see my previous commit), which is that
if multiple layers are selected (and sample merged unchecked), it
selects as though through a composited image containing only the
selected layers.
2020-08-01 20:37:48 +02:00
Jehan 6093399d7b app: Fuzzy Select tool multi-layer aware.
When several layers are selected, and using the Fuzzy select tool
without sample merged (with sample merged, nothing changes, it just uses
the whole image), the selection will be based off a composited render of
the image with only selected layers.

This is equivalent to only making selected layers visible, running fuzzy
select with sample merged, then making other layers visible again.
2020-08-01 19:56:07 +02:00
Jehan 67b757f55a app: drop a color or a buffer multi-layer aware.
When dropping a color, we fill all the selected layers with this color.

When dropping a buffer, multi-layer is same as no layers selected (i.e.
we paste once as a new layer, not multiple times).
2020-08-01 19:14:21 +02:00
Jehan 1fa951127e app: more code in paint and brightness-contrast tool to port.
These 2 tools only work on single drawable at once. Yet slowly getting
rid of all usage of gimp_image_get_active_drawable().
2020-08-01 18:25:45 +02:00
Jehan ac0287e2f3 app: window title stays single layer for now.
Logics stay the same except I replace gimp_image_get_active_drawable()
by gimp_image_get_selected_drawables() to show I looked at this code.
Basically it doesn't look like we can really handle multiple layer
selected here, unless we want overly-long window titles.
2020-08-01 18:25:45 +02:00
Jehan 5357628df2 app, pdb: fix pdb and generated code.
Oups! The meson build failing to properly generate code is annoying!
2020-08-01 16:36:27 +02:00
Jehan 2ba6ac6286 app: selection stroke and "Stroke Path" now multi-layer aware.
This includes "select-stroke*" actions and "Stroke Path" feature of the
Vector tool.
2020-08-01 14:02:24 +02:00
Jehan 6b829c7008 app: Selection fill and "Fill Path" now multi-layer aware.
This includes the actions "select-fill*" as well as the "Fill Path"
feature in the Vector tool which were using common code.
2020-08-01 13:12:21 +02:00
Jehan 5d14a7a595 app: some fixes/improvements.
Forgot to free a list.
Also getting rid of a gimp_image_get_active_drawable() in edit_paste(),
with logics staying the same.
2020-08-01 12:04:04 +02:00
Jehan 5eec3e3457 app: get rid of last remnants of single-layer logics in edit-actions.
edit-cut and edit-named-* implementations were already multi-layer
aware. Making them sensitive appropriately was the only missing part.
2020-07-31 21:06:10 +02:00
Ell 552991b2d2 app: return visible widgets from a few more gimp_prop() functions
... in particular, this fixes the Rotate Colors prop-gui.
2020-07-31 20:47:05 +03:00
Jehan ae0f595a19 app: edit-fill-fg|bg|pattern multi-layer aware. 2020-07-31 17:52:53 +02:00
Jehan 117495323f app: fix layer double click (Layer Attributes dialog).
This got *again* broken because of some obviously impossible code path
(a same variable tested against 2 different values!). Anyway I tested
again and it seems that all possible interactions in the item tree views
are now correctly working though the whole button press code is a very
complicated mess of possible variations and events.
2020-07-31 17:42:39 +02:00
Jehan 696fb34cc5 app: layers-mask-edit only works with a single layer selected. 2020-07-31 17:42:39 +02:00
Jehan 0f1f8b7b45 app: layers-resize and layers-scale work on one layer at once.
Making these actions multi-layer aware here means checking only exactly
1 layer is selected as these actions have GUI which shows dimensions and
preview (for the layer dimension action, i.e. layers-resize).
2020-07-30 21:26:13 +02:00
Jehan bf7d555759 app: edit-clear multi-layers aware. 2020-07-30 21:18:54 +02:00
Jehan 62eedd41b4 app: layers-alpha-add|remove multi-layer aware. 2020-07-30 21:03:03 +02:00
Jehan 4b3348dffe app: layers-crop-to-selection and layers-crop-to-content multi-layers…
… aware.
2020-07-30 18:36:18 +02:00
Ell 9b29d17895 app: improve layout of performance-log file-selection dialog parameters 2020-07-30 18:15:32 +03:00
Jehan 802ba92ca5 app: do not allocate a GFile when crashing.
When backup-ing images upon crashing, reuse a GFile allocated at
startup, and simply rename the file to handle multiple files to save.
2020-07-30 16:00:38 +02:00
Jehan 949d7eee3b app: fix backup creation on crash.
The call to "gimp-xcf-save" was not updated to the new API using a
drawable array and a GFile.
Also for the drawable array, do not actually create it as anyway this is
a dummy argument (so far XCF saving does not even look at this argument
and just re-check the selected drawables).
2020-07-30 14:17:02 +02:00
Jehan d11e59fc42 app: allow a number of drawables to 0 for "gimp-xcf-save".
This parameter is not even used because we check again the selected
drawables during the save code. Allowing to set to 0 is simpler, and
also it will allow to not have to allocate an object array for layers
when we want to avoid memory management (during crash handling).
2020-07-30 14:15:52 +02:00
Jehan 9069919931 app: output errors to stderr when gimp_procedure_execute() fails with…
… argument validation.
I had a case where argument validation was failing on range and no error
was propagated (during a crash handling). Let's not leave these errors
totally silent as it makes such usually easy issues harder to debug. In
the specific case of no GError passed, just print the error to stderr.
2020-07-30 14:10:36 +02:00
Ell d11cbbbbc9 app: in GimpDashboard, fix progressive-performance-log env-var 2020-07-30 01:14:37 +03:00
Ell 146c234350 app: add progressive performance logs
Add an option to record progressive performance logs.  Progressive
logs contain complete information after each recorded sample, by
writing partial address maps at each sample, containing all new
addresses introduced by the sample.  Furthermore, when recording a
progressive log, the output stream is flushed after each sample.

This allows recording complete logs even in cases where they can't
be properly terminated, such as when GIMP crashes or freezes in the
middle of the log.

Progressive logs are disabled by default, since they potentially
increase the sampling cost.  They can be enabled through a toggle
in the log file-dialog, or through the
GIMP_PERFORMANCE_LOG_PROGRESSIVE environment varaible.
2020-07-30 01:03:38 +03:00
Ell 126002c5c9 app: allow controlling performance-log parameters through the UI
When recording a performance log, allow setting the log parametrs
through the file dialog.  Currently, this includes the sample
frequency, and the option to include backtraces.

These options are still controllable through the
GIMP_PERFORMANCE_LOG_SAMPLE_FREQUENCY and
GIMP_PERFORMANCE_LOG_BACKTRACE environment variables.  When set,
the variables override the values entered through the UI.
2020-07-30 01:03:37 +03:00
Ell 95b69dd77b app: in GimpBacktrace Windows backend, return NULL backtrace if not initialized
In the Windows implementation of gimp_backtrace_new(), return NULL
if the backend is not fully initialized.
2020-07-30 01:03:37 +03:00
Jehan 281f17e53c app: GimpToolRectangle multi-layer aware.
This fixes default constraint values when multiple layers are selected.
In particular fixed aspect ratio defaults in Crop or Rectangle Select
tools, in layer mode, when several layers are selected, the default
aspect ratio is the layer's ratio if all layers have the same
dimensions, otherwise it's the image dimension ratio.

Also fixes a bug when trying to create the tool rectangle while multiple
layers are selected (the rectangle was always of size 0 at point 0).

Finally fixes the auto-shrink feature with multiple layers selected. The
rectangle will now auto-shrink to the smallest rectangle which
encompasses the contents of all selected drawables inside the existing
rectangle.
2020-07-29 19:26:05 +02:00
Ell 3a462a5e63 Issue #5472 - CRITICAL while using Move tool with arrow keys
In gimp_edit_selection_tool_translate(), perform the active-item
checks even when the effective translation offset is 0, and only
bail afterwards.  This avoids erroneously calling
gimp_tool_message_literal() with a NULL message in this case.
2020-07-29 20:08:19 +03:00
Ell 0829dba97f Issue #4536 - Seg fault when trying to open image on Google Drive (Gnome 3.34.3)
In file_open_image(), mount non-native files *before* looking up a
file-proc.  Previously, we'd only mount the file after the initial
lookup, and fail to perform a second lookup if the mount succeeded,
leaving us with a NULL file-proc and a subsequent segfault.

Additionally, simplify the rest of the remote-file code-path.
2020-07-28 11:01:23 +03:00
Jehan 73b960aefb app: fix a build warning.
Fixes:
> warning: passing argument 1 of ‘GIMP_CONFIG’ discards ‘const’
> qualifier from pointer target type.
2020-07-20 15:41:22 +02:00
Jehan d3ef6cfb18 app: show playground if any of the experimental feature is enabled.
Basically if you enabled OpenCL or any of the experimental tools, it
will show the Playground in Preferences. Otherwise, say you enabled some
experimental feature months ago (e.g. with the CLI option) and you now
experience crashes or whatnot. And you forgot how to change it, and only
remembered that there was something in Preferences. It would make you
crazy to not find the tab again to disable the option.

This is even more important as OpenCL is moving from a normal option to
a playground option. So you might not even have ever seen the Playground
tab in Preferences and would not know how to disable OpenCL after you
enabled it originally in "System Resources" tab.

So now Playground is visible with any of these 3 conditions:
* If you use an unstable version.
* If you run GIMP with --show-playground option.
* If you previously enabled one of the playground options.
2020-07-17 13:28:43 +02:00
Jehan 0f806d0e9c app: move OpenCL settings into the Playground.
After discussions on IRC, it was decided that our current level of
support of OpenCL was not good enough. As a normal settings, people just
see it as a normal acceleration checkbox, even despite the warning text
and emoticone saying the opposite (i.e. it may even slow things down in
some cases).
Basically this feature needs more love to be back into mainstream
Preferences.
2020-07-17 12:04:27 +02:00
Jehan bc5f6371e9 app: add contents of /.flatpak-info in the verbose info.
This file is available in a flatpak sandbox and will contain various
info such as the build commit, very useful info as we can have several
builds for a same version. For instance if we have exactly the right
commit, we can load exactly the same binary as a bug reporter very
easily, hence are able to get source correspondance without necessarily
asking reporters to install debug symbols (though it stays easier if
they can do it).

Other interesting info contained in this file are the exact runtime
used, the installed application or runtime extensions, the permissions
(people may override our flatpak permissions so it's useful to be able
to check when they did) and environment variables…
2020-07-16 12:12:37 +02:00
Jehan 74d0990456 app: fix Alpha to Selection for single selected layer.
By adding support for multiple selected layers, it seems I broke the
single selected layer case. Fixed now!
2020-07-06 23:15:12 +02:00