summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@fedoraproject.org>2008-03-16 03:52:57 +0000
committerMatthias Clasen <mclasen@fedoraproject.org>2008-03-16 03:52:57 +0000
commit66f73496423abc508f45f5d923398dce03b48077 (patch)
treeb8b243cd90a87ebd6a77a8fd4e2f98f974cc3e97
parent1e2242685f1ee7b5a9940485b2aaa72f3f765c08 (diff)
downloadgnome-panel-66f73496423abc508f45f5d923398dce03b48077.tar.gz
gnome-panel-66f73496423abc508f45f5d923398dce03b48077.tar.xz
gnome-panel-66f73496423abc508f45f5d923398dce03b48077.zip
Don't save sessions unconditionallygnome-panel-2_22_0-4_fc9
-rw-r--r--gnome-panel-2.22.0-ck-shutdown.patch (renamed from gnome-panel-2.21.5-ck-shutdown.patch)397
-rw-r--r--gnome-panel.spec7
-rw-r--r--polkit-fix.patch107
-rw-r--r--sunrise.patch81
4 files changed, 205 insertions, 387 deletions
diff --git a/gnome-panel-2.21.5-ck-shutdown.patch b/gnome-panel-2.22.0-ck-shutdown.patch
index ecc9603..2458fb3 100644
--- a/gnome-panel-2.21.5-ck-shutdown.patch
+++ b/gnome-panel-2.22.0-ck-shutdown.patch
@@ -1,7 +1,17 @@
-Index: gnome-panel/gnome-panel/panel-consolekit.c
-===================================================================
---- gnome-panel/gnome-panel/panel-consolekit.c (revision 0)
-+++ gnome-panel/gnome-panel/panel-consolekit.c (revision 0)
+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);
+
+ G_END_DECLS
+
+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 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
@@ -621,92 +631,40 @@ Index: gnome-panel/gnome-panel/panel-consolekit.c
+
+ return g_object_ref (manager);
+}
-Index: gnome-panel/gnome-panel/panel-consolekit.h
-===================================================================
---- gnome-panel/gnome-panel/panel-consolekit.h (revision 0)
-+++ gnome-panel/gnome-panel/panel-consolekit.h (revision 0)
-@@ -0,0 +1,77 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-+ *
-+ * Copyright (C) 2008 Jon McCann <jmccann@redhat.com>
-+ *
-+ * 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 <jmccann@redhat.com>
-+ */
-+
-+#ifndef PANEL_CONSOLEKIT_H
-+#define PANEL_CONSOLEKIT_H
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+
-+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 */
-Index: gnome-panel/gnome-panel/panel-logout.c
-===================================================================
---- gnome-panel/gnome-panel/panel-logout.c (revision 10951)
-+++ gnome-panel/gnome-panel/panel-logout.c (working copy)
+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 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
@@ -1,4 +1,5 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
@@ -714,15 +672,18 @@ Index: gnome-panel/gnome-panel/panel-logout.c
* panel-logout.c:
*
* Copyright (C) 2006 Vincent Untz
-@@ -35,6 +36,7 @@
+@@ -35,8 +36,10 @@
#include "panel-logout.h"
#include "panel-gdm.h"
#include "panel-power-manager.h"
+#include "panel-consolekit.h"
#include "panel-session.h"
#include "panel-icon-names.h"
++#include "panel-gconf.h"
+
+ #define PANEL_LOGOUT_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_LOGOUT_DIALOG, PanelLogoutDialogPrivate))
-@@ -55,6 +57,7 @@ struct _PanelLogoutDialogPrivate {
+@@ -55,6 +58,7 @@ struct _PanelLogoutDialogPrivate {
PanelLogoutDialogType type;
PanelPowerManager *power_manager;
@@ -730,7 +691,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
int timeout;
unsigned int timeout_id;
-@@ -76,7 +79,7 @@ enum {
+@@ -76,7 +80,7 @@ enum {
};
G_DEFINE_TYPE (PanelLogoutDialog, panel_logout, GTK_TYPE_MESSAGE_DIALOG);
@@ -739,7 +700,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
panel_logout_set_property (GObject *object,
guint prop_id,
const GValue *value,
-@@ -91,7 +94,7 @@ panel_logout_set_property (GObject
+@@ -91,7 +95,7 @@ panel_logout_set_property (GObject
}
}
@@ -748,7 +709,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
panel_logout_get_property (GObject *object,
guint prop_id,
GValue *value,
-@@ -130,6 +133,59 @@ panel_logout_class_init (PanelLogoutDial
+@@ -130,6 +134,59 @@ panel_logout_class_init (PanelLogoutDial
}
static void
@@ -808,7 +769,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
panel_logout_init (PanelLogoutDialog *logout_dialog)
{
logout_dialog->priv = PANEL_LOGOUT_DIALOG_GET_PRIVATE (logout_dialog);
-@@ -146,6 +202,10 @@ panel_logout_init (PanelLogoutDialog *lo
+@@ -146,6 +203,10 @@ panel_logout_init (PanelLogoutDialog *lo
GTK_WIN_POS_CENTER_ALWAYS);
logout_dialog->priv->power_manager = panel_get_power_manager ();
@@ -819,7 +780,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
g_signal_connect (logout_dialog, "destroy",
G_CALLBACK (panel_logout_destroy), NULL);
-@@ -163,37 +223,120 @@ panel_logout_destroy (PanelLogoutDialog
+@@ -163,37 +224,129 @@ panel_logout_destroy (PanelLogoutDialog
g_object_unref (logout_dialog->priv->power_manager);
logout_dialog->priv->power_manager = NULL;
@@ -886,11 +847,20 @@ Index: gnome-panel/gnome-panel/panel-logout.c
+}
+
+static void
++maybe_request_session_save (void)
++{
++ if (gconf_client_get_bool (panel_gconf_get_client (),
++ "/apps/gnome-session/options/auto_save_session",
++ NULL))
++ panel_session_request_save ();
++}
++
++static void
+do_request_reboot (PanelConsolekit *consolekit)
+{
+ if (panel_consolekit_can_restart (consolekit)) {
+ gdm_set_logout_action (GDM_LOGOUT_ACTION_NONE);
-+ panel_session_request_save ();
++ maybe_request_session_save ();
+ panel_consolekit_attempt_restart (consolekit);
+ } else {
+ gdm_set_logout_action (GDM_LOGOUT_ACTION_REBOOT);
@@ -903,7 +873,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
+{
+ if (panel_consolekit_can_stop (consolekit)) {
+ gdm_set_logout_action (GDM_LOGOUT_ACTION_NONE);
-+ panel_session_request_save ();
++ maybe_request_session_save ();
+ panel_consolekit_attempt_stop (consolekit);
+ } else {
+ gdm_set_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN);
@@ -946,7 +916,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
break;
case PANEL_LOGOUT_RESPONSE_STD:
if (panel_power_manager_can_hibernate (power_manager))
-@@ -210,6 +353,7 @@ panel_logout_response (PanelLogoutDialog
+@@ -210,6 +363,7 @@ panel_logout_response (PanelLogoutDialog
g_assert_not_reached ();
}
g_object_unref (power_manager);
@@ -954,7 +924,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
}
static gboolean
-@@ -361,7 +505,7 @@ panel_logout_new (PanelLogoutDialogType
+@@ -363,7 +517,7 @@ panel_logout_new (PanelLogoutDialogType
_("_Hibernate"),
PANEL_LOGOUT_RESPONSE_STD);
@@ -963,7 +933,7 @@ Index: gnome-panel/gnome-panel/panel-logout.c
gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
_("_Restart"),
PANEL_LOGOUT_RESPONSE_REBOOT);
-@@ -370,7 +514,7 @@ panel_logout_new (PanelLogoutDialogType
+@@ -372,7 +526,7 @@ panel_logout_new (PanelLogoutDialogType
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
@@ -972,94 +942,90 @@ Index: gnome-panel/gnome-panel/panel-logout.c
gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
_("_Shut Down"),
PANEL_LOGOUT_RESPONSE_SHUTDOWN);
-Index: gnome-panel/gnome-panel/panel-logout.h
-===================================================================
---- gnome-panel/gnome-panel/panel-logout.h (revision 10951)
-+++ gnome-panel/gnome-panel/panel-logout.h (working copy)
-@@ -57,6 +57,8 @@ struct _PanelLogoutDialogClass {
-
- GType panel_logout_get_type (void) G_GNUC_CONST;
-
-+gboolean panel_logout_supports_shutdown_reboot (void);
+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 <jmccann@redhat.com>
++ *
++ * 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 <jmccann@redhat.com>
++ */
+
- void panel_logout_new (PanelLogoutDialogType type,
- GdkScreen *screen,
- guint32 activate_time);
-Index: gnome-panel/gnome-panel/panel-toplevel.c
-===================================================================
---- gnome-panel/gnome-panel/panel-toplevel.c (revision 10951)
-+++ gnome-panel/gnome-panel/panel-toplevel.c (working copy)
-@@ -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));
-
-Index: gnome-panel/gnome-panel/panel-session.c
-===================================================================
---- gnome-panel/gnome-panel/panel-session.c (revision 10951)
-+++ gnome-panel/gnome-panel/panel-session.c (working copy)
-@@ -60,6 +60,34 @@ panel_session_request_logout (void)
- recursion_guard--;
- }
-
-+void
-+panel_session_request_save (void)
-+{
-+ GnomeClient *client;
-+ static int recursion_guard = 0;
++#ifndef PANEL_CONSOLEKIT_H
++#define PANEL_CONSOLEKIT_H
+
-+ if (recursion_guard)
-+ return;
++#include <glib.h>
++#include <glib-object.h>
+
-+ recursion_guard++;
++G_BEGIN_DECLS
+
-+ if (!(client = gnome_master_client ()))
-+ return;
++#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 ())
+
-+ /* Only request a Global save. We only want a Local
-+ * save if the user selects 'Save current setup'
-+ * from the dialog.
-+ */
-+ gnome_client_request_save (client,
-+ GNOME_SAVE_GLOBAL,
-+ FALSE,
-+ GNOME_INTERACT_NONE,
-+ TRUE, /* do not use the gnome-session gui */
-+ TRUE);
++typedef struct _PanelConsolekit PanelConsolekit;
++typedef struct _PanelConsolekitClass PanelConsolekitClass;
++typedef struct _PanelConsolekitPrivate PanelConsolekitPrivate;
++typedef enum _PanelConsolekitError PanelConsolekitError;
+
-+ recursion_guard--;
-+}
++struct _PanelConsolekit {
++ GObject parent;
++ PanelConsolekitPrivate *priv;
++};
+
- static void
- panel_session_handle_die_request (GnomeClient *client)
- {
-Index: gnome-panel/gnome-panel/panel-action-button.c
-===================================================================
---- gnome-panel/gnome-panel/panel-action-button.c (revision 10951)
-+++ gnome-panel/gnome-panel/panel-action-button.c (working copy)
++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"
@@ -1078,22 +1044,21 @@ Index: gnome-panel/gnome-panel/panel-action-button.c
}
/* Run Application
-Index: gnome-panel/gnome-panel/panel-session.h
-===================================================================
---- gnome-panel/gnome-panel/panel-session.h (revision 10951)
-+++ gnome-panel/gnome-panel/panel-session.h (working copy)
-@@ -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/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
+@@ -57,6 +57,8 @@ struct _PanelLogoutDialogClass {
- G_END_DECLS
+ GType panel_logout_get_type (void) G_GNUC_CONST;
-Index: gnome-panel/gnome-panel/Makefile.am
-===================================================================
---- gnome-panel/gnome-panel/Makefile.am (revision 10951)
-+++ gnome-panel/gnome-panel/Makefile.am (working copy)
++gboolean panel_logout_supports_shutdown_reboot (void);
++
+ 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) \
@@ -1126,3 +1091,41 @@ Index: gnome-panel/gnome-panel/Makefile.am
$(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
+@@ -60,6 +60,34 @@ panel_session_request_logout (void)
+ recursion_guard--;
+ }
+
++void
++panel_session_request_save (void)
++{
++ GnomeClient *client;
++ static int recursion_guard = 0;
++
++ if (recursion_guard)
++ return;
++
++ recursion_guard++;
++
++ if (!(client = gnome_master_client ()))
++ return;
++
++ /* Only request a Global save. We only want a Local
++ * save if the user selects 'Save current setup'
++ * from the dialog.
++ */
++ gnome_client_request_save (client,
++ GNOME_SAVE_GLOBAL,
++ FALSE,
++ GNOME_INTERACT_NONE,
++ TRUE, /* do not use the gnome-session gui */
++ TRUE);
++
++ recursion_guard--;
++}
++
+ static void
+ panel_session_handle_die_request (GnomeClient *client)
+ {
diff --git a/gnome-panel.spec b/gnome-panel.spec
index a651434..d0e5991 100644
--- a/gnome-panel.spec
+++ b/gnome-panel.spec
@@ -22,7 +22,7 @@
Summary: GNOME panel
Name: gnome-panel
Version: 2.22.0
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-panel/2.22/%{name}-%{version}.tar.bz2
@@ -108,7 +108,7 @@ Patch10: preferred-apps.patch
Patch11: applet-error.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=511881
-Patch14: gnome-panel-2.21.5-ck-shutdown.patch
+Patch14: gnome-panel-2.22.0-ck-shutdown.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=520111
Patch24: gnome-panel-2.21.92-allow-spurious-view-done-signals.patch
@@ -353,6 +353,9 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
+* Sat Mar 15 2008 Matthias Clasen <mclasen@redhat.com> - 2.22.0-4
+- Only save the session when the users wants it
+
* Fri Mar 14 2008 Matthias Clasen <mclasen@redhat.com> - 2.22.0-3
- Populate the location list before showing the preference window
diff --git a/polkit-fix.patch b/polkit-fix.patch
deleted file mode 100644
index 2d07445..0000000
--- a/polkit-fix.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-diff -up gnome-panel-2.21.92/applets/clock/set-timezone.c.polkit-fix gnome-panel-2.21.92/applets/clock/set-timezone.c
---- gnome-panel-2.21.92/applets/clock/set-timezone.c.polkit-fix 2008-03-03 12:10:34.000000000 -0500
-+++ gnome-panel-2.21.92/applets/clock/set-timezone.c 2008-03-03 12:10:50.000000000 -0500
-@@ -75,6 +75,40 @@ get_system_bus (void)
- return bus;
- }
-
-+static gboolean
-+pk_io_watch_have_data (GIOChannel *channel, GIOCondition condition, gpointer user_data)
-+{
-+ int fd;
-+ PolKitContext *pk_context = user_data;
-+ fd = g_io_channel_unix_get_fd (channel);
-+ polkit_context_io_func (pk_context, fd);
-+ return TRUE;
-+}
-+
-+static int
-+pk_io_add_watch_fn (PolKitContext *pk_context, int fd)
-+{
-+ guint id = 0;
-+ GIOChannel *channel;
-+ channel = g_io_channel_unix_new (fd);
-+ if (channel == NULL)
-+ goto out;
-+ id = g_io_add_watch (channel, G_IO_IN, pk_io_watch_have_data, pk_context);
-+ if (id == 0) {
-+ g_io_channel_unref (channel);
-+ goto out;
-+ }
-+ g_io_channel_unref (channel);
-+out:
-+ return id;
-+}
-+
-+static void
-+pk_io_remove_watch_fn (PolKitContext *pk_context, int watch_id)
-+{
-+ g_source_remove (watch_id);
-+}
-+
- static PolKitContext *
- get_pk_context (void)
- {
-@@ -82,6 +116,9 @@ get_pk_context (void)
-
- if (pk_context == NULL) {
- pk_context = polkit_context_new ();
-+// polkit_context_set_io_watch_functions (pk_context,
-+// pk_io_add_watch_fn,
-+// pk_io_remove_watch_fn);
- if (!polkit_context_init (pk_context, NULL)) {
- polkit_context_unref (pk_context);
- pk_context = NULL;
-@@ -126,22 +163,19 @@ can_do (const gchar *pk_action_id)
- pk_result = polkit_context_can_caller_do_action (pk_context, pk_action, pk_caller);
-
- switch (pk_result) {
-- default:
- case POLKIT_RESULT_UNKNOWN:
- case POLKIT_RESULT_NO:
- res = 0;
- break;
-- case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
-- case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
-- case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
-- case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
-- case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
-- case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
-- res = 1;
-- break;
- case POLKIT_RESULT_YES:
- res = 2;
- break;
-+ default:
-+ /* This covers all the POLKIT_RESULT_ONLY_VIA_[SELF|ADMIN]_AUTH_* cases as more of these
-+ * may be added in the future.
-+ */
-+ res = 1;
-+ break;
- }
-
- out:
-diff -up gnome-panel-2.21.92/applets/clock/clock.c.polkit-fix gnome-panel-2.21.92/applets/clock/clock.c
---- gnome-panel-2.21.92/applets/clock/clock.c.polkit-fix 2008-03-03 12:10:23.000000000 -0500
-+++ gnome-panel-2.21.92/applets/clock/clock.c 2008-03-03 12:10:45.000000000 -0500
-@@ -2266,11 +2266,15 @@ clock_migrate_to_26 (ClockData *clock)
- else if (hourformat == 24)
- clock->format = CLOCK_FORMAT_24;
-
-- panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
-- KEY_FORMAT,
-- gconf_enum_to_string (format_type_enum_map,
-- clock->format),
-- NULL);
-+ /* It's still possible that we have none of the old keys, in which case
-+ * we're not migrating from 2.6, but the config is simply wrong. So
-+ * don't set the format key in this case. */
-+ if (clock->format != CLOCK_FORMAT_INVALID)
-+ panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
-+ KEY_FORMAT,
-+ gconf_enum_to_string (format_type_enum_map,
-+ clock->format),
-+ NULL);
- }
-
- static void
diff --git a/sunrise.patch b/sunrise.patch
deleted file mode 100644
index 4a27c96..0000000
--- a/sunrise.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff -up gnome-panel-2.21.91/applets/clock/clock-location-tile.c.sunrise gnome-panel-2.21.91/applets/clock/clock-location-tile.c
---- gnome-panel-2.21.91/applets/clock/clock-location-tile.c.sunrise 2008-02-22 12:56:42.000000000 -0500
-+++ gnome-panel-2.21.91/applets/clock/clock-location-tile.c 2008-02-22 13:08:01.000000000 -0500
-@@ -534,13 +534,14 @@ clock_location_tile_refresh (ClockLocati
- }
-
- void
--weather_info_setup_tooltip (WeatherInfo *info, GtkTooltip *tooltip)
-+weather_info_setup_tooltip (WeatherInfo *info, ClockLocation *location, GtkTooltip *tooltip)
- {
- GdkPixbuf *pixbuf = NULL;
- GtkIconTheme *theme = NULL;
- const gchar *conditions, *temp, *apparent, *wind;
- gchar *line1, *line2, *line3, *line4, *tip;
- const gchar *icon_name;
-+ const gchar *sys_timezone;
-
- icon_name = weather_info_get_icon_name (info);
- theme = gtk_icon_theme_get_default ();
-@@ -571,9 +572,20 @@ weather_info_setup_tooltip (WeatherInfo
- else
- line3 = g_strdup ("");
-
-+ /* FIXME: we need libgweather to give us the time,
-+ * not just a formatted string
-+ */
-+ sys_timezone = getenv ("TZ");
-+ setenv ("TZ", clock_location_get_timezone (location), 1);
-+ tzset ();
- line4 = g_strdup_printf (_("Sunrise: %s / Sunset: %s"),
- weather_info_get_sunrise (info),
- weather_info_get_sunset (info));
-+ if (sys_timezone)
-+ setenv ("TZ", sys_timezone, 1);
-+ else
-+ unsetenv ("TZ");
-+ tzset ();
-
- tip = g_strdup_printf ("<b>%s</b>\n%s\n%s%s", line1, line2, line3, line4);
- gtk_tooltip_set_markup (tooltip, tip);
-@@ -601,7 +613,7 @@ weather_tooltip (GtkWidget *widget,
- if (!info || !weather_info_is_valid (info))
- return FALSE;
-
-- weather_info_setup_tooltip (info, tooltip);
-+ weather_info_setup_tooltip (info, priv->location, tooltip);
-
- return TRUE;
- }
-diff -up gnome-panel-2.21.91/applets/clock/clock.c.sunrise gnome-panel-2.21.91/applets/clock/clock.c
---- gnome-panel-2.21.91/applets/clock/clock.c.sunrise 2008-02-22 12:56:42.000000000 -0500
-+++ gnome-panel-2.21.91/applets/clock/clock.c 2008-02-22 12:56:42.000000000 -0500
-@@ -1341,12 +1341,13 @@ weather_tooltip (GtkWidget *widget,
- locations = cd->locations;
-
- for (l = locations; l; l = l->next) {
-- if (clock_location_is_current (l->data)) {
-- info = clock_location_get_weather_info (l->data);
-+ ClockLocation *location = l->data;
-+ if (clock_location_is_current (location)) {
-+ info = clock_location_get_weather_info (location);
- if (!info || !weather_info_is_valid (info))
- continue;
-
-- weather_info_setup_tooltip (info, tooltip);
-+ weather_info_setup_tooltip (info, location, tooltip);
-
- return TRUE;
- }
-diff -up gnome-panel-2.21.91/applets/clock/clock-location-tile.h.sunrise gnome-panel-2.21.91/applets/clock/clock-location-tile.h
---- gnome-panel-2.21.91/applets/clock/clock-location-tile.h.sunrise 2008-02-22 12:56:42.000000000 -0500
-+++ gnome-panel-2.21.91/applets/clock/clock-location-tile.h 2008-02-22 12:56:42.000000000 -0500
-@@ -37,7 +37,7 @@ ClockLocationTile *clock_location_tile_n
-
- ClockLocation *clock_location_tile_get_location (ClockLocationTile *this);
-
--void weather_info_setup_tooltip (WeatherInfo *info, GtkTooltip *tip);
-+void weather_info_setup_tooltip (WeatherInfo *info, ClockLocation *location, GtkTooltip *tip);
-
- void clock_location_tile_refresh (ClockLocationTile *this,
- gboolean force_refresh);