1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

macos plugins: Improves dock icon flashing from #12150

This means additional icons don't stick around. However, this is the easy workaround to turning everything into a proper plugin with .plist files.
This commit is contained in:
Lukas Oberhuber
2025-09-20 00:10:06 +01:00
parent 17b23b6f26
commit 06bcef3273
3 changed files with 27 additions and 12 deletions

View File

@@ -80,6 +80,10 @@
# undef RGB
#endif
#ifdef GDK_WINDOWING_QUARTZ
#include <Cocoa/Cocoa.h>
#endif
#include <locale.h>
#include "gimp.h"
@@ -354,6 +358,14 @@ gimp_main (GType plug_in_type,
#endif /* G_OS_WIN32 */
#ifdef GDK_WINDOWING_QUARTZ
/* Sets activation policy to prevent plugins from appearing as separate apps
* in Dock.
* Makes plugins behave as helper processes of GIMP on macOS.
*/
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
#endif
g_assert (plug_in_type != G_TYPE_NONE);
if ((argc != N_ARGS) || (strcmp (argv[ARG_GIMP], "-gimp") != 0))

View File

@@ -129,6 +129,14 @@ gimp_ui_init (const gchar *prog_name)
#endif
}
#ifdef GDK_WINDOWING_QUARTZ
/* Sets activation policy to prevent plugins from appearing as separate apps
* in Dock.
* Makes plugins behave as helper processes of GIMP on macOS.
*/
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
#endif
if (gimp_user_time ())
{
/* Construct a fake startup ID as we only want to pass the

View File

@@ -187,6 +187,13 @@ sf_dialog_run (GimpProcedure *procedure,
dump_objects (config);
#endif
#ifdef GDK_WINDOWING_QUARTZ
/* Ensure this process doesn't appear in Dock as separate app.
* Set as accessory (helper) app instead of regular app.
*/
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
#endif
/* Create a dialog having properties (describing arguments of the procedure)
* taken from the config.
*
@@ -217,10 +224,6 @@ sf_dialog_run (GimpProcedure *procedure,
}
#ifdef GDK_WINDOWING_QUARTZ
/* Make the Dock icon appear.
* The dialog does not stay in front, so user needs Dock menu item "Show."
*/
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
/* The user chose a plugin from gimp app, now ensure this process is active.
* The gimp app was active, but now the plugin should be active.
@@ -271,10 +274,6 @@ script_fu_dialog_run_image_proc (
else
result = gimp_procedure_new_return_values (procedure, GIMP_PDB_CANCEL, NULL);
#ifdef GDK_WINDOWING_QUARTZ
/* Make dock icon go away. */
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
#endif
return result;
}
@@ -301,10 +300,6 @@ script_fu_dialog_run_regular_proc (GimpProcedure *procedure,
else
result = gimp_procedure_new_return_values (procedure, GIMP_PDB_CANCEL, NULL);
#ifdef GDK_WINDOWING_QUARTZ
/* Make dock icon go away. */
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
#endif
return result;
}