[Github-comments] [geany/geany] Read default browser command using GIO (#2444)

Enrico Tröger notifications at xxxxx
Thu Feb 20 18:59:22 UTC 2020


While debugging #2405, I stumbled upon `g_app_info_get_default_for_uri_scheme` and noticed we can use it to query the default browser from the system and so do not need to use hard-coded defaults. Even though the hard-coded ones are still used if the GIO-based lookup fails.

I think this would be more user friendly than just having "firefox" or "open safari" which might not work for all users or might not what they have configured in their system.

For existing users, this change won't have any implications as it is used only for new configurations.
For Linux and Mac(see below) users, there should be no degrade in functionality due to the fallback.
For Windows users, we use the default browser command now and not the fixed `ShellExecute` variant any longer which was not configurable for users and is broken for URLs with anchors which we use in the preferences dialog. So Windows users will benefit most from this change.

There is a little chance of getting a bad or non-working default comand if the executable returned by 
`g_app_info_get_default_for_uri_scheme` does not work. I don't know if this can ever happen and if so, if it is worse than the previous behavior.

Things left to do:
- test if this works at all on MacOS (@techee?)
- test this on various Linux boxes (so far I tested it on ArchLinux+Xfce+Firefox)
- test this on Windows

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2444#issuecomment-589253208
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200220/a438a0ff/attachment.htm>


More information about the Github-comments mailing list