|
|
14e627 |
From 21089ece16e22808bd95da559f2a8da1d7adce40 Mon Sep 17 00:00:00 2001
|
|
|
14e627 |
From: Matthias Clasen <mclasen@redhat.com>
|
|
|
14e627 |
Date: Thu, 18 Dec 2014 23:26:53 -0500
|
|
|
14e627 |
Subject: [PATCH] Export the session bus ID as an xsetting
|
|
|
14e627 |
|
|
|
14e627 |
This will allow GTK+ to detect ssh forwarded display situations
|
|
|
14e627 |
where app menus won't work, and handle it better.
|
|
|
14e627 |
|
|
|
14e627 |
https://bugzilla.gnome.org/show_bug.cgi?id=741740
|
|
|
14e627 |
---
|
|
|
14e627 |
plugins/xsettings/gsd-xsettings-manager.c | 32 +++++++++++++++++++++++++++++++
|
|
|
14e627 |
1 file changed, 32 insertions(+)
|
|
|
14e627 |
|
|
|
14e627 |
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
|
|
|
14e627 |
index 489021c..1ec4e08 100644
|
|
|
14e627 |
--- a/plugins/xsettings/gsd-xsettings-manager.c
|
|
|
14e627 |
+++ b/plugins/xsettings/gsd-xsettings-manager.c
|
|
|
14e627 |
@@ -378,6 +378,37 @@ fixed_true_int (GnomeXSettingsManager *manager,
|
|
|
14e627 |
xsettings_manager_set_int (manager->priv->manager, fixed->xsetting_name, TRUE);
|
|
|
14e627 |
}
|
|
|
14e627 |
|
|
|
14e627 |
+static void
|
|
|
14e627 |
+fixed_bus_id (GnomeXSettingsManager *manager,
|
|
|
14e627 |
+ FixedEntry *fixed)
|
|
|
14e627 |
+{
|
|
|
14e627 |
+ const gchar *id;
|
|
|
14e627 |
+ GDBusConnection *bus;
|
|
|
14e627 |
+ GVariant *res;
|
|
|
14e627 |
+
|
|
|
14e627 |
+ bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
|
|
14e627 |
+ res = g_dbus_connection_call_sync (bus,
|
|
|
14e627 |
+ "org.freedesktop.DBus",
|
|
|
14e627 |
+ "/org/freedesktop/DBus",
|
|
|
14e627 |
+ "org.freedesktop.DBus",
|
|
|
14e627 |
+ "GetId",
|
|
|
14e627 |
+ NULL,
|
|
|
14e627 |
+ NULL,
|
|
|
14e627 |
+ G_DBUS_CALL_FLAGS_NONE,
|
|
|
14e627 |
+ -1,
|
|
|
14e627 |
+ NULL,
|
|
|
14e627 |
+ NULL);
|
|
|
14e627 |
+
|
|
|
14e627 |
+ if (res) {
|
|
|
14e627 |
+ g_variant_get (res, "(&s)", &id;;
|
|
|
14e627 |
+
|
|
|
14e627 |
+ xsettings_manager_set_string (manager->priv->manager, fixed->xsetting_name, id);
|
|
|
14e627 |
+ g_variant_unref (res);
|
|
|
14e627 |
+ }
|
|
|
14e627 |
+
|
|
|
14e627 |
+ g_object_unref (bus);
|
|
|
14e627 |
+}
|
|
|
14e627 |
+
|
|
|
14e627 |
static FixedEntry fixed_entries [] = {
|
|
|
14e627 |
{ "Gtk/MenuImages", fixed_false_int },
|
|
|
14e627 |
{ "Gtk/ButtonImages", fixed_false_int },
|
|
|
14e627 |
@@ -386,6 +417,7 @@ static FixedEntry fixed_entries [] = {
|
|
|
14e627 |
{ "Gtk/AutoMnemonics", fixed_true_int },
|
|
|
14e627 |
{ "Gtk/EnablePrimaryPaste", fixed_true_int },
|
|
|
14e627 |
{ "Gtk/DialogsUseHeader", fixed_true_int },
|
|
|
14e627 |
+ { "Gtk/SessionBusId", fixed_bus_id },
|
|
|
14e627 |
};
|
|
|
14e627 |
|
|
|
14e627 |
static TranslationEntry translations [] = {
|
|
|
14e627 |
--
|
|
|
14e627 |
2.3.6
|
|
|
14e627 |
|