app: allow gimp command-line to run in console mode

When non-interactive mode is requested (the -i command-line flag),
_and_ we've compiled the app with UI support enabled, allow `gimp`
to branch into the console-based version of the app -- equivalent to
running it using `gimp-console`.

This avoids GTK-related failures open a display when one is not
not available (for example, when running `gimp` within a container
or a VM without a graphical display).
This commit is contained in:
James Addison 2025-01-28 00:47:50 +00:00 committed by Jehan
parent ecd47d3d23
commit ea0574b86c

View file

@ -242,7 +242,14 @@ app_run (const gchar *full_prog_name,
g_clear_object (&default_folder);
#ifndef GIMP_CONSOLE_COMPILATION
app = gimp_app_new (gimp, no_splash, quit, as_new, filenames, batch_interpreter, batch_commands);
if (no_interface)
{
app = gimp_console_app_new (gimp, quit, as_new, filenames, batch_interpreter, batch_commands);
}
else
{
app = gimp_app_new (gimp, no_splash, quit, as_new, filenames, batch_interpreter, batch_commands);
}
#else
app = gimp_console_app_new (gimp, quit, as_new, filenames, batch_interpreter, batch_commands);
#endif