From 55aa5390c919c82b960afddccaebfa66572dbe6b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Apr 06 2008 03:23:00 +0000 Subject: Improve handling of CK errors --- diff --git a/gnome-panel-2.22.0-ck-shutdown.patch b/gnome-panel-2.22.0-ck-shutdown.patch index 2458fb3..75463eb 100644 --- a/gnome-panel-2.22.0-ck-shutdown.patch +++ b/gnome-panel-2.22.0-ck-shutdown.patch @@ -1,18 +1,63 @@ -diff -up gnome-panel-2.22.0/gnome-panel/panel-session.h.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-session.h ---- gnome-panel-2.22.0/gnome-panel/panel-session.h.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-session.h 2008-03-14 17:14:22.000000000 -0400 -@@ -30,6 +30,7 @@ G_BEGIN_DECLS - void panel_session_init (void); - void panel_session_do_not_restart (void); - void panel_session_request_logout (void); -+void panel_session_request_save (void); +diff -up gnome-panel-2.22.0/gnome-panel/Makefile.am.ck-shutdown gnome-panel-2.22.0/gnome-panel/Makefile.am +--- gnome-panel-2.22.0/gnome-panel/Makefile.am.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/Makefile.am 2008-04-05 20:48:37.000000000 -0400 +@@ -16,6 +16,7 @@ INCLUDES = \ + $(STANDARD_PROPERTIES_CFLAGS) \ + $(PANEL_CFLAGS) \ + $(PANELCONFIG_CFLAGS) \ ++ $(POLKIT_GNOME_CFLAGS) \ + $(WARN_CFLAGS) \ + $(NULL) - G_END_DECLS +@@ -98,6 +99,7 @@ panel_sources = \ + panel-logout.c \ + panel-gdm.c \ + panel-power-manager.c \ ++ panel-consolekit.c \ + panel-ditem-editor.c \ + panel-mount-operation.c \ + $(NULL) +@@ -148,6 +150,7 @@ panel_headers = \ + panel-logout.h \ + panel-gdm.h \ + panel-power-manager.h \ ++ panel-consolekit.h \ + panel-ditem-editor.h \ + panel-icon-names.h \ + panel-mount-operation.h \ +@@ -161,6 +164,7 @@ gnome_panel_SOURCES = \ + gnome_panel_LDADD = \ + $(PANEL_LIBS) \ ++ $(POLKIT_GNOME_LIBS) \ + $(X_LIBS) + + gnome_panel_LDFLAGS = -export-dynamic +diff -up gnome-panel-2.22.0/gnome-panel/panel-action-button.c.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-action-button.c +--- gnome-panel-2.22.0/gnome-panel/panel-action-button.c.ck-shutdown 2008-04-05 20:48:37.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-action-button.c 2008-04-05 20:48:37.000000000 -0400 +@@ -46,7 +46,6 @@ + #include "panel-lockdown.h" + #include "panel-logout.h" + #include "panel-compatibility.h" +-#include "panel-gdm.h" + #include "panel-icon-names.h" + + G_DEFINE_TYPE (PanelActionButton, panel_action_button, BUTTON_TYPE_WIDGET); +@@ -183,8 +182,7 @@ static gboolean + panel_action_shutdown_reboot_is_disabled (void) + { + return (panel_lockdown_get_disable_log_out() || +- (!gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN) && +- !gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT))); ++ !panel_logout_supports_shutdown_reboot); + } + + /* Run Application diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.c ---- /dev/null 2008-03-15 22:02:38.932007625 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-consolekit.c 2008-03-14 17:14:22.000000000 -0400 -@@ -0,0 +1,618 @@ +--- /dev/null 2008-04-05 22:04:35.194004710 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-consolekit.c 2008-04-05 20:48:37.000000000 -0400 +@@ -0,0 +1,682 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Copyright (C) 2008 Jon McCann @@ -457,18 +502,40 @@ diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.c +get_action_from_error (GError *error) +{ + PolKitAction *action; -+ const char *paction; ++ char *paction; ++ char *p; + + action = polkit_action_new (); + + paction = NULL; + if (g_str_has_prefix (error->message, "Not privileged for action: ")) { -+ paction = error->message + strlen ("Not privileged for action: "); ++ paction = g_strdup (error->message + strlen ("Not privileged for action: ")); ++ p = strchr (paction, ' '); ++ if (p) ++ *p = '\0'; + } + polkit_action_set_action_id (action, paction); + ++ g_free (paction); ++ + return action; +} ++ ++static PolKitResult ++get_result_from_error (GError *error) ++{ ++ PolKitResult result = POLKIT_RESULT_UNKNOWN; ++ const char *p; ++ ++ p = strrchr (error->message, ' '); ++ if (p) { ++ p++; ++ polkit_result_from_string_representation (p, &result); ++ } ++ ++ return result; ++} ++ +#endif /* HAVE_POLKIT */ + +static void @@ -479,11 +546,31 @@ diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.c + gboolean res = FALSE; + char *error_message = NULL; + PolKitAction *action; ++ PolKitAction *action2; ++ PolKitResult result; + guint xid; + pid_t pid; + GError *local_error; + + action = get_action_from_error (error); ++ result = get_result_from_error (error); ++ ++ if (result == POLKIT_RESULT_NO) { ++ action2 = polkit_action_new (); ++ polkit_action_set_action_id (action2, "org.freedesktop.consolekit.system.restart-multiple-users"); ++ if (polkit_action_equal (action, action2)) { ++ emit_restart_complete (manager, _("You are not allowed to restart the computer " ++ "because multiple users are logged in")); ++ } ++ else { ++ emit_restart_complete (manager, _("You are not allowed to restart the computer")); ++ } ++ polkit_action_unref (action); ++ polkit_action_unref (action2); ++ ++ return; ++ } ++ + + xid = 0; + pid = getpid (); @@ -518,12 +605,34 @@ diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.c + gboolean res = FALSE; + char *error_message = NULL; + PolKitAction *action; ++ PolKitAction *action2; ++ PolKitResult result; + guint xid; + pid_t pid; + GError *local_error; + ++ result = get_result_from_error (error); + action = get_action_from_error (error); + ++ if (result == POLKIT_RESULT_NO) { ++ action2 = polkit_action_new (); ++ polkit_action_set_action_id (action2, "org.freedesktop.consolekit.system.stop-multiple-users"); ++ if (polkit_action_equal (action, action2)) { ++ emit_restart_complete (manager, _("You are not allowed to stop the computer " ++ "because multiple users are logged in")); ++ } ++ else { ++ emit_restart_complete (manager, _("You are not allowed to stop the computer")); ++ } ++ polkit_action_unref (action); ++ polkit_action_unref (action2); ++ ++ return; ++ } ++ ++ xid = 0; ++ pid = getpid (); ++ + xid = 0; + pid = getpid (); + @@ -631,40 +740,90 @@ diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.c + + return g_object_ref (manager); +} -diff -up gnome-panel-2.22.0/gnome-panel/panel-toplevel.c.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-toplevel.c ---- gnome-panel-2.22.0/gnome-panel/panel-toplevel.c.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-toplevel.c 2008-03-14 17:14:22.000000000 -0400 -@@ -3329,7 +3329,8 @@ panel_toplevel_get_animation_time (Panel - } - - static void --panel_toplevel_start_animation (PanelToplevel *toplevel) -+panel_toplevel_start_animation (PanelToplevel *toplevel, -+ gboolean auto_hide) - { - GdkScreen *screen; - int monitor_width, monitor_height; -@@ -3480,7 +3481,7 @@ panel_toplevel_hide (PanelToplevel *t - } - - if (toplevel->priv->animate && GTK_WIDGET_REALIZED (toplevel)) -- panel_toplevel_start_animation (toplevel); -+ panel_toplevel_start_animation (toplevel, auto_hide); - else if (toplevel->priv->attached) - gtk_widget_hide (GTK_WIDGET (toplevel)); - -@@ -3528,7 +3529,7 @@ panel_toplevel_unhide (PanelToplevel *to - panel_toplevel_push_autohide_disabler (toplevel->priv->attach_toplevel); - - if (toplevel->priv->animate && GTK_WIDGET_REALIZED (toplevel)) -- panel_toplevel_start_animation (toplevel); -+ panel_toplevel_start_animation (toplevel, FALSE); - else if (toplevel->priv->attached) - gtk_widget_show (GTK_WIDGET (toplevel)); - +diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.h +--- /dev/null 2008-04-05 22:04:35.194004710 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-consolekit.h 2008-04-05 20:48:37.000000000 -0400 +@@ -0,0 +1,77 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2008 Jon McCann ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++ * 02111-1307, USA. ++ * ++ * Authors: ++ * Jon McCann ++ */ ++ ++#ifndef PANEL_CONSOLEKIT_H ++#define PANEL_CONSOLEKIT_H ++ ++#include ++#include ++ ++G_BEGIN_DECLS ++ ++#define PANEL_TYPE_CONSOLEKIT (panel_consolekit_get_type ()) ++#define PANEL_CONSOLEKIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PANEL_TYPE_CONSOLEKIT, PanelConsolekit)) ++#define PANEL_CONSOLEKIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANEL_TYPE_CONSOLEKIT, PanelConsolekitClass)) ++#define PANEL_IS_CONSOLEKIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PANEL_TYPE_CONSOLEKIT)) ++#define PANEL_IS_CONSOLEKIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANEL_TYPE_CONSOLEKIT)) ++#define PANEL_CONSOLEKIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PANEL_TYPE_CONSOLEKIT, PanelConsolekitClass)) ++#define PANEL_CONSOLEKIT_ERROR (panel_consolekit_error_quark ()) ++ ++typedef struct _PanelConsolekit PanelConsolekit; ++typedef struct _PanelConsolekitClass PanelConsolekitClass; ++typedef struct _PanelConsolekitPrivate PanelConsolekitPrivate; ++typedef enum _PanelConsolekitError PanelConsolekitError; ++ ++struct _PanelConsolekit { ++ GObject parent; ++ PanelConsolekitPrivate *priv; ++}; ++ ++struct _PanelConsolekitClass { ++ GObjectClass parent_class; ++ ++ void (* request_completed) (PanelConsolekit *manager, ++ GError *error); ++}; ++ ++enum _PanelConsolekitError { ++ PANEL_CONSOLEKIT_ERROR_RESTARTING = 0, ++ PANEL_CONSOLEKIT_ERROR_STOPPING ++}; ++ ++GType panel_consolekit_get_type (void); ++GQuark panel_consolekit_error_quark (void); ++ ++PanelConsolekit *panel_consolekit_new (void) G_GNUC_MALLOC; ++ ++gboolean panel_consolekit_can_stop (PanelConsolekit *manager); ++gboolean panel_consolekit_can_restart (PanelConsolekit *manager); ++ ++void panel_consolekit_attempt_stop (PanelConsolekit *manager); ++void panel_consolekit_attempt_restart (PanelConsolekit *manager); ++ ++PanelConsolekit *panel_get_consolekit (void); ++ ++G_END_DECLS ++ ++#endif /* PANEL_CONSOLEKIT_H */ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-logout.c ---- gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown 2008-03-14 17:14:22.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-logout.c 2008-03-15 23:36:28.000000000 -0400 +--- gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown 2008-04-05 20:48:37.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-logout.c 2008-04-05 22:18:24.000000000 -0400 @@ -1,4 +1,5 @@ -/* +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- @@ -709,7 +868,7 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 panel_logout_get_property (GObject *object, guint prop_id, GValue *value, -@@ -130,6 +134,59 @@ panel_logout_class_init (PanelLogoutDial +@@ -130,6 +134,57 @@ panel_logout_class_init (PanelLogoutDial } static void @@ -758,18 +917,16 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 +on_ck_request_completed (PanelConsolekit *panel_consolekit, + GError *error) +{ -+ if (error == NULL) { -+ /* request was successful */ -+ return; ++ if (error) { ++ ck_restart_error_window (error); + } -+ +} + +static void panel_logout_init (PanelLogoutDialog *logout_dialog) { logout_dialog->priv = PANEL_LOGOUT_DIALOG_GET_PRIVATE (logout_dialog); -@@ -146,6 +203,10 @@ panel_logout_init (PanelLogoutDialog *lo +@@ -146,6 +201,10 @@ panel_logout_init (PanelLogoutDialog *lo GTK_WIN_POS_CENTER_ALWAYS); logout_dialog->priv->power_manager = panel_get_power_manager (); @@ -780,7 +937,7 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 g_signal_connect (logout_dialog, "destroy", G_CALLBACK (panel_logout_destroy), NULL); -@@ -163,37 +224,129 @@ panel_logout_destroy (PanelLogoutDialog +@@ -163,37 +222,129 @@ panel_logout_destroy (PanelLogoutDialog g_object_unref (logout_dialog->priv->power_manager); logout_dialog->priv->power_manager = NULL; @@ -916,7 +1073,7 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 break; case PANEL_LOGOUT_RESPONSE_STD: if (panel_power_manager_can_hibernate (power_manager)) -@@ -210,6 +363,7 @@ panel_logout_response (PanelLogoutDialog +@@ -210,6 +361,7 @@ panel_logout_response (PanelLogoutDialog g_assert_not_reached (); } g_object_unref (power_manager); @@ -924,7 +1081,7 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 } static gboolean -@@ -363,7 +517,7 @@ panel_logout_new (PanelLogoutDialogType +@@ -363,7 +515,7 @@ panel_logout_new (PanelLogoutDialogType _("_Hibernate"), PANEL_LOGOUT_RESPONSE_STD); @@ -933,7 +1090,7 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 gtk_dialog_add_button (GTK_DIALOG (logout_dialog), _("_Restart"), PANEL_LOGOUT_RESPONSE_REBOOT); -@@ -372,7 +526,7 @@ panel_logout_new (PanelLogoutDialogType +@@ -372,7 +524,7 @@ panel_logout_new (PanelLogoutDialogType GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); @@ -942,111 +1099,9 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.c.ck-shutdown gnome-panel-2 gtk_dialog_add_button (GTK_DIALOG (logout_dialog), _("_Shut Down"), PANEL_LOGOUT_RESPONSE_SHUTDOWN); -diff -up /dev/null gnome-panel-2.22.0/gnome-panel/panel-consolekit.h ---- /dev/null 2008-03-15 22:02:38.932007625 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-consolekit.h 2008-03-14 17:14:22.000000000 -0400 -@@ -0,0 +1,77 @@ -+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- -+ * -+ * Copyright (C) 2008 Jon McCann -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -+ * 02111-1307, USA. -+ * -+ * Authors: -+ * Jon McCann -+ */ -+ -+#ifndef PANEL_CONSOLEKIT_H -+#define PANEL_CONSOLEKIT_H -+ -+#include -+#include -+ -+G_BEGIN_DECLS -+ -+#define PANEL_TYPE_CONSOLEKIT (panel_consolekit_get_type ()) -+#define PANEL_CONSOLEKIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PANEL_TYPE_CONSOLEKIT, PanelConsolekit)) -+#define PANEL_CONSOLEKIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANEL_TYPE_CONSOLEKIT, PanelConsolekitClass)) -+#define PANEL_IS_CONSOLEKIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PANEL_TYPE_CONSOLEKIT)) -+#define PANEL_IS_CONSOLEKIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANEL_TYPE_CONSOLEKIT)) -+#define PANEL_CONSOLEKIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PANEL_TYPE_CONSOLEKIT, PanelConsolekitClass)) -+#define PANEL_CONSOLEKIT_ERROR (panel_consolekit_error_quark ()) -+ -+typedef struct _PanelConsolekit PanelConsolekit; -+typedef struct _PanelConsolekitClass PanelConsolekitClass; -+typedef struct _PanelConsolekitPrivate PanelConsolekitPrivate; -+typedef enum _PanelConsolekitError PanelConsolekitError; -+ -+struct _PanelConsolekit { -+ GObject parent; -+ PanelConsolekitPrivate *priv; -+}; -+ -+struct _PanelConsolekitClass { -+ GObjectClass parent_class; -+ -+ void (* request_completed) (PanelConsolekit *manager, -+ GError *error); -+}; -+ -+enum _PanelConsolekitError { -+ PANEL_CONSOLEKIT_ERROR_RESTARTING = 0, -+ PANEL_CONSOLEKIT_ERROR_STOPPING -+}; -+ -+GType panel_consolekit_get_type (void); -+GQuark panel_consolekit_error_quark (void); -+ -+PanelConsolekit *panel_consolekit_new (void) G_GNUC_MALLOC; -+ -+gboolean panel_consolekit_can_stop (PanelConsolekit *manager); -+gboolean panel_consolekit_can_restart (PanelConsolekit *manager); -+ -+void panel_consolekit_attempt_stop (PanelConsolekit *manager); -+void panel_consolekit_attempt_restart (PanelConsolekit *manager); -+ -+PanelConsolekit *panel_get_consolekit (void); -+ -+G_END_DECLS -+ -+#endif /* PANEL_CONSOLEKIT_H */ -diff -up gnome-panel-2.22.0/gnome-panel/panel-action-button.c.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-action-button.c ---- gnome-panel-2.22.0/gnome-panel/panel-action-button.c.ck-shutdown 2008-03-14 17:14:22.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-action-button.c 2008-03-14 17:14:22.000000000 -0400 -@@ -46,7 +46,6 @@ - #include "panel-lockdown.h" - #include "panel-logout.h" - #include "panel-compatibility.h" --#include "panel-gdm.h" - #include "panel-icon-names.h" - - G_DEFINE_TYPE (PanelActionButton, panel_action_button, BUTTON_TYPE_WIDGET); -@@ -183,8 +182,7 @@ static gboolean - panel_action_shutdown_reboot_is_disabled (void) - { - return (panel_lockdown_get_disable_log_out() || -- (!gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN) && -- !gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT))); -+ !panel_logout_supports_shutdown_reboot); - } - - /* Run Application diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.h.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-logout.h --- gnome-panel-2.22.0/gnome-panel/panel-logout.h.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-logout.h 2008-03-14 17:14:22.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-logout.h 2008-04-05 20:48:37.000000000 -0400 @@ -57,6 +57,8 @@ struct _PanelLogoutDialogClass { GType panel_logout_get_type (void) G_GNUC_CONST; @@ -1056,44 +1111,9 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-logout.h.ck-shutdown gnome-panel-2 void panel_logout_new (PanelLogoutDialogType type, GdkScreen *screen, guint32 activate_time); -diff -up gnome-panel-2.22.0/gnome-panel/Makefile.am.ck-shutdown gnome-panel-2.22.0/gnome-panel/Makefile.am ---- gnome-panel-2.22.0/gnome-panel/Makefile.am.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/Makefile.am 2008-03-14 17:14:22.000000000 -0400 -@@ -16,6 +16,7 @@ INCLUDES = \ - $(STANDARD_PROPERTIES_CFLAGS) \ - $(PANEL_CFLAGS) \ - $(PANELCONFIG_CFLAGS) \ -+ $(POLKIT_GNOME_CFLAGS) \ - $(WARN_CFLAGS) \ - $(NULL) - -@@ -98,6 +99,7 @@ panel_sources = \ - panel-logout.c \ - panel-gdm.c \ - panel-power-manager.c \ -+ panel-consolekit.c \ - panel-ditem-editor.c \ - panel-mount-operation.c \ - $(NULL) -@@ -148,6 +150,7 @@ panel_headers = \ - panel-logout.h \ - panel-gdm.h \ - panel-power-manager.h \ -+ panel-consolekit.h \ - panel-ditem-editor.h \ - panel-icon-names.h \ - panel-mount-operation.h \ -@@ -161,6 +164,7 @@ gnome_panel_SOURCES = \ - - gnome_panel_LDADD = \ - $(PANEL_LIBS) \ -+ $(POLKIT_GNOME_LIBS) \ - $(X_LIBS) - - gnome_panel_LDFLAGS = -export-dynamic diff -up gnome-panel-2.22.0/gnome-panel/panel-session.c.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-session.c --- gnome-panel-2.22.0/gnome-panel/panel-session.c.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 -+++ gnome-panel-2.22.0/gnome-panel/panel-session.c 2008-03-14 17:14:22.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-session.c 2008-04-05 20:48:37.000000000 -0400 @@ -60,6 +60,34 @@ panel_session_request_logout (void) recursion_guard--; } @@ -1129,3 +1149,45 @@ diff -up gnome-panel-2.22.0/gnome-panel/panel-session.c.ck-shutdown gnome-panel- static void panel_session_handle_die_request (GnomeClient *client) { +diff -up gnome-panel-2.22.0/gnome-panel/panel-session.h.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-session.h +--- gnome-panel-2.22.0/gnome-panel/panel-session.h.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-session.h 2008-04-05 20:48:37.000000000 -0400 +@@ -30,6 +30,7 @@ G_BEGIN_DECLS + void panel_session_init (void); + void panel_session_do_not_restart (void); + void panel_session_request_logout (void); ++void panel_session_request_save (void); + + G_END_DECLS + +diff -up gnome-panel-2.22.0/gnome-panel/panel-toplevel.c.ck-shutdown gnome-panel-2.22.0/gnome-panel/panel-toplevel.c +--- gnome-panel-2.22.0/gnome-panel/panel-toplevel.c.ck-shutdown 2008-03-10 16:44:57.000000000 -0400 ++++ gnome-panel-2.22.0/gnome-panel/panel-toplevel.c 2008-04-05 20:48:37.000000000 -0400 +@@ -3329,7 +3329,8 @@ panel_toplevel_get_animation_time (Panel + } + + static void +-panel_toplevel_start_animation (PanelToplevel *toplevel) ++panel_toplevel_start_animation (PanelToplevel *toplevel, ++ gboolean auto_hide) + { + GdkScreen *screen; + int monitor_width, monitor_height; +@@ -3480,7 +3481,7 @@ panel_toplevel_hide (PanelToplevel *t + } + + if (toplevel->priv->animate && GTK_WIDGET_REALIZED (toplevel)) +- panel_toplevel_start_animation (toplevel); ++ panel_toplevel_start_animation (toplevel, auto_hide); + else if (toplevel->priv->attached) + gtk_widget_hide (GTK_WIDGET (toplevel)); + +@@ -3528,7 +3529,7 @@ panel_toplevel_unhide (PanelToplevel *to + panel_toplevel_push_autohide_disabler (toplevel->priv->attach_toplevel); + + if (toplevel->priv->animate && GTK_WIDGET_REALIZED (toplevel)) +- panel_toplevel_start_animation (toplevel); ++ panel_toplevel_start_animation (toplevel, FALSE); + else if (toplevel->priv->attached) + gtk_widget_show (GTK_WIDGET (toplevel)); + diff --git a/gnome-panel.spec b/gnome-panel.spec index e6982e8..4468591 100644 --- a/gnome-panel.spec +++ b/gnome-panel.spec @@ -22,7 +22,7 @@ Summary: GNOME panel Name: gnome-panel Version: 2.22.0 -Release: 10%{?dist} +Release: 11%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-panel/2.22/%{name}-%{version}.tar.bz2 @@ -365,6 +365,9 @@ fi %{_datadir}/gtk-doc/html/* %changelog +* Sat Apr 5 2008 Matthias Clasen - 2.22.0-11 +- Handle PolicyKit errors returned from ConsoleKit + * Fri Apr 4 2008 Matthias Clasen - 2.22.0-10 - Ignore dbus errors when setting the time