From 5bfb153c8474bbcecc8e4f4e4e5d4b9d1e4bb802 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 2 Apr 2015 12:29:47 -0400 Subject: [PATCH] mime apps: clarify precedence vs. subtypes Clarify that we always prefer specific subtypes (like text/html) to the more generic types (like text/plain) when deciding on associations and default apps. This avoids some strange cases where applications that operate on text/plain are being taken in preference to more-specific applications, just because they are present in 'higher' directories, or explicitly listed in defaults files. https://bugs.freedesktop.org/show_bug.cgi?id=89877 --- mime-apps/mime-apps-spec.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mime-apps/mime-apps-spec.xml b/mime-apps/mime-apps-spec.xml index d61214b..b1cd543 100644 --- a/mime-apps/mime-apps-spec.xml +++ b/mime-apps/mime-apps-spec.xml @@ -96,6 +96,7 @@ mimetype1=foo5.desktop; add to the blacklist the names of any desktop files found in the same directory as the mimeapps.list file (which for directories based on XDG_CONFIG_HOME and XDG_CONFIG_DIRS, is none) repeat the last four steps for each subsequent directory + The above process is repeated for each mimetype from the most specific to the least specific. Note in particular that an application "Added" with a more specific mime type will keep that association, even if it is "Removed" in a higher-precedence directory, using a less specific type. Default Application @@ -117,6 +118,7 @@ mimetype1=default1.desktop;default2.desktop; if after all list items are handled, we have not yet found a default application, proceed to the next mimeapps.list file in the search order and repeat if after all files are handled, we have not yet found a default application, select the most-preferred application (according to associations) that supports the type + The above process is repeated for each mimetype from the most specific to the least specific. Note in particular that an application that can handle a more specific type will be used in preference to an application explicitly marked as the default for a less-specific type. Note that, unlike adding and removing associations, a desktop ID set as the default for an application can refer to a desktop file of the same name found in a directory of higher precedence. Note as well that the default application for a given type must be an application that is associated with the type. This means that implementations should either ensure that such an association exists or add one explicitly when setting an application as the default for a type. -- 2.1.4