diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c index 7b0a82439..8a4c4ec43 100644 --- a/gio/glocalfilemonitor.c +++ b/gio/glocalfilemonitor.c @@ -834,6 +834,7 @@ static void g_local_file_monitor_class_init (GLocalFileMonitorClass *class) static GLocalFileMonitor * g_local_file_monitor_new (gboolean is_remote_fs, + gboolean is_directory, GError **error) { GType type = G_TYPE_INVALID; @@ -843,7 +844,8 @@ g_local_file_monitor_new (gboolean is_remote_fs, "GIO_USE_FILE_MONITOR", G_STRUCT_OFFSET (GLocalFileMonitorClass, is_supported)); - if (type == G_TYPE_INVALID) + /* Fallback rather to poll file monitor for remote files, see gfile.c. */ + if (type == G_TYPE_INVALID && (!is_remote_fs || is_directory)) type = _g_io_module_get_default_type (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME, "GIO_USE_FILE_MONITOR", G_STRUCT_OFFSET (GLocalFileMonitorClass, is_supported)); @@ -869,7 +871,7 @@ g_local_file_monitor_new_for_path (const gchar *pathname, is_remote_fs = g_local_file_is_remote (pathname); - monitor = g_local_file_monitor_new (is_remote_fs, error); + monitor = g_local_file_monitor_new (is_remote_fs, is_directory, error); if (monitor) g_local_file_monitor_start (monitor, pathname, is_directory, flags, g_main_context_get_thread_default ()); @@ -890,7 +892,7 @@ g_local_file_monitor_new_in_worker (const gchar *pathname, is_remote_fs = g_local_file_is_remote (pathname); - monitor = g_local_file_monitor_new (is_remote_fs, error); + monitor = g_local_file_monitor_new (is_remote_fs, is_directory, error); if (monitor) {