[gvfs] recent: Fix crashes when DISPLAY is not set
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] recent: Fix crashes when DISPLAY is not set
- Date: Thu, 15 Dec 2016 16:15:57 +0000 (UTC)
commit 6883981a14fbe512815783a2966f2a8a0149034f
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 1200040..ad75e2a 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]