diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c index c19da3ba8..00c3f2489 100644 --- a/gio/glocalfilemonitor.c +++ b/gio/glocalfilemonitor.c @@ -832,6 +832,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; @@ -841,7 +842,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)); @@ -867,7 +869,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 ()); @@ -888,7 +890,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) {