<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
On Wednesday, February 17, 2021 3:07 PM, Jehan Pagès <jehan.marmottard@gmail.com> wrote:</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div>
<div dir="ltr">
<div class="x_gmail_quote">
<blockquote style="margin-top:0;margin-bottom:0">
<div dir="ltr" class="x_gmail_attr">On Wed, Feb 17, 2021 at 8:26 PM Thomas Kluyver <<a href="mailto:thomas@kluyver.me.uk" target="_blank">thomas@kluyver.me.uk</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<u></u>
<div>
<div><br>
</div>
<div>This particular user reports that *updating* GIMP causes the file association to change. That definitely seems like a bug: I can understand that someone might want a newly installed app to take over from the previous default, but updating shouldn't affect
it.<br>
</div>
<div><br>
</div>
<div>Reading the EndeavourOS thread about it, I think what's happening is that, with no default application set, something takes the first application listed in a mimeinfo.cache file as the default. It seems like an obvious thing to do. But the man page for
update-desktop-database (which generates that file) is clear that you shouldn't:<br>
</div>
<div><br>
</div>
<div>> The order of the desktop files found for a MIME type is not significant. Therefore, an external mechanism must be used to determine what is the preferred desktop file for a MIME type.<br>
</div>
<div><br>
</div>
<div>The order of applications in that file is not even currently stable (<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fxdg%2Fdesktop-file-utils%2F-%2Fissues%2F3&data=04%7C01%7CJohn.Bollinger%40stjude.org%7C0f3e504767e54a34d9cf08d8d388195d%7C22340fa892264871b677d3b3e377af72%7C0%7C1%7C637491928785163963%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=TMPW8VRUDxnv9GJN1q04qUaXUHZmT0EPhTQ5ig5KPrM%3D&reserved=0" originalsrc="https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/3" shash="sEEcsDq3Uvf8YICx6QhGOHqe0Y/Ecg+q9kb8QlkBYuoObvJnNlzzPAy12tkCItqvp/Au1zl6Vsp1CwJRpeL5ttIPaV/Gh0q4mrOWVKgyEO4WUnP2mVIpCTnAzIoRS+Bzi5eH0HkMZXcgSTU3r04FCqPwi3K9uIvEPzmVUrZ1fvk=" target="_blank">https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/3</a>),
so each time it's regenerated you could get a different application. But simply sorting them would probably put gimp before gwenview, so it wouldn't have the result that user wants.<br>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>There is also something which I am not fond of with the order depending on a shared database: we must agree on an order which might not be fair. Say 2 applications are on the exact same action fields, i.e. they both work on the same file formats (for instance
JPEG, PNG for image viewers). If the defaults depend on this shared database, then the same one will consistently be the default image viewer shadowing (if installed) all the others. Be it based on character order (then you'd want to just name your app "aaa")
or just whatever the database maintainer prefer for oneself, it's not right.</div>
</blockquote>
<div><br>
</div>
<div>Well yes, that's part of the reason why the specifications explicitly say that the mime-info database should not be used for choosing default applications. But I suppose that in the event that there is no other viable basis for a decision, it provides
a last-ditch alternative.</div>
<blockquote style="margin-top:0;margin-bottom:0">
<div><br>
</div>
<div>On the other hand, when no order is specified centrally, but each software is able to tell its intent "I'm made to display JPEG, PNG…" without specifying priority relatively to other software, at least we can go with fairer algorithm (something not based
on an arbitrary choice making a strict order). Be it "last installed" or "keeping stability to whatever was here first" (then it will likely be dependent on your desktop choice during install, and distrib maintainers, at least not the same on all distributions).</div>
</blockquote>
<div><br>
</div>
<div>Both of those specific approaches (preferring the most recently or least recently installed) can be supported by the XDG MIME Applications specification and existing software based on that. I described how it could be done in a previous message. That
would, however, require software providers and / or packagers to opt in, either by directly modifying the appropriate mimeapps.list file as part of their installation process or by invoking some standard agent to do so on their behalf. It would be preferable
to use an agent, as that would support applying the chosen approach consistently. Possibly desktop-file-install could be given the responsibility.</div>
<div><br>
</div>
<div>That's still mediated by central (and per-user) files, however, so I'm uncertain whether you would consider it "specified centrally", which you seem to be advocating against. If you disfavor it on that basis then I'm curious what kind of alternative you
have in mind.</div>
<div><br>
</div>
<div><br>
</div>
<div>John</div>
<div><br>
</div>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="2"><br>
Email Disclaimer: www.stjude.org/emaildisclaimer<br>
Consultation Disclaimer: www.stjude.org/consultationdisclaimer<br>
</font>
</body>
</html>