[gvfs/gnome-3-22] recent: Fix crashes when DISPLAY is not set



commit 325e45c137f25fe57ea2eaf06461c86d659e58e6
Author: Ondrej Holy <oholy redhat com>
Date:   Tue Dec 13 08:43:48 2016 +0100

    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

 daemon/gvfsbackendrecent.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendrecent.c b/daemon/gvfsbackendrecent.c
index 7db60cf..f1dce2e 100644
--- a/daemon/gvfsbackendrecent.c
+++ b/daemon/gvfsbackendrecent.c
@@ -691,8 +691,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");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]