Commit Graph

41926 Commits

Author SHA1 Message Date
Jehan 47163717ba Issue #1723: gih file that crashes gimp-2.10.
The flag `free_selection_string` is used to track an array of strings
with some of them being static and others allocated. This should have
been an array of boolean but we can't change it because it is public API
(though it should really not have been!).

So let's just allocate every string of the `selection` array instead,
which makes the boolean flag useless now.

(cherry picked from commit b585201e5e)
2018-06-27 18:16:00 +02:00
Jehan 6b71bf27c8 build: build flatpak with new --with-icc-directory option.
This will set the default color profile directory under its path inside
the sandbox and therefore fix issue #15 of our flathub repo.
While I am at it, I do some cleaning and remove --enable-vector-icons
since this is now the default.

This is in particular necessary because permission in manifest
--filesystem=/usr/share/color/icc does not work as expected to mount the
system repository inside the sandbox at the same path.

See commit 8f3bf7b175d44118f9146e31191fcb7558614b31 from flathub
repository for org.gimp.GIMP.
2018-06-27 17:17:05 +02:00
Jehan a89c4738cc devel-docs: update macOS support to OSX 10.12 on master.
We diverge from the gimp-2-10 branch by setting a higher minimum
support for the GTK+3 port, as discussed with Mitch and Samm.
2018-06-27 16:10:49 +02:00
Michael Natterer 2e076f8205 plug-ins: wait one second before calling webkit_web_view_get_snapshot()
See https://bugs.webkit.org/show_bug.cgi?id=164180
2018-06-27 16:07:24 +02:00
Jehan 4ff856f68d plug-ins: lookup WMF fonts on same prefix when relocatable bundle.
When ENABLE_RELOCATABLE_RESOURCES is set, override libwmf fontdir. This
is actually an alternate version of MR !9 by Alex Samorukov assuming a
bundled GIMP on a single prefix rather than depending on an environment
variable.
This especially makes the relocatable feature more discoverable (rather
than some random environment variable for which you'd need to read the
code to discover it then make some wrapper script for GIMP).
2018-06-27 04:29:38 +02:00
Anders Jonsson 0084776002 Update Swedish translation
(cherry picked from commit cede80c4eb)
2018-06-26 21:55:33 +00:00
Jehan 8da2646372 configure: replace --enable-bundled-mypaint-brushes with...
... --enable-relocatable-bundle option.
This will allow to use this option for more than MyPaint brushes. For
macOS and Windows, we default to "yes" and "no" for other OS, though it
is always possible to set an explicit value.
2018-06-26 23:22:02 +02:00
Daniel Korostil a1989ff003 Update Ukrainian translation 2018-06-26 21:01:50 +00:00
Jehan 590b8bb4bf .gitlab: adding a MR template.
This is not really a template, more like recommendations so that we
don't have to repeat ourselves too much (hopefully). Let's hope it
helps.
2018-06-26 20:49:18 +02:00
Michael Natterer a12cb58b7c plug-ins: create the web-page image using webkit_web_view_get_snapshot()
instead of getting a snapshot from GtkOffscreenWindow, I guess there
is too much threading involved now to properly wait for the rendering
of the page, so use the WebKit API instead.
2018-06-26 20:46:37 +02:00
Jehan 4fa5f61dae desktop: tentative release for 2.10.4 on 2018-07-07.
And uncommenting the <release> tag for translators to be able to work on
it. Also using short list items without finale points to agree with
`appstream-util` rules.
2018-06-26 20:17:17 +02:00
Jehan 1b9729d46d app: replace Carbon/Carbon.h by CoreGraphics/CoreGraphics.h.
As asked by Samm and solid_black on IRC.
Apparently tested and the change is fine, while getting rid of
deprecated API. I cannot test myself.
2018-06-26 15:50:40 +02:00
Michael Natterer c6aa613f9c Issue #1719 - GIMP crashes with an invalid pluginrc
Check the return value of gimp_file_new_for_config_path() and set
an error if it returns NULL.
2018-06-26 14:58:33 +02:00
Adrian Perez de Castro d37f352825 plug-ins: port web-page to WebKitGTK+ 2
This is the minimum set of changes needed to make the web-page plug-in
buildable again using WebKitGTK+ 2.x. Tested as building with WebKitGTK+
version 2.20.3, but unfortunately I cannot test the plug-in as GIMP will
produce an error when trying to use it.
2018-06-25 23:54:56 +00:00
Adrian Perez de Castro d34f46b3c4 plug-ins: port help-browser to WebKitGTK+ 2
This is the minimum set of changes needed to update help-browser to the
WebKitGTK+ 2 API. Fortunately, the plug-in did not use parts of the old
API which would have been difficult to port (DOM bindings, for example),
and therefore the code translates quite well to the new API. The main
differences are:

- WebKitWebFrame is gone, most of its methods are now in WebKitWebView.
- Searching for text inside Web pages has to be done now through the
  WebKitFindController object.
- Checking whether there is selected text that can be copied now goes
  through WebKitEditorState.
- The WebKitWebView::title-changed signal is no more, the callback is
  connected to notify::title instead.
- The load-started and load-finished pair of signals are now merged
  into WebKitWebView::load-changed.
- There are no methods to zoom a WebKitWebView in and out, instead
  the zoom-level property is set. The updated code ensures that the
  zoom lovel stays inside the [0.1, 10.0] range.
- Page visit history now goes through WebKitBackForwardList.

The updated plug-in was successfully built in tested with WebKitGTK+
version 2.20.3.
2018-06-25 23:54:56 +00:00
Michael Natterer cb0e6c65d0 Issue #1714 - When GIMP starts, default brush hardness is always at 100
We should not have essential signal connections (such as setting tool
options from brush properties) implemented in the tool options GUI
files, because they are not active until the options GUI is created.
Also, that magic is simply too hidden in the options GUI files.

Move the signal connections and the brush property copying code to
gimppaintoptions.c where is can also be done cleaner.

However, this must only be done for the main tool options instance
that is used for the GUI. Therefore, add a "gui_mode" boolean to
GimpToolOptions and set it to TRUE for all main tool options.

(this is ugly, but much less ugly and much less hidden than all the
places where code lives (like tool_manager.c) that can now be moved
into GimpToolOptions and its subclasses, and implemented cleanly
there).
2018-06-26 00:30:12 +02:00
Jehan aad82d1a9b app: add an assertion test on result of gimp_widget_load_icon().
Actually since we make this function so that it should never return
NULL, we may as well return a test at the end. If pixbuf is NULL, then
it is an implementation bug somewhere and we should fix it.
2018-06-25 16:15:25 +02:00
Jehan 80d2a02b58 app: reorganize a bit gimp_widget_load_icon().
Massimo spotted some warning with clang in #1608 about pixbuf being used
initialized. Rather than just initializing it, I am actually
reorganizing a bit more the function because there was a bit of a logics
bug. In some weird case, it would have still been possible for this
function to return NULL instead of a magenta square (the case was: the
icon was not present in the icon theme; then wilber-eek was either not
present or failed to load).

This new code organization is more clearer, as a step by step, should
better identify the various failure cases and always return an allocated
GdkPixbuf.
2018-06-25 16:01:46 +02:00
Oleksii Samorukov 5b6126146a Fix screen resolution detection on OSX
GTK always returns 72 dpi due to API used. This patch using Cocoa
directly instead. Tested on Retina and non-hidpi displays.
2018-06-25 10:01:48 +00:00
Jehan 49b4b1a5c2 libgimpbase: fix declaration after statement and reset safecheck...
... after each successful read().
I completely missed this declaration after a statement during the review
of !13 even though I saw another similar issue!

Also let's reset the error counter to 0 each time a successful read()
happens so that we can continue reading even if a lot of EINTR were to
happen, as long as we globally go forward. Only consecutive errors
increment the counter.

Finally add a small comment to explain why we let EINTR pass instead of
breaking directly.
2018-06-25 01:14:15 +02:00
Alex Samorukov 559d9b89e3 Fix empty lldb backtrace on OSX
When lldb attaching to the process it triggers few "-1" errors on read with
EINTR error. After 1-2 errors read() call works again.
Also this patch fixing TID detection, syscall SYS_gettid is oficially deprecated
now and does not work. Also adding safecheck to avoid enldless loop.
2018-06-24 22:42:40 +00:00
Jehan 792b27afe1 libgimpwidgets: do not free the GtkAdjustment when finalizing...
... GimpMemsizeEntry.
A GtkAdjustment is a GInitiallyUnowned, which means it is created as a
floating reference. GtkSpinButton assumes its ownership by calling
g_object_ref_sink() in gtk_spin_button_new() implementation. Thus it
will take care of freeing it and when we try to unref it in finalize(),
the object already doesn't exist.

Alternatively we could keep another ref (by calling g_object_ref_sink()
ourselves) but since the spin button is a child of the entry, it will
live all the way until the entry is freed. There is no need to increment
the references. So instead, simplify the code, and don't try to free an
object we don't own anymore.

This fixes CRITICAL assertions:
> g_object_unref: assertion 'G_IS_OBJECT (object)' failed
2018-06-24 23:28:50 +02:00
Jehan 50bcc8db3c Issue #1712: Add translator comment for string "Export Exif...
... metadata by default".
Also for other metadata, and doing it both for the tooltip and the label
of the option.
2018-06-24 21:09:59 +02:00
Piotr Drąg 25a6ec29a0 Update Polish translation 2018-06-24 19:32:07 +02:00
Piotr Drąg 6834af889e app: fix typo in a translatable string (trnasferred) 2018-06-24 19:31:59 +02:00
Jehan b7685cc579 app: remove check since gimp_widget_load_icon() now always non-NULL.
This is the only place where such a check occured. All other calls
seemed to expect the return value to be non-NULL already.

(cherry picked from commit a9d851070a)
2018-06-24 18:26:49 +02:00
Jehan a6e77355d8 Revert "Issue #1608: Gimp 2.10.0 and 2.10.2 crash immediately on start."
This reverts commit 7886bdc2a9.
Not needed anymore since commit cb7cae2fec.
Now gimp_widget_load_icon() always returns non-NULL.
2018-06-24 18:26:49 +02:00
Jehan 123dcc6f3f app: gimp_widget_load_icon() should actually always return a result.
When the "gimp-wilber-eek" fallback will fail to load, we just create an
ugly magenta square instead.
See Mitch's review at #1608.

Master adaptation for commit 32931c4606.
2018-06-24 18:26:49 +02:00
Michael Natterer 80997a8646 Remove most GTK_ADJUSTMENT() and (GtkAdjutment *) casts
they are obsolete in GTK+ 3.x because GtkAdjustment cannot be passed
around as GtkObject any longer, GtkObject is gone.
2018-06-24 18:15:16 +02:00
Jehan 877c20f420 app: even for fallback icons, it is better to check lookup success. 2018-06-24 17:27:36 +02:00
Jehan 352bc2160f app: add a doc-comment to gimp_widget_load_icon().
Mostly to make sure that calling code takes NULL as a possible return
value.

(cherry picked from commit 4d4ba34006)
2018-06-24 17:14:25 +02:00
Jehan ff9d41902e app: load "gimp-wilber-eek" as fallback when an icon fails to load.
We were already doing so when an icon was simply absent from the icon
theme. But we may still end up in cases where the icon is seemingly
present, yet it fails to load (for instance the image file is
corrupted). When this happens, let's also try to load the wilber-eek
fallback.

Note that it doesn't completely stops gimp_widget_load_icon() from
possibly returning NULL (in the case where "gimp-wilber-eek" is also
missing/corrupted for instance), so calling code must still account for
possible NULL return value.

Basically the same as commit 9c6237b182
except that I just redid it instead of cherry-picking because the code
was a bit too different.
2018-06-24 17:02:19 +02:00
Jehan 7886bdc2a9 Issue #1608: Gimp 2.10.0 and 2.10.2 crash immediately on start.
If "gimp-swap-colors" or "gimp-default-colors" are present in the theme,
yet broken somehow, GIMP would crash because it was not checking if the
icons had been successfully loaded.
Just make the relevant checks and output on standard error that the swap
and/or default color areas are invisible.

(cherry picked from commit d997b2b897 with
conflicts resolved)
2018-06-24 17:02:19 +02:00
Michael Natterer b8e75a0201 app: more GimpGradientEditor cleanup
Let the split and replicate segments dialogs keep their own data and
don't use GimpGradientEditor struct members. Remove redundant members
and indent the struct.
2018-06-24 16:24:16 +02:00
Michael Natterer 025a13b519 app: peek/poke much less in GimpGradientEditor internals
Add gimp_gradient_editor_get_selection() and set_selection()
and use them in gradient-editor-commands.c
2018-06-24 15:58:59 +02:00
Michael Natterer acd3a6f169 Clean up color selector styling
- remove redundant frames, 3d-frames are gone anyway, so no need to
  keep double out/in frames around
- give all color selector classes CSS names
- add/fix some theme CSS styles
2018-06-24 15:41:04 +02:00
Michael Natterer 2b8b780b6a app, libgimpwidgets: all GimpColorHexEntries should have the same tooltip
Set the tooltip in GimpColorHexEntry itself and remove all other
tooltip setting. This just moves the translatable string sround in
libgimpwidgets/, and even removes it from app/.
2018-06-24 14:19:25 +02:00
Michael Natterer ca3ffec111 Issze #1711 - GIMP does not unref all GLocalFileEnumerator it uses
unref the enumerator when done. Spotted by Massimo.
2018-06-24 14:14:07 +02:00
Michael Natterer 72bc216f4a app: make GimpFgBgEditor and GimpFgBgView honor border and padding
and give them CSS names. Set an appropriate padding for GimpFgBgView
in notebook tabs in the theme CSS.
2018-06-24 13:58:21 +02:00
Jehan c21eff4b03 Issue #1689: create unique temporary file with g_file_open_tmp().
Not sure this is really solving the issue reported, which is that
`g_get_tmp_dir()` uses environment variables (yet as g_file_open_tmp()
uses g_get_tmp_dir()…). But at least g_file_open_tmp() should create
unique temporary files, which prevents overriding existing files (which
is most likely the only real attack possible here, or at least the only
one I can think of unless some weird vulnerabilities exist in glib).
2018-06-24 04:55:44 +02:00
Jehan b87d34bace icons: work around dimension bug of librsvg for a bunch of color icons.
It feels I am just fighting against the system. So annoying!
2018-06-24 00:03:59 +02:00
Jehan 199df5a128 icons: complete color-scalable SVG.
Preparing extracting icons from a single file.
2018-06-23 22:35:41 +02:00
Jehan 8a36b786bc tools: post-process SVG objects with "color-important" label.
This will allow a designer to simply "tag" an object so that its color
does not get overrided by GTK+ without needing to edit the file as text.
2018-06-23 20:24:26 +02:00
Jehan 5e25cdc713 Issue #1708: g_free() called instead of gdk_device_free_history().
As spotted by Massimo!
2018-06-23 19:54:19 +02:00
Jehan 4c68d5dfc9 icons: update various icons to account for librsvg bugs.
It should now be possible to fully export our symbolic icons from a
single central file.
My long-standing bug of librsvg#250 is still opened and unfixed, but it
turns out most issues I encountered are anyway also problems when
recoloring symbolic icons in GTK+ (like using strokes instead of
fills!). So let's just bypass all problems at once by accounting for
these issues in the design.
2018-06-23 17:53:11 +02:00
Jehan 8811b0d916 icons: fix many icons for proper recoloring.
I tried to fix all the icons I could see which had issues regarding all
recoloring matters (using fill not stroke, change circle/ellipses to
paths, etc.) when looking at a blank canvas.
I'm sure I still miss a lot but that will do for now.
2018-06-23 12:50:33 +02:00
Michael Natterer 627d58dce1 Issue #1706 - Typo in gimpgradientselect.h include guard
Fix typo, spotted by Massimo.
2018-06-23 12:40:44 +02:00
Jehan 5d5bbeb88b icons: force colors on some icons.
Sometimes even within symbolic icons, parts of the design must keep
fixed colors, when they are semantic. For instance this is the case for
the color-picker-(black|gray|white) icons or the gimp-default-colors.

The trick used by GTK+ to recolor is by supplying an additional CSS
style to icons which overrides inline CSS thanks to "! important"
keyword. Our own trick to circumvent this trick is to set "!important"
in inline CSS when one wishes not to have it overrided by the general
colors.
Right now I am doing the edit by hand with vim because Inkscape doesn't
seem to validate this keyword if I add it manually in its XML editor. So
what I did is add the "color-important" label on such object, and I will
later modify my SVG export tool to add !important on such object "fill"
values at export time.
2018-06-23 11:47:19 +02:00
Jehan fd46018203 icons: fix various symbolic icons not properly recolored.
The current recolorization code only recolors paths and rectangles. In
particular it leaves circles and ellipses as-is.
I opened the merge request gtk!214 for this issue. But in the meantime,
it is quite easy to change circles and ellipses into path with "object
to path" in Inkscape.

A second problem is that it only recolors fills, not strokes, as
previously stated. So I need to remove strokes from icons, or transform
them to paths.
2018-06-23 01:41:26 +02:00
Anders Jonsson 3a23dc3849 Update Swedish translation
(cherry picked from commit 5a0299acf0)
2018-06-22 21:14:08 +00:00