GNOME Bugzilla – Bug 667138
Preferred applications display gedit as calendar
Last modified: 2018-05-02 15:16:57 UTC
Evolution and Thunderbird aren't installed. Monthly calendar view in indicator-datetime can be en- or disabled. Open g-c-c, system-information (renamed to 'Details' gnome-bugs 661696), click on preferred applications, the value for calendar is 'gedit'. Expected: Leave the value empty or recognize other calendar apps, e.g. Osmo. First reported there. https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/910872
Correction, above LP bug is a dupe, the first one reported is there. https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/841409
You can see the list of recommended and all available applications to handle a particular mime-type (text/calendar) for the case of a calendar using: gvfs-mime --query text/calendar (after that commit: http://git.gnome.org/browse/gvfs/commit/?id=6f485b42a7172e3604ea0eec937bbe0553a76db5) If you see gedit.desktop listed in the recommended applications then it's a bug in the gedit package. (In reply to comment #0) <snip> > Leave the value empty or recognize other calendar apps, e.g. Osmo. They just need to advertise text/calendar as a supported type.
Bastien, isn't that issue the same than bug #661659 "> calendar: gedit (?!) text/calendar is a subclass of text/plain, which is why gedit would be handling it. I suspect that there is a bug in the app chooser combo box. I requested the output of: gvfs-mime --query text/calendar which should show whether evolution is an option. Might be missing a desktop mime update in the evo package? ... gvfs-mime --query text/calendar Default application for 'text/calendar': gedit.desktop Registered applications: gedit.desktop evolution.desktop" if you remove evolution and install tb you get actually no calendar and that combo should probably be unactive rather that listing gedit but that's corner case...
(In reply to comment #3) > Bastien, isn't that issue the same than bug #661659 Pretty much > "> calendar: gedit (?!) > > text/calendar is a subclass of text/plain, which is why gedit would be handling > it. I suspect that there is a bug in the app chooser combo box. No. The app chooser button we use calls g_app_info_get_recommended_for_type("text/calendar") which is defined as: " Gets a list of recommended GAppInfos for a given content type, i.e. those applications which claim to support the given content type exactly, and not by MIME type subclassing. Note that the first application of the list is the last used one, i.e. the last one for which g_app_info_set_as_last_used_for_type has been called. " > > I requested the output of: > gvfs-mime --query text/calendar > > which should show whether evolution is an option. Might be missing a desktop > mime update in the evo package? > ... > gvfs-mime --query text/calendar > Default application for 'text/calendar': gedit.desktop > Registered applications: > gedit.desktop > evolution.desktop" Missing the patch I mentioned above to list the recommended apps. The recommended apps is all that's shown. > if you remove evolution and install tb you get actually no calendar and that > combo should probably be unactive rather that listing gedit but that's corner > case... In any case, it's not a bug in gnome-control-center, or the app chooser.
on my GNOME 3.2 system with the gvfs patch to get the infos: "$ ./gvfs-mime --query text/calendar Default application for 'text/calendar': evolution.desktop Registered applications: evolution.desktop gedit.desktop gobby-0.5.desktop" the g-c-c combo lists evolution and gedit as calendar choices, evolution being the default one
sorry copied the wrong output: $ ./gvfs-mime --query text/calendar Default application for 'text/calendar': evolution.desktop Registered applications: evolution.desktop gedit.desktop gobby-0.5.desktop Recommended applications: evolution.desktop gedit.desktop
Ok some details: - the "recommended" gedit was coming from .local/share/applications/mimeapps.list, probably written by an old version of g-c-c,glib before the fixes that went in 3.2 (it was added to the add applications section - we have in Ubuntu a bug similar to the one you fixed in fedora (evolution is not set as default for the text/calendar type in defaults.list) - if you have no default set for the type and run gnome-control-center dialog "gedit" is listed and selected by default, when that happens "$ ./gvfs-mime --query text/calendar Default application for 'text/calendar': gedit.desktop Registered applications: gedit.desktop evolution.desktop gobby-0.5.desktop Recommended applications: evolution.desktop" gedit is not listed in the recommended applications - if you select evolution, close the dialog and go back only evolution is listed so the bug seems to happen only when evolution is not set as default in defaults.list
ok, another set of infos: if you move evolution.desktop away from the xdg path: $ ./gvfs-mime --query text/calendar Default application for 'text/calendar': gedit.desktop Registered applications: gedit.desktop gobby-0.5.desktop then open g-c-c info, gedit is listed in the combo (and only it) then if gedit.desktop is moved away gobby is listed
Outputs in Oneiric and Precise are the same: ~$ gvfs-mime --query text/calendar Default application for 'text/calendar': gedit.desktop Registered applications: gedit.desktop Same with: ~$ xdg-mime query default text/plain gedit.desktop The /etc/gnome/defaults.list doesn't content calendar or evolution. It contents (among others): text/plain=gedit.desktop x-scheme-handler/mailto=thunderbird.desktop In Oneirc the ~/.local/share/applications/mimeapps.list only contents: [Added Associations] application/x-shellscript=gedit.desktop; application/x-trash=gedit.desktop; text/css=gedit.desktop; text/plain=gedit.desktop; In Precise it contents among others: text/calendar=gedit.desktop;evolution.desktop; Removing gedit.desktop makes no change in g-c-c. Who does register gedit as calendar, gedit itself?
The problem is that gtkappchooserbutton.c adds the recommended apps, as well as the default app. The recommended apps are the ones that match text/calendar exactly. The problem comes when adding the default app with g_app_info_get_default_for_type() which will also look in the sub-classes for a match, as evolution isn't available. We want the default app being shown, but only if it's explicitely set, and it matches exactly the content type. So, in gtkappchooserbutton.c's gtk_app_chooser_button_populate(), we would only add default_app to the popup if it's listed in recommended_apps). Cosimo, opinion?
(In reply to comment #10) > The problem comes when adding the default app with > g_app_info_get_default_for_type() which will also look in the sub-classes for a > match, as evolution isn't available. We want the default app being shown, but > only if it's explicitely set, and it matches exactly the content type. > > So, in gtkappchooserbutton.c's gtk_app_chooser_button_populate(), we would only > add default_app to the popup if it's listed in recommended_apps). Yeah, this makes sense to me and would fix the bug. We should still make sure to display something meaningful in the combobox even in the case where there are no recommended apps available though (maybe making the combobox insensitive with a "No applications available" string?)
I can confirm that the bug is still here.
Why this bug is still not fixed (after five years)? You won't find bugs like this in MacOS or Microsoft Windows. Unity has also inherited this bug: https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/841409 Please fix this bug ASAP. Thank you!
(In reply to Eino Väisänen from comment #13) > Please fix this bug ASAP. I'm afraid open source is now a case of ordering people to do what you want. > Why this bug is still not fixed (after five years)? Because no one has written a patch that fixes it. There are plenty of directions above, though, if you'd like to try fixing it before anyone else does. Note that bugs are many and complex, and developers are few and busy. Not all of them can be fixed; that's just physics. > You won't find bugs like this in MacOS or Microsoft Windows But you'll find different ones, and not have the option to edit the source code yourself. So it's swings and roundabouts.
(In reply to Daniel Boles from comment #14) > (In reply to Eino Väisänen from comment #13) > > Please fix this bug ASAP. > > I'm afraid open source is now a case of ordering people to do what you want. LOL, I meant 'not', but I guess that works too, sarcastically.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/377.