|
|
607f76 |
From 04b92f38a2ebce2479670580857f722e9b3b3be4 Mon Sep 17 00:00:00 2001
|
|
|
607f76 |
From: Dan Williams <dcbw@redhat.com>
|
|
|
607f76 |
Date: Tue, 25 Nov 2014 17:45:05 -0600
|
|
|
607f76 |
Subject: [PATCH 1/2] Revert "applet: don't check for gnome shell (bgo
|
|
|
607f76 |
#707953)"
|
|
|
607f76 |
|
|
|
607f76 |
This reverts commit 4473e6a48fcfda1d87d4a4bc9f5c0589235dcfe0.
|
|
|
607f76 |
---
|
|
|
607f76 |
src/applet.c | 47 +++++++++-
|
|
|
607f76 |
src/applet.h | 4 +
|
|
|
607f76 |
src/shell-watcher.c | 241 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
607f76 |
src/shell-watcher.h | 56 ++++++++++++
|
|
|
607f76 |
4 files changed, 347 insertions(+), 1 deletion(-)
|
|
|
607f76 |
create mode 100644 src/shell-watcher.c
|
|
|
607f76 |
create mode 100644 src/shell-watcher.h
|
|
|
607f76 |
|
|
|
607f76 |
diff --git a/src/applet.c b/src/applet.c
|
|
|
607f76 |
index f0536f8..f3f4344 100644
|
|
|
607f76 |
--- a/src/applet.c
|
|
|
607f76 |
+++ b/src/applet.c
|
|
|
607f76 |
@@ -87,6 +87,7 @@
|
|
|
607f76 |
#include "nm-wifi-dialog.h"
|
|
|
607f76 |
#include "applet-vpn-request.h"
|
|
|
607f76 |
#include "utils.h"
|
|
|
607f76 |
+#include "shell-watcher.h"
|
|
|
607f76 |
#include "nm-ui-utils.h"
|
|
|
607f76 |
#include "nm-glib-compat.h"
|
|
|
607f76 |
|
|
|
607f76 |
@@ -3542,6 +3543,39 @@ register_agent (NMApplet *applet)
|
|
|
607f76 |
G_CALLBACK (applet_agent_cancel_secrets_cb), applet);
|
|
|
607f76 |
}
|
|
|
607f76 |
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+shell_version_changed_cb (NMShellWatcher *watcher, GParamSpec *pspec, gpointer user_data)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMApplet *applet = user_data;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ if (nm_shell_watcher_version_at_least (watcher, 3, 0)) {
|
|
|
607f76 |
+ g_debug ("gnome-shell is running");
|
|
|
607f76 |
+
|
|
|
607f76 |
+ if (applet->agent) {
|
|
|
607f76 |
+ g_debug ("destroying secret agent");
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_signal_handlers_disconnect_by_func (applet->agent,
|
|
|
607f76 |
+ G_CALLBACK (applet_agent_get_secrets_cb),
|
|
|
607f76 |
+ applet);
|
|
|
607f76 |
+ g_signal_handlers_disconnect_by_func (applet->agent,
|
|
|
607f76 |
+ G_CALLBACK (applet_agent_cancel_secrets_cb),
|
|
|
607f76 |
+ applet);
|
|
|
607f76 |
+ nm_secret_agent_unregister (NM_SECRET_AGENT (applet->agent));
|
|
|
607f76 |
+ g_clear_object (&applet->agent);
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+
|
|
|
607f76 |
+ /* We don't need the watcher any more */
|
|
|
607f76 |
+ g_signal_handlers_disconnect_by_func (applet->shell_watcher,
|
|
|
607f76 |
+ G_CALLBACK (shell_version_changed_cb),
|
|
|
607f76 |
+ applet);
|
|
|
607f76 |
+ g_clear_object (&applet->shell_watcher);
|
|
|
607f76 |
+ } else if (!applet->agent) {
|
|
|
607f76 |
+ /* No shell */
|
|
|
607f76 |
+ g_debug ("gnome-shell is not running, registering secret agent");
|
|
|
607f76 |
+ register_agent (applet);
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
static gboolean
|
|
|
607f76 |
dbus_setup (NMApplet *applet, GError **error)
|
|
|
607f76 |
{
|
|
|
607f76 |
@@ -3694,7 +3728,15 @@ initable_init (GInitable *initable, GCancellable *cancellable, GError **error)
|
|
|
607f76 |
G_CALLBACK (applet_embedded_cb), NULL);
|
|
|
607f76 |
applet_embedded_cb (G_OBJECT (applet->status_icon), NULL, NULL);
|
|
|
607f76 |
|
|
|
607f76 |
- register_agent (applet);
|
|
|
607f76 |
+ /* Watch GNOME Shell so we can unregister our applet agent if it appears */
|
|
|
607f76 |
+ if (!shell_debug) {
|
|
|
607f76 |
+ applet->shell_watcher = nm_shell_watcher_new ();
|
|
|
607f76 |
+ g_signal_connect (applet->shell_watcher,
|
|
|
607f76 |
+ "notify::shell-version",
|
|
|
607f76 |
+ G_CALLBACK (shell_version_changed_cb),
|
|
|
607f76 |
+ applet);
|
|
|
607f76 |
+ } else
|
|
|
607f76 |
+ register_agent (applet);
|
|
|
607f76 |
|
|
|
607f76 |
return TRUE;
|
|
|
607f76 |
}
|
|
|
607f76 |
@@ -3764,6 +3806,9 @@ static void finalize (GObject *object)
|
|
|
607f76 |
if (applet->session_bus)
|
|
|
607f76 |
dbus_g_connection_unref (applet->session_bus);
|
|
|
607f76 |
|
|
|
607f76 |
+ if (applet->shell_watcher)
|
|
|
607f76 |
+ g_object_unref (applet->shell_watcher);
|
|
|
607f76 |
+
|
|
|
607f76 |
G_OBJECT_CLASS (nma_parent_class)->finalize (object);
|
|
|
607f76 |
}
|
|
|
607f76 |
|
|
|
607f76 |
diff --git a/src/applet.h b/src/applet.h
|
|
|
607f76 |
index 23632f7..cd5ac97 100644
|
|
|
607f76 |
--- a/src/applet.h
|
|
|
607f76 |
+++ b/src/applet.h
|
|
|
607f76 |
@@ -44,6 +44,7 @@
|
|
|
607f76 |
#include <nm-active-connection.h>
|
|
|
607f76 |
#include <nm-remote-settings.h>
|
|
|
607f76 |
#include "applet-agent.h"
|
|
|
607f76 |
+#include "shell-watcher.h"
|
|
|
607f76 |
|
|
|
607f76 |
#if WITH_MODEM_MANAGER_1
|
|
|
607f76 |
#include <libmm-glib.h>
|
|
|
607f76 |
@@ -86,6 +87,9 @@ typedef struct
|
|
|
607f76 |
GMainLoop *loop;
|
|
|
607f76 |
DBusGConnection *session_bus;
|
|
|
607f76 |
|
|
|
607f76 |
+ NMShellWatcher *shell_watcher;
|
|
|
607f76 |
+ guint agent_start_id;
|
|
|
607f76 |
+
|
|
|
607f76 |
NMClient *nm_client;
|
|
|
607f76 |
NMRemoteSettings *settings;
|
|
|
607f76 |
AppletAgent *agent;
|
|
|
607f76 |
diff --git a/src/shell-watcher.c b/src/shell-watcher.c
|
|
|
607f76 |
new file mode 100644
|
|
|
607f76 |
index 0000000..da62121
|
|
|
607f76 |
--- /dev/null
|
|
|
607f76 |
+++ b/src/shell-watcher.c
|
|
|
607f76 |
@@ -0,0 +1,241 @@
|
|
|
607f76 |
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
607f76 |
+/* NetworkManager Applet -- allow user control over networking
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
607f76 |
+ * it under the terms of the GNU General Public License as published by
|
|
|
607f76 |
+ * the Free Software Foundation; either version 2 of the License, or
|
|
|
607f76 |
+ * (at your option) any later version.
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * This program is distributed in the hope that it will be useful,
|
|
|
607f76 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
607f76 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
607f76 |
+ * GNU General Public License for more details.
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * You should have received a copy of the GNU General Public License along
|
|
|
607f76 |
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
607f76 |
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * Copyright (C) 2012 Red Hat, Inc.
|
|
|
607f76 |
+ */
|
|
|
607f76 |
+
|
|
|
607f76 |
+#ifdef HAVE_CONFIG_H
|
|
|
607f76 |
+#include <config.h>
|
|
|
607f76 |
+#endif
|
|
|
607f76 |
+
|
|
|
607f76 |
+#include <stdlib.h>
|
|
|
607f76 |
+
|
|
|
607f76 |
+#include "shell-watcher.h"
|
|
|
607f76 |
+
|
|
|
607f76 |
+G_DEFINE_TYPE (NMShellWatcher, nm_shell_watcher, G_TYPE_OBJECT)
|
|
|
607f76 |
+
|
|
|
607f76 |
+struct NMShellWatcherPrivate {
|
|
|
607f76 |
+ GDBusProxy *shell_proxy;
|
|
|
607f76 |
+ guint signal_id;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ guint retry_timeout;
|
|
|
607f76 |
+ guint retries;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ guint shell_version;
|
|
|
607f76 |
+ gboolean shell_version_set;
|
|
|
607f76 |
+};
|
|
|
607f76 |
+
|
|
|
607f76 |
+enum {
|
|
|
607f76 |
+ PROP_0,
|
|
|
607f76 |
+ PROP_SHELL_VERSION,
|
|
|
607f76 |
+ LAST_PROP
|
|
|
607f76 |
+};
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void create_gnome_shell_proxy (NMShellWatcher *watcher);
|
|
|
607f76 |
+
|
|
|
607f76 |
+static gboolean
|
|
|
607f76 |
+retry_create_shell_proxy (gpointer user_data)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcher *watcher = user_data;
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv = watcher->priv;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ priv->retry_timeout = 0;
|
|
|
607f76 |
+ create_gnome_shell_proxy (watcher);
|
|
|
607f76 |
+ return FALSE;
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+try_update_version (NMShellWatcher *watcher)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv = watcher->priv;
|
|
|
607f76 |
+ GVariant *v;
|
|
|
607f76 |
+ char *version, *p;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ v = g_dbus_proxy_get_cached_property (priv->shell_proxy, "ShellVersion");
|
|
|
607f76 |
+ if (!v) {
|
|
|
607f76 |
+ /* The shell has claimed the name, but not yet registered its interfaces...
|
|
|
607f76 |
+ * (https://bugzilla.gnome.org/show_bug.cgi?id=673182). There's no way
|
|
|
607f76 |
+ * to make GDBusProxy re-read the properties at this point, so we
|
|
|
607f76 |
+ * have to destroy this proxy and try again.
|
|
|
607f76 |
+ */
|
|
|
607f76 |
+ if (priv->signal_id) {
|
|
|
607f76 |
+ g_signal_handler_disconnect (priv->shell_proxy, priv->signal_id);
|
|
|
607f76 |
+ priv->signal_id = 0;
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+ g_object_unref (priv->shell_proxy);
|
|
|
607f76 |
+ priv->shell_proxy = NULL;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ priv->retry_timeout = g_timeout_add_seconds (2, retry_create_shell_proxy, watcher);
|
|
|
607f76 |
+ return;
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_warn_if_fail (g_variant_is_of_type (v, G_VARIANT_TYPE_STRING));
|
|
|
607f76 |
+ version = g_variant_dup_string (v, NULL);
|
|
|
607f76 |
+ if (version) {
|
|
|
607f76 |
+ guint major, minor;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ major = strtoul (version, &p, 10);
|
|
|
607f76 |
+ if (*p == '.')
|
|
|
607f76 |
+ minor = strtoul (p + 1, NULL, 10);
|
|
|
607f76 |
+ else
|
|
|
607f76 |
+ minor = 0;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_warn_if_fail (major < 256);
|
|
|
607f76 |
+ g_warn_if_fail (minor < 256);
|
|
|
607f76 |
+
|
|
|
607f76 |
+ priv->shell_version = (major << 8) | minor;
|
|
|
607f76 |
+ priv->shell_version_set = TRUE;
|
|
|
607f76 |
+ g_object_notify (G_OBJECT (watcher), "shell-version");
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_variant_unref (v);
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+name_owner_changed_cb (GDBusProxy *proxy, GParamSpec *pspec, gpointer user_data)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcher *watcher = user_data;
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv = watcher->priv;
|
|
|
607f76 |
+ char *owner;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ owner = g_dbus_proxy_get_name_owner (proxy);
|
|
|
607f76 |
+ if (owner) {
|
|
|
607f76 |
+ try_update_version (watcher);
|
|
|
607f76 |
+ g_free (owner);
|
|
|
607f76 |
+ } else if (priv->shell_version || !priv->shell_version_set) {
|
|
|
607f76 |
+ priv->shell_version = 0;
|
|
|
607f76 |
+ priv->shell_version_set = TRUE;
|
|
|
607f76 |
+ g_object_notify (G_OBJECT (watcher), "shell-version");
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+got_shell_proxy (GObject *source, GAsyncResult *result, gpointer user_data)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcher *watcher = user_data;
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv = watcher->priv;
|
|
|
607f76 |
+ GError *error = NULL;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ priv->shell_proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
|
|
|
607f76 |
+ if (!priv->shell_proxy) {
|
|
|
607f76 |
+ g_warning ("Could not create GDBusProxy for org.gnome.Shell: %s", error->message);
|
|
|
607f76 |
+ g_error_free (error);
|
|
|
607f76 |
+ return;
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+
|
|
|
607f76 |
+ priv->signal_id = g_signal_connect (priv->shell_proxy,
|
|
|
607f76 |
+ "notify::g-name-owner",
|
|
|
607f76 |
+ G_CALLBACK (name_owner_changed_cb),
|
|
|
607f76 |
+ watcher);
|
|
|
607f76 |
+
|
|
|
607f76 |
+ name_owner_changed_cb (priv->shell_proxy, NULL, watcher);
|
|
|
607f76 |
+ g_object_unref (watcher);
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+create_gnome_shell_proxy (NMShellWatcher *watcher)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv = watcher->priv;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ if (priv->retries++ == 5) {
|
|
|
607f76 |
+ g_warning ("Could not find ShellVersion property on org.gnome.Shell after 5 tries");
|
|
|
607f76 |
+ return;
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
|
|
|
607f76 |
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
|
|
607f76 |
+ NULL,
|
|
|
607f76 |
+ "org.gnome.Shell",
|
|
|
607f76 |
+ "/org/gnome/Shell",
|
|
|
607f76 |
+ "org.gnome.Shell",
|
|
|
607f76 |
+ NULL,
|
|
|
607f76 |
+ got_shell_proxy,
|
|
|
607f76 |
+ g_object_ref (watcher));
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+nm_shell_watcher_init (NMShellWatcher *watcher)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ watcher->priv = G_TYPE_INSTANCE_GET_PRIVATE (watcher, NM_TYPE_SHELL_WATCHER,
|
|
|
607f76 |
+ NMShellWatcherPrivate);
|
|
|
607f76 |
+ create_gnome_shell_proxy (watcher);
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+get_property (GObject *object, guint prop_id,
|
|
|
607f76 |
+ GValue *value, GParamSpec *pspec)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcher *watcher = NM_SHELL_WATCHER (object);
|
|
|
607f76 |
+
|
|
|
607f76 |
+ switch (prop_id) {
|
|
|
607f76 |
+ case PROP_SHELL_VERSION:
|
|
|
607f76 |
+ g_value_set_uint (value, watcher->priv->shell_version);
|
|
|
607f76 |
+ break;
|
|
|
607f76 |
+ default:
|
|
|
607f76 |
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
607f76 |
+ break;
|
|
|
607f76 |
+ }
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+finalize (GObject *object)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ NMShellWatcher *watcher = NM_SHELL_WATCHER (object);
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv = watcher->priv;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ if (priv->retry_timeout)
|
|
|
607f76 |
+ g_source_remove (priv->retry_timeout);
|
|
|
607f76 |
+ if (priv->signal_id)
|
|
|
607f76 |
+ g_signal_handler_disconnect (priv->shell_proxy, priv->signal_id);
|
|
|
607f76 |
+ if (priv->shell_proxy)
|
|
|
607f76 |
+ g_object_unref (priv->shell_proxy);
|
|
|
607f76 |
+
|
|
|
607f76 |
+ G_OBJECT_CLASS (nm_shell_watcher_parent_class)->finalize (object);
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+static void
|
|
|
607f76 |
+nm_shell_watcher_class_init (NMShellWatcherClass *klass)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ GObjectClass *oclass = G_OBJECT_CLASS (klass);
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_type_class_add_private (klass, sizeof (NMShellWatcherPrivate));
|
|
|
607f76 |
+
|
|
|
607f76 |
+ oclass->get_property = get_property;
|
|
|
607f76 |
+ oclass->finalize = finalize;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ g_object_class_install_property (oclass, PROP_SHELL_VERSION,
|
|
|
607f76 |
+ g_param_spec_uint ("shell-version",
|
|
|
607f76 |
+ "Shell version",
|
|
|
607f76 |
+ "Running GNOME Shell version, eg, 0x0304",
|
|
|
607f76 |
+ 0, 0xFFFF, 0,
|
|
|
607f76 |
+ G_PARAM_READABLE |
|
|
|
607f76 |
+ G_PARAM_STATIC_STRINGS));
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+NMShellWatcher *
|
|
|
607f76 |
+nm_shell_watcher_new (void)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ return g_object_new (NM_TYPE_SHELL_WATCHER, NULL);
|
|
|
607f76 |
+}
|
|
|
607f76 |
+
|
|
|
607f76 |
+gboolean
|
|
|
607f76 |
+nm_shell_watcher_version_at_least (NMShellWatcher *watcher, guint major, guint minor)
|
|
|
607f76 |
+{
|
|
|
607f76 |
+ guint version = (major << 8) | minor;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ return watcher->priv->shell_version >= version;
|
|
|
607f76 |
+}
|
|
|
607f76 |
diff --git a/src/shell-watcher.h b/src/shell-watcher.h
|
|
|
607f76 |
new file mode 100644
|
|
|
607f76 |
index 0000000..a6065f8
|
|
|
607f76 |
--- /dev/null
|
|
|
607f76 |
+++ b/src/shell-watcher.h
|
|
|
607f76 |
@@ -0,0 +1,56 @@
|
|
|
607f76 |
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
607f76 |
+/* NetworkManager Applet -- allow user control over networking
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
607f76 |
+ * it under the terms of the GNU General Public License as published by
|
|
|
607f76 |
+ * the Free Software Foundation; either version 2 of the License, or
|
|
|
607f76 |
+ * (at your option) any later version.
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * This program is distributed in the hope that it will be useful,
|
|
|
607f76 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
607f76 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
607f76 |
+ * GNU General Public License for more details.
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * You should have received a copy of the GNU General Public License along
|
|
|
607f76 |
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
607f76 |
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
607f76 |
+ *
|
|
|
607f76 |
+ * Copyright (C) 2012 Red Hat, Inc.
|
|
|
607f76 |
+ */
|
|
|
607f76 |
+
|
|
|
607f76 |
+#ifndef SHELL_WATCHER_H
|
|
|
607f76 |
+#define SHELL_WATCHER_H
|
|
|
607f76 |
+
|
|
|
607f76 |
+#ifdef HAVE_CONFIG_H
|
|
|
607f76 |
+#include <config.h>
|
|
|
607f76 |
+#endif
|
|
|
607f76 |
+
|
|
|
607f76 |
+#include <gio/gio.h>
|
|
|
607f76 |
+
|
|
|
607f76 |
+#define NM_TYPE_SHELL_WATCHER (nm_shell_watcher_get_type())
|
|
|
607f76 |
+#define NM_SHELL_WATCHER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), NM_TYPE_SHELL_WATCHER, NMShellWatcher))
|
|
|
607f76 |
+#define NM_SHELL_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SHELL_WATCHER, NMShellWatcherClass))
|
|
|
607f76 |
+#define NM_IS_SHELL_WATCHER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), NM_TYPE_SHELL_WATCHER))
|
|
|
607f76 |
+#define NM_IS_SHELL_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SHELL_WATCHER))
|
|
|
607f76 |
+#define NM_SHELL_WATCHER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), NM_TYPE_SHELL_WATCHER, NMShellWatcherClass))
|
|
|
607f76 |
+
|
|
|
607f76 |
+typedef struct NMShellWatcherPrivate NMShellWatcherPrivate;
|
|
|
607f76 |
+
|
|
|
607f76 |
+typedef struct {
|
|
|
607f76 |
+ GObject parent_instance;
|
|
|
607f76 |
+
|
|
|
607f76 |
+ NMShellWatcherPrivate *priv;
|
|
|
607f76 |
+} NMShellWatcher;
|
|
|
607f76 |
+
|
|
|
607f76 |
+typedef struct {
|
|
|
607f76 |
+ GObjectClass parent_class;
|
|
|
607f76 |
+} NMShellWatcherClass;
|
|
|
607f76 |
+
|
|
|
607f76 |
+GType nm_shell_watcher_get_type (void);
|
|
|
607f76 |
+
|
|
|
607f76 |
+NMShellWatcher *nm_shell_watcher_new (void);
|
|
|
607f76 |
+
|
|
|
607f76 |
+gboolean nm_shell_watcher_version_at_least (NMShellWatcher *watcher,
|
|
|
607f76 |
+ guint major, guint minor);
|
|
|
607f76 |
+
|
|
|
607f76 |
+#endif
|
|
|
607f76 |
--
|
|
|
607f76 |
1.9.3
|
|
|
607f76 |
|
|
|
607f76 |
From bfc24e17555126bb1a9783c2d3c2771bb886ed58 Mon Sep 17 00:00:00 2001
|
|
|
607f76 |
From: Dan Williams <dcbw@redhat.com>
|
|
|
607f76 |
Date: Tue, 25 Nov 2014 17:45:11 -0600
|
|
|
607f76 |
Subject: [PATCH 2/2] Revert "build: fix build after "applet: don't check for
|
|
|
607f76 |
gnome shell (bgo #707953)""
|
|
|
607f76 |
|
|
|
607f76 |
This reverts commit 2014927869cb92be2c9e360f1a6a4b118b866403.
|
|
|
607f76 |
---
|
|
|
607f76 |
src/Makefile.am | 4 +++-
|
|
|
607f76 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
607f76 |
|
|
|
607f76 |
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
|
607f76 |
index 0e85dd5..d8c1238 100644
|
|
|
607f76 |
--- a/src/Makefile.am
|
|
|
607f76 |
+++ b/src/Makefile.am
|
|
|
607f76 |
@@ -69,7 +69,9 @@ nm_applet_SOURCES = \
|
|
|
607f76 |
applet-device-bridge.c \
|
|
|
607f76 |
applet-device-infiniband.h \
|
|
|
607f76 |
applet-device-infiniband.c \
|
|
|
607f76 |
- fallback-icon.h
|
|
|
607f76 |
+ fallback-icon.h \
|
|
|
607f76 |
+ shell-watcher.h \
|
|
|
607f76 |
+ shell-watcher.c
|
|
|
607f76 |
|
|
|
607f76 |
nm_applet_LDADD = \
|
|
|
607f76 |
-lm \
|
|
|
607f76 |
--
|
|
|
607f76 |
1.9.3
|
|
|
607f76 |
|