aboutsummaryrefslogtreecommitdiff
path: root/src/device-menu-mgr.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-05 14:51:32 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-05 14:51:32 -0500
commit19dd59771d7921fa927840d9864e8ba7b4795a87 (patch)
treeb13193f6d3d8f3abeb1fc7c71c60a6e9edf9b39c /src/device-menu-mgr.c
parent4e1238c75f3d4c239c61b5c2b841675823a4053f (diff)
downloadayatana-indicator-session-19dd59771d7921fa927840d9864e8ba7b4795a87.tar.gz
ayatana-indicator-session-19dd59771d7921fa927840d9864e8ba7b4795a87.tar.bz2
ayatana-indicator-session-19dd59771d7921fa927840d9864e8ba7b4795a87.zip
make lock_menuitem an instance variable rather than a global one so that its pointer values won't persist between test sessions. Woot, last global\!
Diffstat (limited to 'src/device-menu-mgr.c')
-rw-r--r--src/device-menu-mgr.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index 7821034..beefc3e 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -49,6 +49,7 @@ struct _DeviceMenuMgr
DbusmenuMenuitem * hibernate_mi;
DbusmenuMenuitem * suspend_mi;
+ DbusmenuMenuitem * lock_mi;
DBusGProxy * up_main_proxy;
DBusGProxy * up_prop_proxy;
@@ -62,8 +63,6 @@ struct _DeviceMenuMgr
DBusGProxyCall * hibernate_call;
};
-static DbusmenuMenuitem *lock_menuitem = NULL;
-
static void setup_up (DeviceMenuMgr* self);
static void device_menu_mgr_rebuild_items (DeviceMenuMgr *self);
static void machine_sleep_with_context (DeviceMenuMgr* self,
@@ -148,10 +147,10 @@ update_screensaver_shortcut (DbusmenuMenuitem * menuitem, GSettings * settings)
static void
screensaver_keybinding_changed (GSettings * settings,
- const gchar * key G_GNUC_UNUSED,
- gpointer user_data G_GNUC_UNUSED)
+ const gchar * key G_GNUC_UNUSED,
+ gpointer userdata)
{
- update_screensaver_shortcut (lock_menuitem, settings);
+ update_screensaver_shortcut (DEVICE_MENU_MGR(userdata)->lock_mi, settings);
}
static void
@@ -480,17 +479,17 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self, gboolean greeter_mode)
LOCKDOWN_KEY_SCREENSAVER);
/* Lock screen item */
if (can_lockscreen) {
- lock_menuitem = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (lock_menuitem,
+ self->lock_mi = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (self->lock_mi,
DBUSMENU_MENUITEM_PROP_LABEL,
_("Lock Screen"));
- update_screensaver_shortcut (lock_menuitem, self->keybinding_settings);
+ update_screensaver_shortcut (self->lock_mi, self->keybinding_settings);
- g_signal_connect (G_OBJECT(lock_menuitem),
+ g_signal_connect (G_OBJECT(self->lock_mi),
DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK(lock_screen), NULL);
- dbusmenu_menuitem_child_append(self->root_item, lock_menuitem);
+ dbusmenu_menuitem_child_append(self->root_item, self->lock_mi);
}
logout_mi = dbusmenu_menuitem_new();