Commit graph

21138 commits

Author SHA1 Message Date
Oleksii Samorukov
9ae19eb8ec tests: implement gimp_test_utils_synthesize_key_event on OSX/QUARTZ 2018-11-23 23:06:12 +01:00
Ell
4b647c52e1 Issue #2553 - Can't Move Imported or Pasted Path
Initialize the X/Y tilt fields of improted/pasted path control
points to 0, instead of 0.5, which is the normal value for these
fields in paths.  This avoids calculating bogus distances when
trying to pick the path, causing picking to fail.

(cherry picked from commit 0a123a81a3)
2018-11-23 08:48:41 -05:00
Alex Samorukov
62c52742cd do not activate OSX menu if tests are running to prevent crash 2018-11-23 11:39:21 +01:00
Alex Samorukov
d650e9f81f add to fix test link on OSX 2018-11-23 10:45:39 +01:00
Alex Samorukov
465b4b10fb Enable hires retina support for the GTK2/OSX build 2018-11-22 13:45:30 +00:00
Ell
0a39f362b5 libgimpbase, libgimp, app: pass misc. GEGL config to plug-ins
Pass the GEGL tile-cache size, swap path, and thread-count to plug-
ins as part of their config, and have libgimp set the plug-in's
GeglConfig accordingly upon initialization.
2018-11-19 17:09:59 -05:00
Michael Natterer
ab48f12fd6 Issue #2224 - Use the "Swap folder" setting for the GEGL cache
Move swap/cache and temporary files out the GIMP user config dir:

libgimpbase: add gimp_cache_directory() and gimp_temp_directory()
which return the new default values inside XDG_CACHE_HOME and the
system temp directory. Like all directories from gimpenv.[ch] the
values can be overridden by environment variables. Improve API docs
for all functions returning directories.

Add new config file substitutions ${gimp_cache_dir} and
${gimp_temp_dir}.

Document all the new stuff in the gimp and gimprc manpages.

app: default "swap-path" and "temp-path" to the new config file
substitutions. On startup and config changes, make sure that the swap
and temp directories actually exist.

In the preferences dialog, add reset buttons to all file path pages.

(cherry picked from commit a29f73bd9a)
2018-11-18 18:27:05 +01:00
Ell
6f61a7d431 configure.ac: require babl >= 0.1.60
(cherry picked from commit 3821ce4bcd)
2018-11-15 12:56:13 -05:00
Ell
5b93eee52a app: in scale tool, scale around center even when using numeric input
In the scale tool, when the "around center" option is toggled,
scale the item around its center not only through canvas
interaction, but also when entering width/height values through the
tool GUI.

(cherry picked from commit 786bfa5171)
2018-11-15 12:53:11 -05:00
ONO Yoshio
cd55cb3102 Issue #2489 - Gimp 2.10.8 layer menu text along path
Related #2064 - text along path not working with vertical text.

(cherry picked from commit a2da1cd596)
2018-11-13 12:56:25 +09:00
Ell
7ca3fe6576 Issue #2473 - Transforming a layer doesn't properly transform its mask
In gimp_drawable_transform_buffer_affine(), avoid modifying the
clipping mode when transforming layer masks, since this function is
used (among other things) to transform layer masks together with
their layer, in which case they should use the same clipping mode
as the layer.

This fixes a regression introduced by commit
2ae823ba2b, causing layer masks to be
transformed with a mismatched clipping mode during layer
transforms, leading to discrepencies between the transformed layer
and the transformed mask.

This commit merely reverts the necessary part of above commit,
fixing the regression, though note that this code is really up for
some serious refactoring: the logic for determining which clipping
mode to use when is spread all over the place.

(cherry picked from commit 45fc30caa7)
2018-11-11 02:28:25 -05:00
Ell
dd52d8d7a5 app: in performance logs, add new-lines between variable definitions
(cherry picked from commit c7f1730702)
2018-11-10 02:52:51 -05:00
Ell
fafeb7bf07 app: a few improvements to the GimpBacktrace Linux backend
Blacklist the "threaded-ml" thread, which seems to mask the
backtrace signal.

Improve signal-handler synchronozation, to avoid segfaulting when
giving up on waiting for all threads to handle the signal.
Furthermore, when one or more threads fail to handle the signal in
time, return a GimpBacktrace instance with backtraces for all the
other threads, and with empty backtraces for all the non-responding
threads, instead of returning NULL and leaking the allocated
instance.  Don't blacklist threads that failed to handle the signal
in time, and instead shorten the wait period for handling the
signal, and yield execution during waiting to lower the CPU usage.

(cherry picked from commit a29d040db5)
2018-11-07 14:26:40 -05:00
Ell
645e30e641 app: a few fixes to performance-log backtrace output
Fix delta-encoding of performance-log backtraces in certain cases,
and distinguish between empty call-stacks and removed threads.

(cherry picked from commit eec1e1f189)
2018-11-07 14:26:38 -05:00
Ell
ee3c6a9323 app: don't let image component mask affect channel colors
Connect GimpImage's gimp:mask-components node to the layers node
*before* connecting the channels node, so that the image's
component mask doesn't affect the channel colors, as is the case in
2.8.

(cherry picked from commit 56920dcdbf)
2018-11-04 13:24:05 -05:00
Ell
bc3847e851 app: avoid allocating empty tempbuf for drawable previews
In gimp_view_renderer_drawable_render(), make sure the preview size
is always at least 1x1.

Fixes commit 8009ea342a.

(cherry picked from commit 963322fdd4)
2018-11-03 04:30:23 -04:00
Ell
b8862acee9 app: include variable descriptions in performance logs
Include instrumentation-variable descriptions in the var-defs
section of performance logs, so that they can be displayed
alongside their names when viewing the log.

(cherry picked from commit 646208eff0)
2018-11-03 04:17:55 -04:00
Ell
5456226c99 app: simplify drawable preview rendering
Simplify gimp_view_renderer_drawable_render(), by consolidating
common code paths.  In particular, when rendering the preview as
part of an image, always crop the preview to the bounds of the
image, even when downscaling, to avoid unnecessarily downscaling/
convering cropped-out regions.  We previously only did this when
upscaling the preview by a factor of 2 or more; whatever the reason
for this used to be, it's no longer there.

(cherry picked from commit 8009ea342a)
2018-11-03 04:06:17 -04:00
Ell
4f27efc4a0 Issue #2436 - Crash after downsizing canvas
In gimp_view_renderer_drawable_render(), avoid overflow in preview-
area calculation.  This prevents erroneously setting 'scaling_up'
to FALSE while upscaling the drawable by a very large amount, which
can lead to the creation of a very large GimpTempBuf for the
preview, causing memory allocation to fail.

(cherry picked from commit 0cdbe91e5a)
2018-11-02 21:44:10 -04:00
Michael Natterer
a33a629bd9 Issue #2379 - Crash on saving
file_save(): make sure we always set an error on failure

file_save_dialog_save_image(): additionally, check that "error" exists
before dereferencing it.

(cherry picked from commit c55f2308e1)
2018-10-31 23:52:13 +01:00
Ell
13ee89d491 app: fix tests for new show-tabs option
In app/tests, add the show-tabs pref, added in commit
1ca2d74411, to the expected sessionrc
files.

(cherry picked from commit 4113aaad69)
2018-10-27 05:43:18 -04:00
Ell
8a5ee944f7 Issue #2405 - Rotation center shifts by half a pixel ...
... the second time you do a 180 degrees rotation

In gimp_transform_resize_adjust(), nudge the transformed layer
boundary by EPSILON toward the center, to avoid enlarging the layer
unnecessarily, as a result of numeric error amplified by rounding,
when the tranformed boundary should land on integer coordinates.
In particular, this avoids enlarging the layer when rotating by 180
degrees.

(cherry picked from commit c271992aa0)
2018-10-27 00:14:51 -04:00
Michael Natterer
c7dd4d8dd3 Issue #2235 - Color reset/swap keyboard shortcuts not discoverable...
...via hover tooltips

Use the GtkWidget::query_tooltip() signal on GimpFgBgEditor to emit an
own signal "tooltip" that has the hovered widget area as parameter.

Connect to GimpFgBgEditor::tooltip() in gimptoolbox-color-area.c and
set separate tooltips on the widget's areas, including the shortcuts
for "Swap colors" and "Default colors".

(cherry picked from commit ae9d84dd22)
2018-10-25 14:58:57 +02:00
Oleksii Samorukov
7dbb9fee3d Fix compilation on Mac 10.6 and 10.7 (#2112) 2018-10-24 10:37:36 +02:00
Ell
f6df603471 app: use "step" blending function in "FG to BG (Hardedge)" gradient
Use a single segment with a "step" blending function, added in the
previous commit, instead of two separate segments, for the "FG to
BG (Hardedge)" internal gradient.  This makes it simpler to change
its endpoint colors by modifying the gradient, instead of changing
the FG/BG colors.

(cherry picked from commit 84066ca26a)
2018-10-23 12:22:57 -04:00
Ell
0462734ffb Issue #2303 - Please add Constant type of gradient interpolation ...
... to make multi-color hard-edge gradient fills possible

Add a new "step" gradient-segment blending function, which is 0
before the midpoint, and 1 at, and after, the midpoint.  This
creates a hard-edge transition between the two adjacent color stops
at the midpoint.  Creating such a transition was already possible,
but required duplicating the same color at the opposing ends of two
adjacent stops, which is cumbersome.

(cherry picked from commit 68bf99e806)
2018-10-23 12:22:57 -04:00
Elle Stone
59682a1cb1 Issue #2345 - Add xyY to color sample readouts
Add xyY color space to the color spaces for sampling colors.

Also add code to xcf-load.c that makes sure the sample point loading
code handles unknown future GimpColorPickMode values (fall back to
PIXEL pick mode).

(cherry picked from commit 298cc57042)
2018-10-23 18:15:28 +02:00
Øyvind Kolås
20a1a31fc4 configure/app: depend on GEGL 0.4.12
(cherry picked from commit a39b4abfbc)
2018-10-23 14:39:43 +02:00
Sergio Jiménez Herena
360aee10d8 app: Add option in the windows menu to hide the image tab bar. 2018-10-22 20:41:29 +02:00
Michael Natterer
6564f4c713 Issue #2386 - Pattern fill with selection is shifted in 2.10
Add pattern offset parameters to gimp_fill_options_create_buffer() and
pass the selection's top-left corner so that pattern fills on the same
drawable are aligned.

(cherry picked from commit 38dcb73bfc)
2018-10-22 16:41:50 +02:00
Michael Natterer
7dc96c8f34 Issue #2332 - Marching ants from one image displayed on every tab
Seems we were drawing marching ants for hidden tabs ever since the
introduction of SWM, which is both a horrible waste of CPU time, and
also makes all selections visible on all displays on GTK+ 3.x.

Implement GtkWidget::unmap() in GimpDisplayShell and stop the ants
when the shell is unmapped.

(cherry picked from commit 1d43e2ff37)
2018-10-22 00:06:18 +02:00
Liam Quin
8da246b2a3 Issue #1371 - Add title printf-like expando for export-clean and export-dirty
Add %Ex to print 'x' as export-clean indicator and %Nx for 'x' as
export-dirty indicator.

(cherry picked from commit 2e4b3ae05a)
2018-10-20 11:25:44 +02:00
Jehan
6b1ff0dd96 Issue #1924: Tool options mysteriously lock up due to DND/quartz issues.
On macOS, the "drag-end" signal does not seem to be emitted in some
cases, which leaves dockables in an unsensitive state. Rather than
trying to fix GTK+2 which is half-maintained nowadays anyway, let's drop
the unsensitivity. As a comment notes, this was anyway only a visual
cue. Dragging dockables in GIMP 2.10 already shows a lot of other visual
cues, so this is redundant.
In case of drop failure, we also had to cleanup the icon widget and
detach the dockable. This can be handled by the "drag-failed" (which
hopefully work better on macOS).

As an additional improvement, I raise the newly created dockable window,
since this is the most likely behavior when you just detached a dock
(and I realize it usually appeared behind other GIMP windows, at least
on GNOME).

Note: this is a gimp-2-10 only fix as master relies on GtkNotebook DnD
code which (hopefully, as I haven't tested) doesn't have this issue. The
detached window behind other windows issue doesn't exist on master, at
the very least.
2018-10-19 21:46:54 +02:00
Øyvind Kolås
02936d9303 configure/app: depend on GEGL-0.4.10 2018-10-18 18:32:24 +02:00
Øyvind Kolås
793ae3f771 configure/app: depend on babl-0.1.58 2018-10-18 18:32:24 +02:00
Ell
60c49c5682 Issue #2237 - export as, select file type (by extention) list problem
In gimp_file_proc_view_get_proc(), when there is no selected
procedure (which can happen, in particular, when searching the
list), return the "automatic" procedure and its corresponding name/
filter, if one exists, instead of bailing.

Additionally, in GimpFileDialog, use a match-all filter when
gimp_file_proc_view_get_proc() returns no filter, avoiding
CRITICALs/segfault.

(cherry picked from commit e26a220a6f)
2018-10-16 07:50:02 -04:00
Michael Natterer
70611cb06a app: didn't push my latest version of the previous fix 2018-10-13 17:35:53 +02:00
Michael Natterer
130443a059 Issue #2210 - GIMP crashes on startup if usb mouse is present
In GimpDeviceInfo, make sure that the info->axes and info->keys arrays
always have info->n_axes and info->n_keys members. Also sync axes and
keys between GdkDevice and GimpDeviceInfo more often, and some
cleanup.

(cherry picked from commit 7adb6c26e5)
2018-10-12 20:18:23 +02:00
Ell
b1cba6b142 app: always use libunwind for symbol names in GimpBacktrace Linux backend
In the GimpBacktrace Linux backend, always use libunwind, when
available, to find symbol names, even if dladdr() or libbacktrace
had already found one.  libunwind provides more descriptive names
in certain cases, and, in particular, full symbol names for C++
lambdas.

Note that, in some cases, this can result in a discrepancy between
the reported symbol name, and the corresponding source location.

(cherry picked from commit 72fc01742b)
2018-10-11 03:35:30 -04:00
Ell
397bbb29a9 app: fix gimp_wait() deadlock
In the GUI implementation of gimp_wait(), explicitly finish the
input-pipe async operation after the busy-dialog plug-in
terminates, to avoid the async callback function from being
repeatedly called, stalling the main thread.  Previously, this code
relied on gimp-parallel implicitly aborting the async operation,
but this is no longer the case since commit
4969d75785.

(cherry picked from commit 85b16b9eaa)
2018-10-11 02:26:08 -04:00
Ell
d0fdff7117 app: in GimpBacktrace Windows backend, avoid bogus symbol addresses
In the GimpBacktrace Windows backend, avoid reporting meaningless
symbol addresses when failing to retrieve meaningful ones.
Unfortunately, it seems that we never get symbol addresses for
symbols that have debug information, which negatively affects the
log viewer's call graph.  We're going to have to work around this.

(cherry picked from commit 52772cf3ff)
2018-10-10 10:02:09 -04:00
Ell
ca8bbd2e3d app: in GimpBacktrace Windows backend, set main-thread name
When initializing the GimpBacktrace Windows backend, set the name
of the current thread (which is assumed to be the main thread) to
the program's name, to match its name on Linux.  We normally rely
on the SET_THREAD_NAME exception to set thread names on Windows,
which isn't raised for the main thread.

(cherry picked from commit 52908f397f)
2018-10-10 10:02:09 -04:00
Ell
93d1219507 app: improve description comment of GimpAsync
(cherry picked from commit ca6e4eb460)
2018-10-10 01:03:46 -04:00
Ell
9f86b58a38 app: allow progressive execution of parallel async operations
In the gimp_parallel_run_async() family of functions, allow the
async callback to return without completing the async operation, in
which case the callback will be called again, until the operation
is either completed, or canceled, in which case it is aborted
(previously, returning from the callback without completing the
operation would cause it to be aborted.)  It is guaranteed that all
operations of the same priority will get a chance to run, even if
some of them contuinuosly return without completing.

This allows potentially time-consuming operations to yield
execution in favor of other same-priority operations, and, in
particular, of higher-priority operations, to avoid priority
inversion.  Essentially, this allows a simple form of cooperative
multitasking among async operations.

(cherry picked from commit 4969d75785)
2018-10-09 12:49:42 -04:00
Ell
e0e825580b Issue #2308 - Strange behavior when switching active layer during transform
Replace GimpTransformTool's 'drawable' field with an 'item' field,
and have GimpTransformGridTool set it to the active item, to which
the transformation is applied, during its initialization.  In
gimp_transform_tool_get_active_item(), return the value of the
transform tool's 'item' field, if not NULL, instead of the image's
active item.  This makes sure we apply that transform-grid tools
apply the transformation for the item for which they were
activated, even if the image's active item has changed.

(cherry picked from commit 3eaae58595)
2018-10-04 21:51:38 -04:00
Ell
e8fef315c5 app: in gimp-parallel, cancel ongoing async operations upon exit
When shutting-down gimp-parallel, cancel and/or abort any ongoing
and queued async operations, instead of finishing them (async
operations that already started executing will be canceled, but
execution will be blocked until they're finished.)  This is
especially important since we're shutting down gimp-parallel before
the destruction of data factories.  This commit causes any ongoing
async operations of the factories to be canceled on shutdown,
rather than waiting for them to finish normally.

(cherry picked from commit e46fdc714e)
2018-10-01 05:24:59 -04:00
Ell
7058aa259b app: add gimp_data_factory_data_cancel()
Add a new GimpData::data_cancel() virtual function, and a
corresponding gimp_data_factory_data_cancel() function.  This
function should cancel any ongoing async operations related to the
factory (i.e., included in its async set), and wait for the
operations to finish.  Provide a default implementation that simply
cancels and waits on the factory's async set.

Use this function to cancel any ongoing operations during factory
destruction, and in gimp_data_factory_data_free().

Override this function in GimpFontFactory, for which we can't
really cancel font loading, and simply cancel and clear the
factory's async set without waiting for loading to finish, making
sure that nothing happens (and, in particular, that the factory
isn't being accessed, since it might be already dead) when loading
does finish.

(cherry picked from commit 6bc0b3b8ad)
2018-10-01 05:24:59 -04:00
Ell
937f5ea0f0 app: don't depend on GimpData sort order for identifying internal data
In gimp_data_factory_data_foreach(), don't rely on internal
GimpData objects being sorted first (while this is currently true
for all types of GimpData, they may override the sort order.)

(cherry picked from commit 50bab438ce)
2018-10-01 05:24:59 -04:00
Ell
fc77bf31bc app: avoid double-initialization of operation tools when changing layers
When re-activating an operation tool by clicking on a different
drawable while the tool is active, we re-call the corresponding
procedure to re-activate the tool, which implictly initializes it.
Avoid initializaing it explicitly in addition to that, since this
leads to the creation of a new config object by the filter tool,
while the GUI still refers to the old, now-dead, config object,
causing CRITICALs or segfaults when changing any parameter.

(cherry picked from commit a21667821c)
2018-09-29 14:31:52 -04:00
Ell
9b3c2e9b4e app: don't commit trivial warp transform
In the warp tool, don't commit a trivial (empty) transform.  This
is especially important now that exiting the tool through undo
causes it to get comitted (... with a trivial transform).

(cherry picked from commit d12dd3fb35)
2018-09-29 12:38:50 -04:00