From c25dd4e7392b2bfa21df12ca68935bc742edc3ea Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 12 Jan 2023 18:34:12 +0100 Subject: [PATCH] app: add a comment to complete !808. It is better to add a comment rather than simply disabling these 2 calls without explanation on macOS. This way, developers who'll look at this code in the future will immediately know what's the reason and status for the "unicity" concept of GIMP process on macOS. Basically there are 3 features: - Opening files from another software (such as "open with" in file browsers) which is handled differently in macOS and apparently works fine. It looks like it works by handling system signals, connected from gui_unique_quartz_init(). - Opening files by running a new GIMP process which would pipe the filenames into an existing GIMP process before immediately exiting. - Running batch process in an existing GIMP process, also by running a short-run GIMP process. The last 2 features are simply now officially disabled in macOS because dbus is not installed by default and seem like it may cause issues when it is. See discussions in !808 and #8997. (cherry picked from commit 68cd8734811d09fb8f668f28787494bd15fc6cd5) --- app/unique.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/unique.c b/app/unique.c index 59626cc3d6..28e5caa89f 100644 --- a/app/unique.c +++ b/app/unique.c @@ -49,6 +49,13 @@ gimp_unique_open (const gchar **filenames, #ifdef G_OS_WIN32 return gimp_unique_win32_open (filenames, as_new); #elif defined (PLATFORM_OSX) + /* Opening files through "Open with" from other software is likely handled + * instead by gui_unique_quartz_init() by gtkosx signal handling. + * + * Opening files through command lines will always create new process, because + * dbus is usually not installed by default on macOS (and when it is, it may + * not work properly). See !808 and #8997. + */ return FALSE; #else return gimp_unique_dbus_open (filenames, as_new); @@ -63,6 +70,10 @@ gimp_unique_batch_run (const gchar *batch_interpreter, g_printerr ("Batch commands cannot be run in existing instance in Win32.\n"); return FALSE; #elif defined (PLATFORM_OSX) + /* Running batch commands through command lines will always run in the new + * process, because dbus is usually not installed by default on macOS (and + * when it is, it may not work properly). See !808 and #8997. + */ return FALSE; #else return gimp_unique_dbus_batch_run (batch_interpreter,