GNOME Bugzilla – Bug 768410
Does not display font preview when launched from xdg-open
Last modified: 2016-07-13 06:58:24 UTC
Created attachment 330864 [details] empty window If I run `xdg-open some-font.ttf` then the font is not displayed in the gnome-font-viewer window, and the following message is printed to the console: (gvfs-open:32339): GLib-GIO-CRITICAL **: g_dbus_connection_call_sync_internal: assertion 'object_path != NULL && g_variant_is_object_path (object_path)' failed
-> gvfs This is an issue in the patch that was committed to gvfs for bug 746534. The logic in gvfs-open replaces dots (invalid in a DBus object path) with slashes, but differently from what GApplication also does, it fails to replace dashes (another invalid character in a DBus object path) with underscores.
Created attachment 331032 [details] [review] gvfs-open: also replace dashes when computing object path This is what GApplication does, and we should do it here too, or gvfs-open won't work for DBus-activatable applications with dashses in their app IDs.
Review of attachment 331032 [details] [review]: grr, the hack spreads :-(
Yeah, not happy about this either, but the current logic is broken. Should I push this to master?
not a gvfs maintainer, but imo: yes
Review of attachment 331032 [details] [review]: Thanks, looks good! ::: programs/gvfs-open.c @@ +95,3 @@ + else if (*p == '-') + *p = '_'; + } Maybe it would be good to add something like: if (!g_variant_is_object_path (object_path)) { g_warning ("Invalid object path \"%s\"", object_path); g_free (object_path); goto out; }
Created attachment 331229 [details] [review] gvfs-open: also replace dashes when computing object path -- Good idea -- here's an updated patch.
Review of attachment 331229 [details] [review]: Thanks! Please push it for stable branches also...
Attachment 331229 [details] pushed as ad689cc - gvfs-open: also replace dashes when computing object path
Cherry-picked into stable branches: gnome-3-20 as b7e9b31, gnome-3-18 as eb7986b and gnome-3-16 as 48877cb.