Commit graph

3392 commits

Author SHA1 Message Date
Bruno Lopes
7ce3ed457e app, libgimp*, modules: More type <> casting fixes 2026-03-31 16:27:25 -03:00
Bruno Lopes
77682518b9 app, plug-ins: Use strcpy_s on Windows to fix CRT_INSECURE_DEPRECATE warnings 2026-03-30 22:32:01 -03:00
Bruno Lopes
2066844166 app, lib*, plug-ins: Use sscanf_s on Windows to fix CRT_INSECURE_DEPRECATE warns 2026-03-30 22:31:57 -03:00
Bruno Lopes
f4f1baf5ef app, libgimp, libgimpbase, libgimpwidgets, plug-ins: Add macro to unused code
This fixes Apple Clang warnings about:

- xdiff
- ydiff
- gimp_ui_get_foreign_window
- locale_parser_parse
- use_app_menu
- gimp_unique_dbus*
- transient_set
- gimp_get_foreign_window
- support
2026-03-29 17:19:42 -03:00
Alx Sa
1d6e8a3a9c display: Simplify vector code from 916cf84e
This patch updates the vector layer DnD code to
use gimp_vector_layer_set (), instead of grabbing
the VectorLayerOptions and then FillOptions objects.
2026-03-18 02:48:56 +00:00
balooii balooii
e0d70d4dc9 Issue #12357: Fix navigation popup positioning and dragging on Wayland 2026-03-12 22:36:25 +00:00
balooii balooii
b0ee5ddfce Issue #12491: Fix GimpUnitComboBox immediately closing on certain platforms
I noticed that the issue of the combo box popup getting immeidately
closed on Linux X11 (and probably macOS as well) only happens when using
GimpUnitComboBox as used in gimppropwidgets.c and gimpsizeentry.c while
there is no issue when used in gimpstatusbar.c

The only noticable difference I saw was that in status bar was that
the wrap width of combo box was set to 1 via
gtk_combo_box_set_wrap_width. Which was added as a hack for another
issue.

I did the same for the other two uses of GimpUnitComboBox and the issue
disappeared so I moved this hack to GimpUnitComboBox itself as it seems
to be generally useful.

The change doesn't make much sense to me and is a workaround for
something that should probably be changed in GTK but well.

As explored in !2654 I think we shouldn't use GtkComboBox but reimplement
using a Popover. This would get rid of these workarounds as we wouldn't rely
on internal behaviour of GtkComboBox.

Couldn't test macOS or Windows but Linux X11 and Wayland work just fine.
Tested by: GDK_BACKEND=x11 gimp and GDK_BACKEND=wayland gimp

Fixes #12491

Superseedes !2654
2026-03-10 00:11:37 +01:00
Gabriele Barbero
0d3ea5f4f1 display: fix wrong assertion in gimp_display_shell_set_child 2026-03-09 14:39:32 +00:00
Gabriele Barbero
eb52c529ff display: push on-canvas text editor fully inside the display
Previously, the on-canvas text editor would be repositioned only if it was completely
outside the display. If it was partially off-screen, it could be hard to
move it back inside (e.g.  when only a small part of the editor was visible
and difficult to grab). Now, the editor is always adjusted to remain fully
visible within the display
2026-03-09 14:39:32 +00:00
Jehan
9d7266c4ed Issue #15242: on a flush, only update actions for the active image.
Though my previous commit is not absolutely wrong (so I'll leave it in;
it does make sense that we don't set any lock actions as ACTIVE when
there are no items), this new commit is actually the real issue. The
previous commit was getting rid of the extra lock actions, but I
realized that the "edit-undo" action was made insensitive too.

This is because in multi-window mode, a flush was updating all action
groups for the visible image of all opened windows (in single window
mode too, but there is only 1 window, hence only 1 visible image, so no
bug happening). Depending on order of these updates, we could end up
updating actions based on items or undo stack of a non-active image. And
worse, this could even affect the active image itself (which was what
was happening with the locks).
2026-03-06 16:45:04 +01:00
Jehan
dda2cc03b1 Issue #15763: check there is a current device before checking its cursor.
Devices are now listed later in the startup process since issue #13709.
2026-02-02 20:09:01 +01:00
Alx Sa
cf41831a58 display, widgets: Change Navigation/Selection editor UI...
...for dark mode.

The Navigation and Selection Editor
docks use GIMP_ICON_TEXTURE as their
default background when there's no
active image. On dark mode, this creates
large bright areas in the UI.
This patch removes the calls to
gimp_view_renderer_set_background ()
for these docks so the theme background
is used instead.
2026-01-20 16:46:12 +00:00
Alx Sa
916cf84e96 display: Update vector layer fill with DnD color/patterns
This patch adds to the code that updates
text layers when colors are drag and dropped
on them. It now also allows color and
pattern drag and drops to update the fill
of vector layers.

Link layers are also protected so they won't
be destructively changed unless 
rasterized.
2026-01-17 15:06:56 +00:00
Gabriele Barbero
651ec04744 display, tools: use gimp_display_shell_untransform_xy_f...
... to get limits in image coordinates instead of gimp_ruler_get_range.
Rulers return values in the active unit (e.g. mm, inches), while the
overlay logic works in pixels. This unit mismatch caused incorrect
clamping of the text overlay position, making it jump
when dragging if the unit wasn't set to pixels.
2025-12-18 14:49:11 +01:00
Jehan
d92c237a17 Issue #13709: wait we get our first surface focus before listing…
… input devices.

Per Carlos' advice on gtk#7534, I wait for us to get a focus, since the
pad devices are only created at that point.
Note that this is a Wayland-only issue, but since it doesn't matter too
much that input devices are not initialized before we have a focused GUI
anyway, let's make this simpler.

At the earliest, the splash focus can announce a focus, but since it is
possible to start GIMP without the splash, display shells will also
possibly announce the first focus (there will always be a display shell
focusing at some point for any GUI GIMP!).
2025-12-16 00:02:33 +01:00
Bruno Lopes
232337550d
app: Fix disordered windows.h include on display and gui sources
The headers provided by Windows SDK do not work disordered.
Somehow, MINGW is more lenient regarding that error.
2025-11-29 18:18:46 -03:00
Gabriele Barbero
c5e9b51c0d Revert "core, display: Enable resize for GUI layer copying"
This reverts commit 975d1a4aa3.
2025-11-07 22:50:45 +00:00
Gabriele Barbero
f089ed69d7 tools: prevent on-canvas text editor from being dragged outside the image bounds
This commit prevents the on-canvas text editor from being dragged outside
the image bounds by checking the overlay's position and adjusting the
coordinates to keep it within the canvas. Additionally, it checks whether
the overlay is entirely outside the canvas and, if so, pushes it back inside.
2025-10-31 15:39:10 +01:00
Gabriele Barbero
dae8472d58 tools: allow on-canvas text editor to move
This commit implements the ability to freely move the on-canvas
text editor across the screen by introducing a drag-and-drop mechanism.
2025-10-31 15:39:10 +01:00
Alx Sa
f302d42f5d display: Allow URI drag-n-drop to image tab bar
This patch connects GimpImageWindow's notebook
header to respond to external file/URI drag-n-drop.
If you drag files onto the image tab bar, it will create a
new image for each file.
Code based on a similar feature in gimpdisplayshell-dnd.c.
2025-10-21 01:06:53 +00:00
Bruno Lopes
f09007507f
Declare gexiv2 dependency on many targets (due to gimpmetadata.h)
Our build files were relying 'sysroot' to find gexiv2.h but this is
not possible with Apple Clang om which sysroot points to macOS SDK.
So, exotic environments like Homebrew were failing. Let's fix this.
2025-10-03 18:31:53 -03:00
Gabriele
7f8298467b Issue #11869: use a custom AppMenu for macOS 2025-09-26 11:43:47 +00:00
luzpaz
91418131a0 app, libgimp*, pdb, themes: Fix description typos
This patch fixes minor typos in user-facing descriptions
and internal comments found by Codespell.
2025-09-24 16:50:15 +00:00
Jehan
bb9aad1e87 app: fix crash on invalid previously picked layer.
This happened to our artist in residency. She had a crash when
gimp_image_pick_layer() was apparently run with a non-NULL yet invalid
previously_picked layer. So let's make sure that we clear the stored
item pointer when the object gets finalized.
2025-09-11 23:31:03 +02:00
Estecka
0fd280db5c Issue #14777: Fix bad axis centering on zoom-out.
This was simply caused by two variables having been swapped.

Gimp 2 used to work properly because there were two separate mix-ups that
cancelled each other: one in the function arguments, and one in the code
itself. Gimp 3 had fixed the error in the arguments, but not in the code,
thus enabling the bug.
2025-09-09 17:44:55 +00:00
Cheesequake
71caf7eb05 Issue #13746: change incorrect variable to check for changes in y-axis 2025-09-08 14:41:41 -03:00
Alx Sa
0782b9166b display: Guard private->initial_monitor when NULL
On some systems, it is possible for gimp_image_window_switch_page ()
to be signaled when private->initial_monitor has been set to NULL but
we don't yet have a GtkWindow. This eventually produces a CRITICAL
when gimp_dialog_factory_add_foreign () is run with a NULL monitor.

This patch adds a condition so that gimp_image_window_session_update ()
is not run with a NULL monitor in those cases.
2025-09-06 16:01:07 +00:00
Jehan
66cdecb0fa app, menus, pdb: new file-open-as-link-layers action.
Revert the logic of opening all files as link layers back into loading
their current content as normal layers.
Instead just add a new action dedicated to open images as link layers
and add it to the File menu.

Per UX discussions with Aryeom.
2025-08-27 11:34:04 +02:00
Alx Sa
a1cd2a2588 path, tools, pdb: UX updates to vector layers
This patch improves vector layer UX based on feedback.
In summary:
* Makes vector layer editable from the Path tool
* Adds initial PDB for creating vector layers in scripts
* Size vector layers to the path size, rather than image
* Transform tools utilize the path for resizing
* Path tool automatically selects vector layer path
2025-08-17 02:20:19 +00:00
Gabriele Barbero
6574f6ff30 display: avoid critical on master devices
When the device is of type GDK_DEVICE_TYPE_MASTER, calling
gdk_device_get_vendor_id() and gdk_device_get_product_id() fails and
triggers a CRITICAL warning. This commit avoids invoking these functions
on master devices, where failure is guaranteed.
See #14219
2025-08-11 09:55:17 +02:00
Michael Natterer
e9b2b1ad7b app: add "gint old_index" argument to GimpContainer::reorder() 2025-08-08 17:02:32 +02:00
Michael Natterer
d4e8ab0234 app: rename GimpContainer's "children-type" property to "child-type" 2025-07-18 08:19:13 +02:00
Michael Natterer
246f9d284f app, pdb, libgimp: use "#pragma once" instead of:
#ifndef __FOO_H__
 #define __FOO_H__

 /* declarations  */

 #endif /* __FOO_H__ */

And some cleanups while I saw the headers.
This is far from finished...
2025-07-13 03:21:37 +02:00
Michael Natterer
e85d696cd9 app: forgot to commit the changes in app/display 2025-07-12 11:49:21 +02:00
Niels De Graef
fcdbd74071 app: Split off GimpControllerManager
Transform the `GimpControllerManager` so it encapsulates all the logic
related to managing all `GimpControllerInfo` objects, so we can pass
that object around, rather than dealing with the `Gimp` struct
everywhere and pretty hackishly retrieving the manager struct using
`g_object_get_data()`. By also making it a proper `GObject`, we can
later put even more logic onto it.
2025-07-08 12:52:04 +02:00
Michael Natterer
89ea91df96 app, libgimp*: more g_set_str() and some other stuff in the same
spirit
2025-07-08 00:37:26 +02:00
Michael Natterer
199eecfb66 app: use g_set_str() in some places, it's hell yeah! 2025-07-07 22:55:44 +02:00
Michael Natterer
6a3256ad69 app, menus: rename the vector-toolpath menu stuff to tool-path 2025-07-07 16:32:20 +02:00
Michael Natterer
4ce5181cc5 app, menus: vectors -> path in dialog and action identifiers 2025-07-07 16:16:48 +02:00
Michael Natterer
69f84942fa app: rename app/vectors/ to app/path/ 2025-07-07 15:44:15 +02:00
Michael Natterer
d88a3b9345 app: rename enum GimpVectorExtendMode to GimpStrokeExtendMode
and give namespace to its values.
2025-07-07 15:05:59 +02:00
Michael Natterer
f5900020d3 app: more vectors -> path, mostly in GimpToolPath 2025-07-07 14:16:50 +02:00
Michael Natterer
6d2c71591d app: GimpToolPath: rename "path" to "tool_path" and private->path to
private->canvas_path
2025-07-07 13:37:27 +02:00
Michael Natterer
bee7b8713b app, pdb: a lot of vectors -> path renaming 2025-07-07 13:18:02 +02:00
Jehan
e41776ef39 app: clean out unused functions. 2025-06-20 00:11:08 +02:00
Michael Natterer
bf877a8aa3 app, pdb: move filter duplication to one place in
GimpItem::duplicate().
2025-05-28 17:28:01 +02:00
Alx Sa
4eb462a7a4 display: Fix copy/paste typo for UNSCALEY
In 9fe8e849, we accidentally used UNSCALEX
rather than UNSCALEY for offset_y. This patch
corrects that typo.
2025-05-15 13:06:36 +00:00
Alx Sa
db040ce9e0 display: Connect path on click in design mode
Rather than having to hold Ctrl to switch to edit mode, users can now
just click the start point from the end node to create a connected path.
This makes the Path tool consistent with similar tools in GIMP
(such as Free Select, Scissor Select, and Cage Transform tools) as well
as other programs with a Path tool.
2025-05-13 00:11:05 +00:00
Jehan
83e213d770 app: initial monitor information is only needed at display shell construction.
Making sure that it's private then NULLified at end of construction so
that none tries to use this again later on during the life of the
display shell (it may have become invalid since then, cf. #12542).

Also NULLifying a similar variable stored in GimpImageWindow (though it
was already a private variable not used outside in this case).
2025-05-06 01:25:48 +02:00
Jacob Boerema
fedb647cb4 app: fix #12542 crash due to invalid monitor
We store an `initial_monitor` in several places, not taking into
consideration that a monitor object can become invalid, e.g. when
disconnecting or turning off a monitor. When the monitor is invalid,
it can cause a crash in `gimp_display_shell_set_initial_scale`.

Instead of referencing the initial monitor, we request the monitor for
our display shell. Since at that point we already know that shell is
valid, we should get a valid monitor too.
2025-05-06 01:25:48 +02:00