diff options
-rw-r--r-- | src/dbus-shared-names.h | 2 | ||||
-rw-r--r-- | src/indicator-session.c | 14 | ||||
-rw-r--r-- | src/session-service.c | 10 |
3 files changed, 22 insertions, 4 deletions
diff --git a/src/dbus-shared-names.h b/src/dbus-shared-names.h index 41ac219..a6364b1 100644 --- a/src/dbus-shared-names.h +++ b/src/dbus-shared-names.h @@ -50,6 +50,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #define RESTART_ITEM_ICON "restart-icon" #define ICON_DEFAULT "system-shutdown-panel" -#define ICON_RESTART "system-shutdown-panel" +#define ICON_RESTART "system-shutdown-panel-restart" #endif /* __DBUS_SHARED_NAMES_H__ */ diff --git a/src/indicator-session.c b/src/indicator-session.c index 4ae9c66..c21579a 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -168,6 +168,14 @@ indicator_session_finalize (GObject *object) static void icon_name_get_cb (DBusGProxy *proxy, char * OUT_name, GError *error, gpointer userdata) { + if (error != NULL) { + return; + } + + if (OUT_name == NULL || OUT_name[0] == '\0') { + return; + } + IndicatorSession * self = INDICATOR_SESSION(userdata); indicator_image_helper_update(self->status_image, OUT_name); return; @@ -327,12 +335,14 @@ restart_property_change (DbusmenuMenuitem * item, const gchar * property, const } else if (g_strcmp0(property, RESTART_ITEM_ICON) == 0) { GtkWidget * image = gtk_image_menu_item_get_image(GTK_IMAGE_MENU_ITEM(gmi)); + GIcon * gicon = g_themed_icon_new_with_default_fallbacks(g_value_get_string(value)); if (image == NULL) { - image = gtk_image_new_from_icon_name(g_value_get_string(value), GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(gmi), image); } else { - gtk_image_set_from_icon_name(GTK_IMAGE(image), g_value_get_string(value), GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon(GTK_IMAGE(image), gicon, GTK_ICON_SIZE_MENU); } + g_object_unref(G_OBJECT(gicon)); } return; diff --git a/src/session-service.c b/src/session-service.c index 9eb6d88..3832e89 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -340,6 +340,9 @@ static void activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data) { GError * error = NULL; + + lock_screen(mi, timestamp, user_data); + if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER, &error)) { g_warning("Unable to start guest session: %s", error->message); g_error_free(error); @@ -380,6 +383,9 @@ static void activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data) { GError * error = NULL; + + lock_screen(mi, timestamp, user_data); + if (!g_spawn_command_line_async("gdmflexiserver --startnew", &error)) { g_warning("Unable to start new session: %s", error->message); g_error_free(error); @@ -395,6 +401,8 @@ activate_user_session (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data UserData *user = (UserData *)user_data; UsersServiceDbus *service = user->service; + lock_screen(mi, timestamp, user_data); + users_service_dbus_activate_user_session (service, user); } @@ -661,7 +669,7 @@ restart_dir_changed (void) } else { dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_LABEL, _("Restart Required...")); } - dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_ICON, "emblem-important"); + dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_ICON, "system-restart-panel"); if (session_dbus != NULL) { session_dbus_set_name(session_dbus, ICON_RESTART); } |