Commit Graph

39996 Commits

Author SHA1 Message Date
Jehan 3dff485d57 devel-docs: update the debugging-tips file. 2018-02-12 18:22:15 +01:00
Jehan 67d0848b9b NEWS: keep up-to-date. 2018-02-12 18:22:15 +01:00
Michael Natterer 6f324b867a Bug 783755 - Smudge should blend the smudged colors using linear RGB
This reverts commit 94c6bb4603, because
unlike what the bug title suggests, Smudge apparently *should* use
perceptual RGB, so now everything works as before.
2018-02-12 17:27:05 +01:00
Michael Natterer 3bea6dce03 app: don't choke when being asked for GIMP_UNIT_PERCENT's factor or digits
Instead, return bogus default values just like libgimp/gimpunitcache.c
does.
2018-02-12 16:37:49 +01:00
Michael Natterer a86eee6ae9 Bug 793276 - Make jitter scale run to 5 instead of 50
Limit the scale's range to [0..5] while keeping it possible to set
jutter as large as the old maximum of 50.
2018-02-12 12:51:23 +01:00
Michael Natterer fd37737fe4 Bug 400448 - ruler subdivision is wrong for inches
This commit changes nothing, but contains disabled proof-of-concept
code to use different ruler subdivisions depending on the ruler's
unit.
2018-02-12 12:20:32 +01:00
Ell ac3392477b app: don't disable undo for unattached items in gimp_item_{start,end}_move()
Setting push_undo to FALSE in these functions is premature -- let
this stuff be handled at the actual point where the undo is
pushed, which might correspond to a different item than the one for
which gimp_item_{start,end}_move() was called.

In particular, when removing a layer from the image,
gimp_item_end_move() is called (with push_undo == TRUE) on the
layer after it's been removed, but we still need the appropriate
undo enrties to be pushed for the affected group layers.
2018-02-12 05:18:26 -05:00
Ell 68e37f28c2 Bug 793373 - Crash when ctrl-alt-clicking, dragging then releasing...
... a selection.

The crash was the result of an unmatched gimp_item_end_move() call,
which is an error.  Add the matching gimp_item_start_move() call
when starting to drag a selection in GimpEditSelectionTool.  Revert
last commit, so that unmatched gimp_layer_end_move() calls are not
silently ignored, and add a check instead.
2018-02-12 05:18:26 -05:00
Jehan d9987ea7f1 Bug 793373 - Crash when ctrl-alt-clicking, dragging then releasing...
... a selection.
The regression appeared with commit 10c125c627.
gimp_layer_end_move() may sometimes run even while a symmetric
gimp_layer_start_move() had not run. For instance this happens when
releasing the mouse button after dragging a ctrl-alt-click created
floating layer.
Therefore let's check that layer->move_stack is not NULL before
dereferencing it.
2018-02-12 08:29:32 +01:00
Jehan b0cd4412e0 app: make backtrace processed in the thread where error happens.
Slight back step from commit 34fe992f44. I don't keep track anymore of
the number of errors inside GimpCriticalDialog. The problem is that GTK+
calls must happen in the main thread, and errors in another thread will
be delayed into the main thread through gdk_threads_add_idle_full().
This makes any backtrace generated as a consequence of a threaded error
useless (in particular any error happening in GEGL since we always
process these as multi-threaded, whether they are or not).
Instead I now keep track of the number of errors in gui-message.c, which
still allows to reset the counters when the unique debug dialog is
closed. Therefore I can now generate backtraces conditionally to the
error counters inside the problematic thread (and right when the error
happened), without any GTK+ call.
This finally makes GEGL backtraces useful in the debug dialog! :-)
2018-02-12 05:28:12 +01:00
Jehan 5d200c2c4b app: handle GEGL WARNING and CRITICAL with the new debugging GUI.
It is not always very useful since GEGL makes heavy use of threads, and
therefore a backtrace of the main thread for an error on another thread
is mostly useless. But that's a start. I am still improving.
I was holding on non-GIMP messages until now because we don't have as
much control on them, and for some errors, they may be huge. For
instance, the bug told by Massimo in bug 792787, comment 22, generates
hundreds of thousands (and even millions for big enough polygons) of
errors. But I can now allow these to pass since previous commit when I
now only display a few errors, and then redirect remaining errors to
stderr.
Also get rid of gimp_third_party_message_log_func() and instead make
gimp_message_log_func() handle correcly non-GIMP messages by keeping
their domain.
2018-02-12 03:57:16 +01:00
Jehan 34fe992f44 app: keep track of number of errors and traces in GimpCriticalDialog.
We don't want an infinite number of traces because it takes some time to
get. Until now I was keeping track of traces in app/errors.c, but that
was very sucky because then I was limiting traces per session. Instead
save them as a variable of a GimpCriticalDialog instance. Therefore only
generate the traces for WARNING/CRITICAL at the last second, when
calling the dialog.
When too many traces are displayed, just fallback to just add error
messages only. But then even errors without traces can be time-consuming
(if you have dozens of thousands of errors in a few seconds, as I had
the other day, updating the dialog for all of them would just freeze the
whole application for a long time).
So also keep track of errors as well and as last fallback, just send the
remaining errors to the stderr.
2018-02-12 02:09:15 +01:00
Jehan 4e293a8696 libgimpbase: allow NULL prog_name in gimp_print_stack_trace().
The only debugger command which uses this value currently is gdb. And
even there, it doesn't look mandatory. The alternative call using "-p"
option does not require the program name. The manual doesn't say if
calling with the program name has any advantage (but I don't see why it
would, the PID is enough to find a process). Just in case, I leave the
prog_name parameter (because it's easier to make a parameter useless
than changing a libgimp* API) but simply allows setting it to NULL.
2018-02-12 01:50:19 +01:00
Jehan 040533249c libgimpbase: use backtrace_symbols_fd() rather than...
... backtrace_symbols() when possible.
When we allocate a new string, anyway we have memory allocation. But
when we just print to a file descriptor, this version of the API is
guaranteed without any memory allocation and therefore should always
work. This is important since allocations may fail in particular after
memory errors.
2018-02-11 23:31:26 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Piotr Drąg 6db5ba61b2 Update Polish translation 2018-02-11 16:57:32 +01:00
Dimitris Spingos (Δημήτρης Σπίγγος) ba4c544c29 Update Greek translation 2018-02-11 17:54:33 +02:00
Michael Natterer 4be9f84ed5 app: pass the GdkWindow to gimp_spin_scale_update,clear_target()
Another small thing to make maintaining gtk3-port easier.
2018-02-11 15:45:51 +01:00
Ell 7bfab7150c Bug 792991 - Crash when undoing a paste while naming pasted layer
When removing a GimpContainerTreeStore item, make sure that editing
of corresponding tree-view rows is canceled first, by emitting a
"row-changed" signal.  Otherwise, we can run into trouble when
removing an item that is being edited.
2018-02-11 08:54:51 -05:00
Jehan bd9c569e21 libgimpbase: forgot (again!) to add the new debug functions in def file.
This should fix the build!
2018-02-11 04:33:31 +01:00
Jehan ffb94967fa devel-docs: add some generic statistics on all changed files. 2018-02-11 04:28:25 +01:00
Jehan 7aa7e3ca23 app: check that GimpTool's display is present before actual commit.
A tool commit can be triggered in various cases, and the tool manager
relies on gimp_tool_has_display() to decide whether to run a tool
action. This function does much more than just checking GimpTool's
display. It also checks status_displays, and for a transform tool in
particular, it checks GimpDrawTool's display. This may be right for
other tools (I have no idea), so I can't just change this function.
Anyway we have to assume it is not a programming error if a transform
tool gets a COMMIT action while display is NULL (i.e. tool is halted).
When this happens, let's simply ignore.

This fixes the edge case raised by Ell, in comment 2 of bug 793150: when
an image has no layer, transform tools can't work and display is NULL.
But it still outputs status messages and therefore status_displays is
not empty. So the tool manager will still run a COMMIT action, which is
not an error. We only have to discard such COMMIT silently.
2018-02-11 02:08:42 +01:00
Jehan fa53be1a57 app: simply pass through from the COMMIT to HALT action.
Improving previous commit. Rather than calling:
> GIMP_TOOL_GET_CLASS (tool)->control (tool,
                                       GIMP_TOOL_ACTION_HALT,
                                       display)
> gimp_tool_clear_status()
... in the COMMIT action, which is basically what the HALT action does,
simply pass through from one case to the other. It also adds the call to
gimp_tool_control_halt() which is most likely right anyway since we are
halting the tool. This also makes the code consistent and any future
changes to HALT case will be directly enabled after COMMIT.
2018-02-11 02:02:15 +01:00
Jehan 4ae8f5a7b4 Bug 793150 - gimp_display_get_image: assertion...
... 'GIMP_IS_DISPLAY (display)' failed.
This may happen when committing first a transform tool, then switching
to another tool. In this case, the tool manager will attempt to commit
again because gimp_tool_has_display() returns TRUE since status displays
were not cleared. Unfortunately transform tools don't handle very well
trying to commit when it was already done (hence both GimpTool and
GimpDrawTool displays are NULL).
The proposed solution is to clear the statuses after committing.
2018-02-11 01:23:08 +01:00
Jehan a5bc153343 app: fix a second switch with missing paste types.
Completing previous commit, the next switch was not raising any error,
but I believe the new "in place" variants of paste as floating selection
also have to be processed for mask removal.
2018-02-10 23:57:45 +01:00
Jehan da3baa1cab Bug 793360 - Error when copy-pasting in place a full layer.
In a switch(), not all paste type were listed (the new "In Place"
versions in particular were missing), therefore we were hitting a
g_return_val_if_reached() error.
2018-02-10 23:46:58 +01:00
Ell d0ae244fe8 app: invalidate channel boundary upon buffer "changed" signal
Have GimpChannel connect to the drawable buffer's "changed" signal,
so that we can invalidate the channel's boundary whenever the
buffer contents change.  Currently, the calls to
gimp_drawable_invalidate_boundary() dispersed throughout the code
are not enough.

Moreover, invalidate both the boundary and the bounds in
gimp_channel_invalidate_boundary(), since both are necessary when
the buffer changes.
2018-02-10 05:36:40 -05:00
Ell 10c125c627 app: keep ancestor set in gimp_layer_start_move(), for use in end_move()
In gimp_layer_start_move(), keep the set of ancestors for which for
which we suspended mask cropping, so that we can resume mask
cropping for the same groups in gimp_layer_end_move().  This is
necessary, since gimp_image_remove_layer() calls gimp_item
start_move() before removing the layer from the layer tree, and
gimp_item_end_move() after removing the layer from the layer tree,
at which point the layer has no ancestors.
2018-02-10 05:36:40 -05:00
Øyvind Kolås c39d551f39 app: clean splash 2018-02-10 02:08:10 +01:00
Michael Natterer 0613bc948f app: remove one level of indentation from gimp_meter_expose_event()
Makes maintaining the gtk3-port branch easier.
2018-02-09 18:56:00 +01:00
Alan Mortensen e5452adedd Updated Danish translation of gimp-python 2018-02-09 17:39:52 +01:00
Alan Mortensen 3eb09f61e6 Updated Danish translation of gimp-windows-installer 2018-02-09 17:39:20 +01:00
Ell 26e90bfd1f build: add Indonesian translation to the Windows installer 2018-02-09 09:49:53 -05:00
Jehan e53d0c742c libgimp: replace gimp_on_error_query() and g_on_error_stack_trace().
Our own implementation is much better.
I don't make it into a GUI yet, but at least the CLI option will use the
new implementation in plug-ins as well, which will be quite useful.
2018-02-09 02:25:58 +01:00
Jehan 276f07521c app, libgimpbase: move the debug functions to libgimpbase.
This will allow to use them on plug-ins later on.
2018-02-09 01:57:03 +01:00
Jehan 43d7a3c77d app: the crashlog file path is wrong on non-Win32.
Using g_get_user_data_dir() is maybe right on Win32 (for this roaming
vs. local directory logics), but not on Unix-like systems, where we end
up trying to write in the data directory (usually not even supposed to
be writable by applications).
Also while at it, I replace g_get_prgname() by PACKAGE_NAME. It turns
out that this function returns NULL, maybe because of the init order.

Actually ideally, this file should rather go under:
$XDG_CACHE_HOME/GIMP/<version>/
But last we discussed this, it was decided that files should not spread
too much (though I still disagree!).
2018-02-08 23:05:26 +01:00
Jehan 7348f17828 app: debug preference always sensitive if backtrace() available.
If the backtrace() API is available, it should always be possible to
debug. Still, display a message whether or not gdb or lldb are present,
as preferred debugging solutions (much better traces).
2018-02-08 22:45:49 +01:00
Jehan d5a67cb162 app: make debugging preference finer-grained than a boolean.
Replacing the boolean property "generate-backtrace" by an enum
"debug-policy". This property allows one to choose whether to debug
WARNING, CRITICAL and FATAL (crashes), or CRITICAL and FATAL only, or
only FATAL, or finally nothing.
By default, a stable release will debug CRITICAL and crashes, and
unstable builds will start debugging at WARNINGs.
The reason for the settings is that if you stumble upon a reccurring bug
in your workflow (and this bug is not major enough for data corruption,
and "you can live with it"), you still have to wait for a new release.
At some point, you may want to disable getting a debug dialog, at least
temporarily. Oppositely, even when using a stable build, you may want to
obtain debug info for lesser issues, even WARNINGs, if you wish to help
the GIMP project.
It can be argued though whether the value GIMP_DEBUG_POLICY_NEVER is
really useful. There is nothing to gain from refusing debugging info
when the software crashed anyway. But I could still imagine that someone
is not interested in helping at all. It's sad but not like we are going
to force people to report. Let's just allow disabling the whole
debugging system.
2018-02-08 20:48:16 +01:00
Jehan 387a429e37 po-windows-installer: a few fix miss and re-formatting long lines.
I missed a few of the syntax bugs ("%n" and these sort of things), but
also a broken link to the bugtracker URL (don't add spaces). Also I
reformated the long lines by running "make update-po" again.
2018-02-08 16:45:52 +01:00
raja rizki 8f11684188 po-windows-installer: initial Indonesian translation.
Note by Jehan: this was initially contributed on the github mirror:
https://github.com/GNOME/gimp/pull/16
I would usually just tell them (which I did!) to post the patch to our
official bugtracker, and/or get in touch with the translation team, but
that was a brand new language support for the Windows installer so even
though I don't understand Indonesian, at least I know that doesn't break
anyone's previous work. Moreover setting up the new `.po` file requires
a bit of knowledge which a first-timer (contributor said he was) may
choke on. So that's me being nice and not wanting to waste a good first
contribution. :-)

I still had to manually copy-paste the translation since the translator
was attempting to modify setup.isl.in directly. Also I fixed a few
format syntax things (%n, %1, &Something… these sorts of things).
2018-02-08 16:37:19 +01:00
Jehan 97716ea3c7 po-windows-installer: add Indonesian translation.
A new translator quickstarted the translation on the github mirror.
Since he is a bit unexperimented, I do the initial setup.
2018-02-08 16:37:19 +01:00
Jehan 8d2ae895bd app, tools: use the new gimp_print_stack_trace() to output the...
... stacktrace into a file on non-Win32 systems.
This has a few advantages:
- First, we don't need to duplicate stacktrace code inside the
  independent gimp-debug-tool (I even noticed that the version in the
  tool was gdb-only and not updated for lldb fallback; proof that code
  duplication is evil!). Instead, even on a crash, we can create the
  stacktrace from the main binary and simply pass it as a file.
- Secondly, that allows to fallback to the backtrace() API even for
  crashes (this was not possible if the backtrace was done from a
  completely different process). That's nice because this makes that we
  will always get backtraces in Linux (even though backtrace() API is
  not as nice as gdb/lldb, it's better than nothing).
- Finally this makes the code smaller (i.e. easier to maintain), more
  consistent and similar on all platforms.
2018-02-08 16:37:19 +01:00
Jehan 5de7aab482 app: replace g_on_error_query() and g_on_error_stack_trace() by...
... our own implementation.
Though the GUI stacktrace is better for most (because it is visible even
when not run in a terminal), the CLI options are quite useful too and
may still be preferred by some, in particular developers. So it may as
well be benefiting from the better implementation. Glib traces are quite
weak even though they also use gdb and debug info are present (often,
even though I had these traces, I had to run gdb separately; now it
won't be necessary in many cases). My traces include more information.

Note that I didn't implement gimp_print_stack_trace() from previous
gimp_get_stack_trace() because I cannot allocate a string after some
types of crash (e.g. segmentation faults). So instead,
gimp_print_stack_trace() now take care optionally of both cases: either
allocating a string, or directly pipe to a file descriptor.
2018-02-08 16:37:19 +01:00
Alan Mortensen 580ed29fd2 Updated Danish translation of gimp-libgimp 2018-02-08 03:33:14 +01:00
Jehan 753f4cf4a3 app: don't check stack_trace_mode anymore in gimp_get_stack_trace().
These are now parallel concepts. The stack_trace_mode is for the CLI
option and the check happens on another level already.
2018-02-08 02:39:20 +01:00
Ell 07355803a8 app: use gegl_buffer_signal_connect() in gimp:buffer-source-validate
... instead of g_signal_connect(), to connect to the buffer's
"changed" signal.
2018-02-07 09:54:08 -05:00
Ell 94554fcc0c app: resize group-layer mask after moving the group
We avoid resizing the mask as a result of changes in the group's
bounding box while the group is being moved (i.e., translated,
rotated, etc.), so that GimpLayer transforms the original mask,
rather than a cropped mask.  We still need to crop the mask after
we're finished moving the group, however.  This commit takes care
of that.
2018-02-07 09:54:08 -05:00
Jehan 88c5eb6318 NEWS: keep up-to-date. 2018-02-06 03:40:48 +01:00
Ell af6b891b64 plug-ins: in file-psd, read and write group-layer masks
Add support for loading and saving group-layer masks from/to PSD
files.
2018-02-05 16:22:12 -05:00
Ell 7e661d3ca9 pdb: allow adding masks to group layers in layer-add-mask
... and a small fix to last commit.
2018-02-05 15:33:55 -05:00