summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2016-12-13 08:43:48 +0100
committerOndrej Holy <oholy@redhat.com>2016-12-15 17:00:58 +0100
commit560cf509ab554ee9d15985e71a090f7d8eccdf37 (patch)
tree5ea02cb9271dfb988b26bb5acf45afcd0cb15bc6
parentcf92ab0283176d87cfb398c506ceaec852ca2242 (diff)
downloadgvfs-560cf509ab554ee9d15985e71a090f7d8eccdf37.tar.gz
recent: Fix crashes when DISPLAY is not set
Recent backend is based on GtkRecentManager and calls gtk_init. Unfortunatelly, gtk_init aborts with "cannot open display: " warning if DISPLAY variable is not set. It happens e.g. when recent backend is spawned from a terminal without a graphical session. Systemd user units make this even worse and this happens also in graphical session if gvfs was running before the graphical session starts... Let's remove gtk_init call. It seems that GtkRecentManager works properly without it, because the display isn't really needed for it. https://bugzilla.gnome.org/show_bug.cgi?id=773300
-rw-r--r--daemon/gvfsbackendrecent.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/daemon/gvfsbackendrecent.c b/daemon/gvfsbackendrecent.c
index 24d91a41..58d03518 100644
--- a/daemon/gvfsbackendrecent.c
+++ b/daemon/gvfsbackendrecent.c
@@ -688,8 +688,6 @@ g_vfs_backend_recent_init (GVfsBackendRecent *backend)
backend->items = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)recent_item_free);
backend->uri_map = g_hash_table_new (g_str_hash, g_str_equal);
- gtk_init (NULL, NULL);
-
/* translators: This is the name of the backend */
g_vfs_backend_set_display_name (vfs_backend, _("Recent"));
g_vfs_backend_set_icon_name (vfs_backend, "document-open-recent");