Commit graph

300 commits

Author SHA1 Message Date
Bruno Lopes
3c71c42c31 app, app-tools, libgimp: Use freopen_s on Windows to fix CRT_INSECURE_DEPRECATE 2026-03-31 13:31:33 -03:00
Bruno Lopes
c69549aff5 app, libgimpwidgets: Fix some declarations mixed with code 2026-03-29 17:19:42 -03:00
Bruno Lopes
85044d78d1 app, build/macos: Move PYTHONHOME logic from .patch to core code
This was tested with both in-house MacPorts, in-house HomeBrew and
legacy CircleCI builds and I confirmed it works (it is needed only
by the in-house MacPorts builds).
2026-03-21 17:34:30 -03:00
Bruno Lopes
dd5349a9f5 app, build: Use gimp_installation_directory() on macOS wrapper
It is more packaging-agnostic than the previous hardcoded code.
I confirmed it works with both in-house and CircleCI builds.
2026-03-19 21:06:40 -03:00
Bruno Lopes
6fab4e2a81 app: GEGL is now relocatable on macOS 2026-03-11 11:21:05 -03:00
Bruno Lopes
755642e76a meson, app, tools: Organize ISO_CODES* macros after build failure report
I don't get how this could be failing because config.h is included on main.c,
but it it: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/2664#note_2699194
So, I noticed that that the macro prefix ISOCODES_ is "new", being introduced
with aba7316e. The pre-existing is ISOE_CODES. Let's unify trying to fix build.
2026-03-06 14:09:35 -03:00
Jehan
0587cbbc9b Issue #15713: Text tool "Language" names not localized on relocatable builds. 2026-03-05 16:29:14 -03:00
Bruno Lopes
24f8f6f68b app: Do not unconditionally force Playground on macOS
Very weird line of code.
2026-03-01 11:15:06 -03:00
Bruno Lopes
8a42c03f0b app: babl is now relocatable on macOS
Since babl 0.1.120. See: GNOME/babl@66ef020f

Properly fixes Infrastructure/gimp-macos-build#13 (closed)
2026-01-15 18:10:48 -03:00
Bruno Lopes
aadf5f1cb2 app: Mention the macOS version that moved us to have internal wrapper
See: https://gitlab.gnome.org/Infrastructure/gimp-macos-build/-/issues/14
2026-01-10 19:00:24 -03:00
Bruno Lopes
a37717206c app: Set GS_LIB for file-ps support on macOS
See: #11475 (will be fully fixed later)

This is needed because, like all other dependencies (with exception of
babl and GEGL), ghostscript is not relocatable from MacPorts nor Homebrew.

Also, add a comment about LSEnvironment key
2026-01-10 10:34:44 -03:00
Bruno Lopes
4e2463b688 app: Set GTK_IM_MODULE_FILE on internal macOS wrapper
This is needed to use im-quartz.so

(It will make no difference on the current gimp-macos-build scripts but it was
already not being defined so fine. It will work in the upcoming new scripts)
2026-01-07 23:01:28 -03:00
Bruno Lopes
5033a8b319 app: Default to 'quartz' IM on macOS for emoji keyboard support
This will work with upcoming changes that will set GTK_IM_MODULE_FILE too
2026-01-07 22:54:36 -03:00
Bruno Lopes
0bca2158fe app: Organize macOS internal wrapper
This is both to make it easier to read and to  make easier to
customize (preparing to the almost-ready macOS scripts on our CI_.
2026-01-06 15:51:36 -03:00
Jehan
90c604f2f4 app: no need to show -i / --no-interface in gimp-console usage.
Note that the option still exists, which allows to not error-out when
using the same set of CLI options on both the GUI and CLI binaries. We
use this ourselves in our build, which is able to use either binaries,
and if -i became forbidden, it'd make complication for our scripts.

Yet since it's basically a no-op on the CLI tool, we might as well hide
it from the usage output.
2025-12-16 17:06:46 +01:00
Jehan
083360fac1 app, etc: do not hide --show-debug-menu.
This is a useful debugging function for developers. It is enough to hide
the menu by default on stable releases, I don't think we also need to
hide the CLI option. Developers don't know all these options by heart,
so we need to make them reasonably discoverable!
2025-12-13 00:10:57 +01:00
Bruno Lopes
897024325d
app, app-tools: Fix WinMain definition on some executables
Now, it works on both GNU compilers and MSVC.
2025-11-29 18:19:07 -03:00
Bruno Lopes
c79bf5790d
app, libgimp: Fix truncation and lack of color on attached Windows console 2025-11-08 12:02:56 -03:00
Bruno Lopes
8913271706
app: Catch CTRL + C signal on Windows attached console
This solves the second issue noted on the last paragraph of 9e795acb
2025-11-08 10:03:41 -03:00
Bruno Lopes
72cb583489
app, app-tools, libgimp: Fix GIMP not outputing on non-native shells
As per IEEE Std 1003.1-2017, Section 8.3, TERM and
SHELL vars says we are running GIMP on POSIX shell.
They are not set by either the deprecated Windows CMD
nor by Windows PowerShell since they are not POSIX.

POSIX shells are supported by us on Linux and macOS but
actually not on Windows, since they are non-native: they
rely on forking to Cygwin which have terrible performance
(##11385) and do other tricks to make deps believe they
are on Unix which breaks e.g. GObject Introspection (#11424).
Anyway, it is Unix emulation at its prime, tricky by nature.

Even so, does not hurt allow the output on these
unsupported shells on Windows so not disrupt workflows
of adventurous developers but they will be warned that
problems (like the ones above) can and indeed appear.
2025-11-01 14:24:01 -03:00
Bruno Lopes
9e795acba7
libgimp: Output CLI messages to the parent console like Linux and macOS
Closes: #15192 and #7413.

Maybe helps with #3603 too.

Loosely based on https://github.com/endlessm/rufus/blob/master/src/rufus.c

The input is right now clunky, needs to use proper API to halt input and
get CTRL+C in the future, but output on terminal is a big plus that pays off.
2025-10-31 17:28:22 -03:00
Jehan
f175004be3 Issue #15099: --no-interface mode broken on macOS. 2025-10-16 01:26:25 +02:00
Alx Sa
e224278517 app, modules: Resolve unused Windows variable warnings
This patch adds moves several variables that are not used
on Windows to #ifndef G_OS_WIN32 blocks to prevent
warnings on Windows builds.
2025-10-12 14:06:04 +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
Bruno Lopes
f9809354d5
Issue #14716: app: Set PATH to prevent DLL Hell on Windows
Closes: #14716

This ports the macOS trick to avoid loading binaries from the host.

SetDllDirectory (and its modern counterpart AddDllDirectory) are
not enough since we do not have control about all processes.
2025-08-20 16:51:21 -03:00
Jehan
8a6e9a4a3b app: get rid of build warning.
Fixes:

> app/main.c:1094:3: warning: format not a string literal and no format arguments [-Wformat-security]
2025-07-06 14:47:41 +02:00
Michael Natterer
6221bdb503 app, libgimp: minor whitespace and formatting cleanup 2025-07-05 12:58:03 +02:00
Bruno Lopes
d055c0fbd1
app: Do not create separate local data dir on macOS
Closes #13079

We don't know if ~/Library/Caches (NSCachesDirectory) is
the practical equivalent of $XDG_CACHE_HOME on Linux or
%LocalAppData% on Windows so let's just drop 3.00 for now.
2025-06-27 12:36:39 -03:00
Bruno Lopes
f8d54fe65a
app: Set LIBTHAI_DICTDIR on macOS bundle
In preparation for Infrastructure/gimp-macos-build!333

Also, explain why we are setting env vars since
setting env vars is usually runtime-pervasive.
2025-06-26 12:09:52 -03:00
Jehan
2244d70a94 Issue #13183: use the renamed desktop filename in Flatpak.
Since MR !2158, we set the desktop name as prgname, because that's what
is expected for Wayland. But this doesn't work on Flatpak where the
desktop file is renamed (and even to different names for the stable/beta
vs. nightly flatpaks). This commit adds some special-casing when we
detect we are inside a flatpak environment.

Note that on X11 (whether or not we are in flatpak), we just always use
the original desktop name, because then it will be set as windows'
WM_CLASS which will also match the StartupWMClass key we set in the
desktop file (cf. previous commit).
2025-06-12 02:31:36 +02:00
Integral
95e32ebb34 app: set a specific desktop filename to fix wayland window icon
Set a specific desktop filename to fix window icon under Wayland.

Closes: #13183
2025-05-17 13:24:20 +00:00
Bruno Lopes
e975c1625a meson, app, build: Fix Inno wrongly allowing to unninstall with GIMP running
Inno needs an AppMutex to be aware of GIMP execution so
prevent unninstalling or installing GIMP if still running.

(Unninstalling with GIMP running was making GIMP to not be
fully unninstaled since gimp*.exe process file was opened.
It also could cause problems with settings unninstall.)

(Installing with GIMP running was already not possible
since Inno code in that part is more refined but
that check isn't done before deleting .debug files)
2025-04-01 16:25:47 +00:00
Jehan
f6edf596bf app, libgimp: move gimp_env_init() to a non-shipped header.
Since we consider it private, yet it's still needed in libgimp and app,
let's at least put it in a private header because there is no need for
people to try it out.

I'm also editing a bit the annotations for gimp_main() and GIMP_MAIN().
2024-10-17 16:11:15 +02:00
Jehan
ee2f86105c app: move "System Language" out of GIMP_L10N_LANGS_SIZE.
This is the only "language" from the list whose name is special and
should be localized at runtime, yet before we set any Preferences
language. It needs to be localized as the System Language itself which
will be run-dependant.

For instance, if your system is in French, it will be displayed as
"Langue système" but if you change your system to Korean, at next run,
it would show "시스템 언어". It is a per-run localization, independant
from the language selected in Preferences, and even less dependant from
build-time system language.
2024-08-15 20:57:02 +02:00
Jacob Boerema
f78186e03b Get rid of old Windows specific defines
MINGW64
- uses 0x601 as value for _WIN32_WINNT. No need for us to define
it to that value or even lower values in some places.
This also gets rid of:  warning: "_WIN32_WINNT" redefined
- has 0x0502 for WINVER, so get rid of us setting it to 0x0500 in
gimp-app-test-utils.h. It also seems that the need to use G_OS_WIN32
has disappeared here.
- DIRECTINPUT_VERSION is 0x0800, no need for us to set it to that value.
- AI_ADDRCONFIG was apparently missing from the MINGW headers in the
past, but not anymore.
2024-01-24 12:10:00 -05:00
Idriss Fekir
e93e7a124c Improve text quality of UI on Windows
When using the default pangocairo backend (win32),
AA is not enabled.

Switching to the FontConfig backend fixes the problem.
2023-09-02 21:09:06 +00:00
Lukas Oberhuber
5ccac0dd9b macos: Remove DYLD_LIBRARY_PATH
Revert: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/561
2023-08-13 12:09:14 +00:00
Jehan
dc8ba756e4 app: debug menu and playground should be visible on non-releases stable branch.
These should be hidden on stable releases and shown on unstable branch. But
we'll also want to show these in the stable branch, outside of release
(typically when we'll be at 3.0.1).
2023-07-15 15:06:51 +02: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
Luca Bacci
005b3a05b8 Make use of the gimp_bind_text_domain () util function 2023-01-24 14:48:44 +00:00
Luca Bacci
db570de3b2 Use SetDllDirectoryW ()
No need to use GetProcAddress (), SetDllDirectory () is available
since XP SP1
2023-01-24 14:48:44 +00:00
Luca Bacci
ed1e4236ba Use GetModuleHandleW ()
Also fix an unwanted ref-count increment on a module HANDLE
2023-01-24 14:48:44 +00:00
Luca Bacci
c98ffb7e0e Replace uses of plain fopen () with GLib's g_fopen ()
On Windows fopen () is limited to the current codepage,
GLib's g_fopen () instead accepts full UTF-8 by calling
_wfopen () internally (or a similar wide-char CRT routine).
2023-01-24 14:48:44 +00:00
Luca Bacci
0657b85202 Use GLib to convert between UTF-8 and UTF-16 2023-01-24 14:48:44 +00:00
Lukas Oberhuber
e62f00ad4e macos: support MacPorts
This provides MacPorts support which is now the official way that
the MacOS port is built and packaged.
2022-11-22 14:36:22 +00:00
Lukas Oberhuber
271435534f macos: support for homebrew build
Supports running gimp in homebrew builds which have more complex
structures of where things are placed.
2022-07-27 17:06:21 +00:00
Jehan
5831f5ef4e app: when called with --quit, GIMP exit code will report batch failure.
If you call GIMP with batch commands and ask it to quit immediately, you
are likely interested by failure information. For this reason, let's now
report exit code other than success, but only in such case. In
particular, even if the batch commands fail, but GIMP is not set to exit
immediately, we continue reporting SUCCESS run at the very end (when
exiting interactively).

Note that I hardcode a few exit values, as standardly found on Linux
(but not using headers which may not be found on all platforms; in
particular, Windows apparently doesn't use any standard code other than
0 for success, from what my searches return).

Additionally, when several commands are requested, GIMP will now stop at
the first failing and will return its error code, and print a message on
stderr to easily report the failed command for easier debugging.
2022-04-16 02:30:46 +02:00
Jehan
028210369a app: add a new --quit CLI option to quit GIMP after a batch script.
Instead of asking for the script to call gimp_quit() which is not too
proper (because this is actually meant to exit the script, not GIMP
itself. Scripts should not have the ability to basically kill the main
GIMP process), let's add a `--quit` option which does what it says: it
quits GIMP immediately (after having processed any task on command line,
such as running batch scripts).

See discussions in issue #7376.
2022-04-16 01:40:17 +02:00
Lukas Oberhuber
ce90cc28a1 macos: support python plugins in meson
This change makes sure that plugins can load when gimp is built with
meson. This is because .typelibs and .gir files do not have full library
paths when build using meson (this is different from autotools).
2022-01-24 02:12:22 +00:00
Lukas Oberhuber
41ff82acbf macos: style cleanup in gimp wrapper code 2021-12-22 12:59:06 +00:00