From 41259ac173143fbb06bc07dab80fbe06493716df Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Sun, 3 Jun 2018 12:15:36 +0800 Subject: [PATCH] kqueue: Only fallback to polling on /media and /run/media The check in _ke_is_excluded, which causes GKqueueFileMonitor to fallback to GPollFileMonitor when it returns TRUE, was made to prevent file monitor from blocking unmount of removable drives on systems not supporting O_EVTONLY flag in open. However, since g_mount_can_unmount always returns TRUE on Unix-like platforms, the check always returns TRUE on non-standard mount points, which is very likely to cause all programs on the desktop to use the polling fallback if GNOME is installed in a different prefix for development. This makes the desktop sluggish and results in bad developer experience on *BSD. --- gio/kqueue/gkqueuefilemonitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/kqueue/gkqueuefilemonitor.c b/gio/kqueue/gkqueuefilemonitor.c index d6fea41cf..9cf3901f5 100644 --- a/gio/kqueue/gkqueuefilemonitor.c +++ b/gio/kqueue/gkqueuefilemonitor.c @@ -121,7 +121,7 @@ _ke_is_excluded (const char *full_path) g_object_unref (f); } - if ((mount != NULL && (g_mount_can_unmount (mount))) || g_str_has_prefix (full_path, "/mnt/")) + if (mount != NULL && (g_str_has_prefix (full_path, "/media/") || g_str_has_prefix (full_path, "/run/media/"))) { g_warning ("Excluding %s from kernel notification, falling back to poll", full_path); if (mount)