From: Corey Berla Date: Mon, 15 May 2023 20:10:21 +0000 (-0700) Subject: filesystemmodel: Ignore changes on the parent directory X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~256^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=133231e12b995202627a227a32acb26627a6cec4;p=gtk4.git filesystemmodel: Ignore changes on the parent directory The filesystemmodel tracks changes and additions to child files through G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED. This event will also occur if the parent directory is changed. Since the parent directory doesn't exist in the model, it creates a non-existent item. Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4233 --- diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index a772d67aa6..10c5ec09bc 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -747,7 +747,9 @@ gtk_file_system_model_monitor_change (GFileMonitor * monitor, case G_FILE_MONITOR_EVENT_CREATED: case G_FILE_MONITOR_EVENT_CHANGED: case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: - /* We can treat all of these the same way */ + if (g_file_equal (file, model->dir)) + return; + /* We can treat all children the same way */ g_file_query_info_async (file, model->attributes, G_FILE_QUERY_INFO_NONE,