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)
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.
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).
... --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.
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.
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.
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.
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.
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).
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.
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.
... 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.
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.
... 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
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)
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.
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.
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)
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.
- 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
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/.
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).
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.
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.
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.
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.