Commit Graph

24049 Commits

Author SHA1 Message Date
Jehan 1b3af8a89b Issue #9648: don't flush the image when selecting items.
This results in an infinite loop and there is no change done, so no reason to
flush anything. Mitch had a fix for this (probably the same, per the IRC
discussion), but I really wanted to just release GIMP 2.99.16. So Mitch, if you
read this, sorry for not waiting for you to push this one!
2023-07-04 22:10:40 +02:00
Jehan c95b8518fe app, icons: use the Python executable found by pythonmod.find_installation().
We already search for a compatible Python version in the root meson file, no
need to look up Python 3 again in the PATH, each time we run an external Python
script in the build.

This should hopefully fix #9687.
2023-07-04 19:00:55 +02:00
Lukas Oberhuber df4ed9c1ec app: Fix key presses not working on mac
Part fixes #9322. This was making GIMP on MacOS unusable.
2023-07-02 15:57:44 +01:00
Jacob Boerema 14cce79d16 app: use hyphen for the precision settings in Encoding submenu
The Microsoft style guide and other places online suggest that using a
hyphen is recommended between a number and the related word, when modifying
a noun, so let's do that in our Image -> Encoding submenu too.
2023-06-30 11:37:19 -04:00
Jehan 757adf94bb app: do not load images interactively when we have no interface.
This includes both cases when running gimp-console or running GUI gimp with
--no-interface option.
2023-06-29 00:09:28 +02:00
Jacob Boerema f65d8e8730 app: silence warning in gimpimage-convert-indexed
We had the following warning:
In function 'make_remap_table',
    inlined from 'gimp_image_convert_indexed' at
  ../../gimp/app/core/gimpimage-convert-indexed.c:1057:7:
D:/msys64/mingw64/include/glib-2.0/glib/gmem.h:261:19: warning: argument 1
 range [18446744071562067968, 18446744073709551615] exceeds maximum object
 size 9223372036854775807 [-Walloc-size-larger-than=]

This is apparently caused by inlining in combination with using a signed
int.
See also: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=85783

Casting to (guint) silences the warning here.
2023-06-27 14:15:34 -04:00
Alx Sa 8a53b7c219 widgets: Fix compiler warning in gimpcontainerview
Initialize "border" to 0 to remove a warning that
"'border' may be used uninitialized"
2023-06-26 14:12:42 +00:00
Jehan 3cb43bef93 app: localize GEGL filter's action default short label template.
Even though it's just for 3 dots, this may actually be formatted differently in
different languages. Let's not assume we all share this punctuation mark.
2023-06-26 02:19:26 +02:00
Øyvind Kolås 7277baea54 meson,app: depend on GEGL-0.4.46 2023-06-26 00:56:58 +02:00
Niels De Graef 26f967e998 app: update relevant comments about Wayland hotspot 2023-06-25 22:21:37 +00:00
依云 edfded372d app: don't scale hotspot in Wayland
The hotspot coords are in the cairo surface's coords space, and the
cairo surface has half the size as the x2 pixbuf because of scale=2,
which makes the hotspot coords remain the same.

With regard to the referred code snippet in the comment[1], the coords
have been scaled in gdk_cursor_new_from_surface.

This fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/9047.

[1]: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/545#note_1388777
2023-06-25 22:21:37 +00:00
lillolollo 691ec70c0e Eliminate warning: ‘gimp_unique_dbus_open’ defined but not used [-Wunused-function] 2023-06-25 18:01:45 +00:00
Jehan ff91a0ac3d Issue #9350: fix GimpMenu separator lines being randomly thick. 2023-06-25 19:04:37 +02:00
Alx Sa ca3c709d56 core: Add color/pattern only fill options
Resolves issue with #8461.
This provides a conditional value for the fill options to only show
a color and pattern, rather than fore/background colors.
Currently only used for the text editor.
2023-06-24 19:42:58 +00:00
Jehan 5bf0ece215 app: fix build warning.
Though not a bug, this change will get rid of the following warning:

> app/dialogs/module-dialog.c:291:28: warning: ‘location’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   291 |       text[INFO_LOCATION]  = gimp_module_is_on_disk (module) ?
2023-06-24 18:42:44 +02:00
Jehan 8ef8ac58aa app: fix crash when loading a XCF containing a text layer with pattern outline.
There was a bug in commit ca6b58e970 which went under the radar. The gimp
variable was not set at creation, so this line was crashing:

> container = gimp_data_factory_get_container (text->gimp->pattern_factory);
2023-06-22 22:23:05 +02:00
Jehan cdc9fa9907 app: migrated (style solid) in gimprc.
Since MR !706, (style solid) doesn't exist anymore which makes gimprc parsing
fails (hence losing configuration).

This fixes:

> Gimp-Config-Message: 21:20:21.018: Error while parsing '/home/jehan/.config/GIMP/2.99/gimprc' in line 18: invalid value 'solid' for token style
> Gimp-Config-Message: 21:20:21.018: There was an error parsing your 'gimprc' file. Default values will be used. A backup of your configuration has been created at '/home/jehan/.config/GIMP/2.99/gimprc~'.
2023-06-22 21:30:13 +02:00
Alx Sa ce6f7179ab core: Replace "Solid Colors" with "FG/BG Colors"
Replaces "Solid Colors" option in Fill Path with Foreground/Background
Colors options. This allows users to fill with either, rather than
having to switch the foreground color each time.
GIMP_CONTEXT_PROP_MASK_BACKGROUND was added to the fill and stroke
contexts to allow the background color to be recognized.
In places where Solid Color was used as a default, Foreground Color is
now used instead.
2023-06-22 18:46:14 +00:00
Andras Timar da0ea189fc Make transform matrix selectable
In our use case it is necessary to save the transform matrix, and the
easiest solution is to make the label selectable. If we print the
whole matrix into a single label, formatted with tabs and linefeeds,
then the whole matrix can be copied with a single operation.
2023-06-21 21:02:23 +00:00
Alx Sa 59cb3e36e1 app: Toggle on-canvas text editor visibility
This adds a new boolean to text options, "Show on-canvas editor".
When toggled, it immediately hides (or re-shows) the current
text layer's on-canvas text editor.
It uses the same signal and function as the "use-editor" property.
2023-06-21 20:17:27 +00:00
Jehan b48ce94e6a app: replace g_action_map_lookup_action() by gimp_ui_manager_find_action().
With more recent logic, not all actions are inside the application's action map.
We need to look up actions in our GimpUIManager.
This fixes failing to find the actions with the "text-editor." prefix (in the
text tool editor's toolbar).
2023-06-21 22:17:09 +02:00
Alx Sa 01d7e7a992 actions: Fix "Raise or Open" to actually raise
Resolves #9636.
gimp_object_get_name (gimp_display_get_image (display)) returns NULL 
instead of the filename. documents_raise_display was changed to call 
gimp_image_get_imported_file () or gimp_image_get_file() instead to 
get the actual filename.
2023-06-21 20:10:12 +00:00
Alx Sa 4b8f2113f3 pdb: Fix datatype mismatch created by 2a946712 2023-06-20 17:03:21 +00:00
Alx Sa 2a94671269 pdb: Allow ripple to take floating point inputs
Partially resolves #7211.
plug-in-ripple is a wrapper for the GEGL ripple effect. GEGL allows for
double values for period and amplitude, while the GIMP PDB only allows 
integers. This patch aligns the datatypes.
Note that Angle and Phi are still limited to the current design.
2023-06-20 15:27:10 +00:00
Øyvind Kolås 5b129f891a app: better synthesized short_label for gegl menu actions
For all the test-ops thus far in gegl, gimp:menu-label has been
the same as title + "..", to keep the number of duplicate strings
that need to be translated and the number of needed boiler-plate
lines of meta-data in GEGL down, this is the default behavior when
a title key exists.
2023-06-17 22:38:53 +02:00
Jehan 07ee2fe776 Issue #9446: better logic to prevent multiple successive inhibition requests.
My previous commit was improving the case where we just get many "dirty" signals
and successful inhibition. But if the inhibition request was failing, we would
just retry again and again.

This new version will hold off on on requesting the inhibition for the next 10
minutes. Then it will try again, in case the failure reason might have been
temporary.
2023-06-16 22:53:59 +02:00
Jehan 863fb62581 Issue #9446: do not uninhibit/inhibit at every image change unless…
… the reason message changes (i.e. when number of dirty image changes).

Some actions in particular would trigger several "dirty" signals, there is no
reason to uninhibit then re-inhibit repeatedly. And as a more general rule,
there is no reason to do so even for different actions while we are not planning
to update the inhibition reason.

It may not be the main reason for #9446 (because if it hangs for several
minutes, there is likely something going on, deeper at the dbus call level), yet
it would definitely alleviate the issue (dividing the wait by as many times as
the dirty signal was emitted!).
2023-06-16 22:04:28 +02:00
Alx Sa d4260449fb app: fix some glib related deprecations
As in d16734a4, this checks the GLib version and conditionally uses 
G_APPLICATION_DEFAULT_FLAGS or G_APPLICATION_FLAGS_NONE for GimpApp.
2023-06-16 00:13:02 -04:00
Alx Sa bf1e125138 widgets: Fix RGB histogram pixel/count values
The RGB histogram shows three histograms overlaid on each other.
This multiples the pixel and count attributes by 3. To correct this,
the result of gimp_histogram_get_count () is divided by 3 for the
pixel and count displays.
2023-06-15 19:24:49 -04:00
Øyvind Kolås 21411047ee app,pdb,plug-ins: %s/gegl_node_connect_to/gegl_node_connect/ 2023-06-13 19:58:42 +02:00
Øyvind Kolås c4734a27b5 meson,app: depend on GEGL 0.4.45 2023-06-13 17:14:03 +02:00
Øyvind Kolås e7dcfb2927 app: use gegl_node_link and gegl_node_link_many
Instead of gegl_node_connect_to which is rather verbose, and slated for
deprecation in GEGL.
2023-06-13 17:14:03 +02:00
Alx Sa f92ecddd53 pdb: Fix NULL check in gimp-file-load-layers
As @bootchk noted, gimp-file-load-layers does not check the result of 
file_open_layers () but the final return variable
which is always NULL at this point in the function.
This patch corrects the problem so it checks the proper variable.
2023-06-13 04:55:13 +00:00
Jehan 7c1fb5bc67 app: return EXIT_FAILURE when failing to pass the batch commands to…
… the main instance.

Note that it doesn't say if the batch command succeded, only if they were
successfuly communicated to the main process for processing.
2023-06-12 01:20:11 +02:00
Jehan eb0ee5f33a Issue #9598: do not rely on GApplication uniqueness feature.
When passing an application ID (which is necessary for application inhibition to
work, i.e. logoff/reboot/shutdown inhibition), GApplication will try to ensure
process uniqueness, which will trigger a new activation to an already running
process. Since our current code assumes that the application can be activated a
single time only, this was what was triggering a whole lot of errors (on the
first running process) in #9598 because there was all the initialization code
which ran again, whereas it was not supposed to.

This doubly-running initialization code was also what completely messed up the
session files, hence broke the GUI after a restart (#9599).

Therefore passing G_APPLICATION_NON_UNIQUE advertizes we don't want GIO to
handle process uniqueness for us.

Note that this is actually a very interesting feature which we have had in GIMP
codebase forever. It would be interesting to kill all our own uniqueness code in
favor of GIO code (and let them handle/maintain passing command line arguments
from one process to another, for all possible platforms). So I added a TODO for
this (for now, we just ignore this feature as it doesn't work well with current
codebase).
2023-06-12 01:10:59 +02:00
Jehan 7f83b27c3c Issue #5601: help icon in the action search.
Additionally to the F1 shortcut, a secondary icon is now shown in the
action search entry. It works exactly the same as F1, i.e. that by
default, it shows the action search manual page (when nothing is
selected), or the manual page for the specific action currently selected
otherwise.
2023-06-11 23:56:55 +02:00
Jehan a13289672a Issue #5601: F1 in action search to load the action help page.
The default F1 result (if no action is selected) is to show the generic
help page for the action search. If an action is selected, it will show
the specific help for this action.
2023-06-11 23:02:15 +02:00
Jehan 27f8448fa2 Issue #8204: link gimp-2.99 executable with the static libapp library.
Since we are already building a static (build-only) libapp, to be used with
tests or tools, let's also use it for the main (GUI) executable.

For the CLI executable though (gimp-console-2.99), we must re-compile
libapp_sources from scratch anyway, because we define the additional macro
'GIMP_CONSOLE_COMPILATION'.
2023-06-11 17:52:40 +02:00
Jehan 6dc5f6792e app: use the new GEGL metadata "gimp:menu-path" and "gimp:menu-label".
Instead of unconditionally add all the non-special-cased GEGL operations into
the menu, only insert the ones which explicitly use the new "gimp:menu-path"
GEGL key.
See new operation "gegl:adaptive-threshold" added in commit 7c2a70eee for such
an example.

Note that the other operations will still get their own generated action (which
means for instance that you can still search them through the action search and
that you can create custom shortcuts for your favorite actions). But now you
won't get an overlong generic list of non-organized actions in a single submenu.
Some people were finding this messy when they had a lot of custom GEGL ops.

Also it means that GIMP doesn't assume that any custom GEGL op is usable in
GIMP. Indeed some ops are really not meant to be used as filters, which is why
we have the gimp_gegl_op_blacklisted() internal function; but this cannot apply
to custom operations. Therefore from now on, instead of GIMP guessing, operation
developers will have the say on whether their op should show in menus and in
which menu path exactly!

Moreover the "gimp:menu-label" key will be used as short label, i.e. the label
which is used in menus in particular, where the menu path is a helpful context
(hence allowing to use shorter menu labels).
The main "title" will still be used as long label, for places where there is no
such context, for instance the action search.
2023-06-10 23:09:00 +02:00
Jehan b437552580 app: make sure that custom GEGL-operation generated actions have unique names.
When reverting commit d51c64ec06 and reimplementing as fa2e9adc29, the code to
make sure the generated per-op action name is unique disappeared. This code
ensures that the action name is indeed unique, otherwise the action will
override a previously registed action, which could be made from a plug-in, or
even by another GEGL operation. Indeed, while GEGL operation names are supposed
to be unique, they are post-processed to be valid GIO action names. So it is
totally possible to have 2 GEGL ops with different GEGL names, yet the same
GAction name.
2023-06-10 23:09:00 +02:00
Jehan 317aa803d2 Issue #7172: option to apply Client-Side decoration on image windows.
This patch does the following things:

- An option "Merge menu and title bar" (this is hopefully more understandable
  than calling it "Client-side decoration" or again "header bar") is added in
  Preferences > Image Windows. This option triggers the restart warning.
  Moreover when checked a small warning message will tell that in some cases, it
  may not work (there are feedbacks of people having 2 title bars when using GTK
  applications using CSD).
- For the reason evoked above (sometimes 2 title bars) and also because the CSD
  concept seem really to divide people a lot (some love this as much as others
  hate this), this new option "custom-title-bar" on GimpGuiConfig is FALSE by
  default.
- When the option is checked, the image windows will use a GTK header bar
  containing the menu, the window title (image name and information) as well as
  the usual minimize/maximize/close buttons per your OS conventions.
- Since the header bar is set to be hidden when maximizing, if you checked "Show
  menubar" for the "Default Appearance in Fullscreen Mode" in Preferences >
  Image Windows > Appearance, the menu will be moved to its "old style"
  position, i.e. above the canvas. This makes the menu possibly visible (if
  relevant option is checked) even in fullscreen mode.
- I tweaked the Default theme to show the header bar with minimal height,
  because I find GTK default theme's headerbar height unreasonably high
  (especially if the point of the header bar is to save screen space). I am
  unsure if this was the right move though, because maybe the default theme
  should not do such choices (maybe this should go in the Compact theme?).
2023-06-09 20:19:01 +02:00
Jehan 10742367c5 app: create a dedicated UI manager for the quick mask popup.
I don't see a reason why the quick mask menu was sharing the same
manager as the image menu (the main top menu and on-canvas). This was
why it was receiving all notifications to create menu items on <Image>,
as registered by plug-ins.

Giving it its dedicated manager makes sure this doesn't happen.
2023-06-09 17:20:11 +02:00
Jehan 30c5e20ce7 Revert "app: fix bailout condition in gimp_menu_model_handles_subpath()"
This reverts commit 3a35974e3a.
This is not the right fix for the issue (which was happening on the
Quick Mask menu specifically) because root menu models are set with a
NULL path. So forbidding root menu models to handle new subpath means
preventing plug-ins to register new top-level menus.

The correct fix for the issue on the quick mask menu will happen in a
coming commit.
See issue #9586.
2023-06-09 17:15:38 +02:00
Alx Sa e9fdd321cd widgets: Check if editor color is set before...
...trying to get the index. Resolve #9568.
The color picker tool calls this twice if you're in Add to Palette mode,
and the editor's color may not be set the first time it's run.
This adds a check to ensure the color is set before trying to retrieve
it from the palette to prevent a CRITICAL.
2023-06-07 12:19:56 +00:00
Jacob Boerema 0bcce39637 app: update help-ids for layer crop/resize commands
The layer resize to selection and crop to content menu commands were
using the same help ids. This made it difficult to have them both listed
separately in the index of the manual.

Since we use separate help ids everywhere else for menu commands, let's
give each its own help id here too.
2023-06-07 11:24:28 +02:00
Jehan 0233531020 app: make sure the private variable is a valid object if set.
Though this doesn't make a problem in normal use (AFAICS), we have crash
in a unit test in CI because the action_factory object was apparently
invalid when calling gimp_action_factory_delete_group().
2023-06-06 22:30:03 +02:00
Michael Natterer a858474fe8 pdb: GimpResource: add is_editable(), rename(), duplicate(). delete()
and remove the API from its subclasses.
2023-06-06 16:33:36 +02:00
Michael Natterer 018d9fb615 app: remove draw() from GimpComboTagEntry
We don't need to maanually draw the arrow. Fixes #9498
2023-06-06 16:32:15 +02:00
Alx Sa aa2a565d60 widgets: Load simulation intent/bpc in preferences
Resolves #9560.
The Simulation Intent and BPC widgets in the Preference Dialogue needed
to be connected to their properties with `gimp_prop_*` when created to
show the saved default image values.
2023-06-05 19:12:18 +00:00
Alx Sa 6041d01655 dialogs: Set default response to "OK"
This allows users to just press Enter/Return to run it with defaults as
you could do in 2.10.
2023-06-05 13:25:45 +00:00