diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c index 81c9f8d5d..1ce82105e 100644 --- a/panels/universal-access/cc-ua-panel.c +++ b/panels/universal-access/cc-ua-panel.c @@ -50,6 +50,7 @@ struct _CcUaPanelPrivate GSettings *mediakeys_settings; ZoomOptions *zoom_options; + guint shell_watch_id; }; @@ -84,6 +85,12 @@ cc_ua_panel_dispose (GObject *object) { CcUaPanelPrivate *priv = CC_UA_PANEL (object)->priv; + if (priv->shell_watch_id) + { + g_bus_unwatch_name (priv->shell_watch_id); + priv->shell_watch_id = 0; + } + if (priv->builder) { g_object_unref (priv->builder); @@ -462,6 +469,27 @@ cc_ua_panel_set_shortcut_label (CcUaPanel *self, g_free (text); } +static void +shell_vanished_cb (GDBusConnection *connection, + const gchar *name, + CcUaPanel *self) +{ + CcUaPanelPrivate *priv = self->priv; + + gtk_widget_hide (WID (priv->builder, "zoom_frame")); +} + +static void +shell_appeared_cb (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + CcUaPanel *self) +{ + CcUaPanelPrivate *priv = self->priv; + + gtk_widget_show (WID (priv->builder, "zoom_frame")); +} + static void cc_ua_panel_init_seeing (CcUaPanel *self) { @@ -480,6 +508,13 @@ cc_ua_panel_init_seeing (CcUaPanel *self) WID (priv->builder, "seeing_enable_toggle_keys_checkbutton"), "active", G_SETTINGS_BIND_DEFAULT); + priv->shell_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION, + "org.gnome.Shell", + G_BUS_NAME_WATCHER_FLAGS_NONE, + (GBusNameAppearedCallback) shell_appeared_cb, + (GBusNameVanishedCallback) shell_vanished_cb, + self, + NULL); g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"), "clicked", G_CALLBACK (zoom_options_launch_cb), self); diff --git a/panels/universal-access/uap.ui b/panels/universal-access/uap.ui index 8017855f9..c8910c0e3 100644 --- a/panels/universal-access/uap.ui +++ b/panels/universal-access/uap.ui @@ -428,7 +428,7 @@ - + True 0 none