diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c index 629ec018..d0f2a496 100644 --- a/thunar/thunar-gio-extensions.c +++ b/thunar/thunar-gio-extensions.c @@ -552,6 +552,8 @@ thunar_g_app_info_launch (GAppInfo *info, GError **error) { ThunarFile *file; + GAppInfo *default_app; + GList *list; GList *lp; const gchar *content_type; gboolean result = FALSE; @@ -592,11 +594,21 @@ thunar_g_app_info_launch (GAppInfo *info, { content_type = thunar_file_get_content_type (file); - /* emit "changed" on the file if we successfully changed the last used application */ - if (g_app_info_set_as_last_used_for_type (info, content_type, NULL)) - thunar_file_changed (file); + default_app = thunar_file_get_default_handler (file); + list = g_app_info_get_recommended_for_type (content_type); + + /* skip if the application is already the default or recommended one */ + if (!g_app_info_equal (info, default_app) + && !g_app_info_equal (info, list->data)) + { + /* emit "changed" on the file if we successfully changed the last used application */ + if (g_app_info_set_as_last_used_for_type (info, content_type, NULL)) + thunar_file_changed (file); + } g_object_unref (file); + g_object_unref (default_app); + g_list_free (list); } } }