From ab620151c57cb163aa2decff8532362ba0fe8b24 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 6 Nov 2025 20:08:53 +0000 Subject: [PATCH] core: Workaround for link layer monitoring on Windows As of GLib 2.86.1-1, GFileMonitors created with the G_FILE_MONITOR_WATCH_HARD_LINKS flag are not monitored on Windows. This means that link layers will not automatically update when the external source is edited. We will temporarily use the G_FILE_MONITOR_NONE flag on Windows until this is resolved --- app/core/gimplink.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/core/gimplink.c b/app/core/gimplink.c index 5dd15a828e..a674097e21 100644 --- a/app/core/gimplink.c +++ b/app/core/gimplink.c @@ -369,9 +369,17 @@ gimp_link_update_buffer (GimpLink *link, static void gimp_link_start_monitoring (GimpLink *link) { - link->p->monitor = g_file_monitor_file (link->p->file, - G_FILE_MONITOR_WATCH_HARD_LINKS, - NULL, NULL); + /* TODO: As of GLib 2.86.1-1, GFileMonitors created with the + * G_FILE_MONITOR_WATCH_HARD_LINKS flag are not monitored on Windows. + * We will temporarily use the G_FILE_MONITOR_NONE flag on Windows until + * this is resolved */ + link->p->monitor = g_file_monitor (link->p->file, +#ifdef G_OS_WIN32 + G_FILE_MONITOR_NONE, +#else + G_FILE_MONITOR_WATCH_HARD_LINKS, +#endif + NULL, NULL); g_signal_connect (link->p->monitor, "changed", G_CALLBACK (gimp_link_file_changed), link);