r13636 - in /desktop/unstable/gnome-session/debian: changelog patches/03_powermanagement.patch patches/series
lool at users.alioth.debian.org
lool at users.alioth.debian.org
Tue Nov 27 12:17:16 UTC 2007
Author: lool
Date: Tue Nov 27 12:17:16 2007
New Revision: 13636
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=13636
Log:
* New patch, 03_powermanagement, shows hibernate option in logout dialog if
gdm supports it; will probably disappear with either the gnome-session or
the gdm rewrite.
Added:
desktop/unstable/gnome-session/debian/patches/03_powermanagement.patch
Modified:
desktop/unstable/gnome-session/debian/changelog
desktop/unstable/gnome-session/debian/patches/series
Modified: desktop/unstable/gnome-session/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/changelog?rev=13636&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/changelog (original)
+++ desktop/unstable/gnome-session/debian/changelog Tue Nov 27 12:17:16 2007
@@ -31,8 +31,11 @@
applications.
* New patch, 09_splash_hide, hides splash screen unconditionally when all
apps have been launched as to avoid it staying visible with broken apps.
-
- -- Loic Minier <lool at dooz.org> Tue, 27 Nov 2007 13:14:23 +0100
+ * New patch, 03_powermanagement, shows hibernate option in logout dialog if
+ gdm supports it; will probably disappear with either the gnome-session or
+ the gdm rewrite.
+
+ -- Loic Minier <lool at dooz.org> Tue, 27 Nov 2007 13:16:00 +0100
gnome-session (2.20.1-1) unstable; urgency=low
Added: desktop/unstable/gnome-session/debian/patches/03_powermanagement.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/03_powermanagement.patch?rev=13636&op=file
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/03_powermanagement.patch (added)
+++ desktop/unstable/gnome-session/debian/patches/03_powermanagement.patch Tue Nov 27 12:17:16 2007
@@ -1,0 +1,147 @@
+diff -Nur gnome-session-2.11.1.orig/gnome-session/gdm-logout-action.c gnome-session-2.11.1/gnome-session/gdm-logout-action.c
+--- gnome-session-2.11.1.orig/gnome-session/gdm-logout-action.c 2005-01-10 16:58:33.000000000 +0100
++++ gnome-session-2.11.1/gnome-session/gdm-logout-action.c 2005-05-19 12:01:19.153117568 +0200
+@@ -50,11 +50,14 @@
+ #define GDM_PROTOCOL_MSG_AUTHENTICATE "AUTH_LOCAL"
+ #define GDM_PROTOCOL_MSG_QUERY_ACTION "QUERY_LOGOUT_ACTION"
+ #define GDM_PROTOCOL_MSG_SET_ACTION "SET_LOGOUT_ACTION"
++#define GDM_PROTOCOL_MSG_SET_SUSPEND "SET_SUSPEND"
++#define GDM_PROTOCOL_MSG_SET_HIBERNATE "SET_HIBERNATE"
+
+ #define GDM_ACTION_STR_NONE "NONE"
+ #define GDM_ACTION_STR_SHUTDOWN "HALT"
+ #define GDM_ACTION_STR_REBOOT "REBOOT"
+ #define GDM_ACTION_STR_SUSPEND "SUSPEND"
++#define GDM_ACTION_STR_HIBERNATE "HIBERNATE"
+
+ typedef struct {
+ int fd;
+@@ -306,6 +309,8 @@
+ action = GDM_LOGOUT_ACTION_REBOOT;
+ else if (!strcmp (str, GDM_ACTION_STR_SUSPEND))
+ action = GDM_LOGOUT_ACTION_SUSPEND;
++ else if (!strcmp (str, GDM_ACTION_STR_HIBERNATE))
++ action = GDM_LOGOUT_ACTION_HIBERNATE;
+
+ data->available_actions |= action;
+ if (selected)
+@@ -375,8 +380,17 @@
+ action_str = GDM_ACTION_STR_REBOOT;
+ break;
+ case GDM_LOGOUT_ACTION_SUSPEND:
+- action_str = GDM_ACTION_STR_SUSPEND;
+- break;
++ response = gdm_send_protocol_msg (&gdm_protocol_data, GDM_PROTOCOL_MSG_SET_SUSPEND);
++ g_free (response);
++ gdm_protocol_data.last_update = 0;
++ gdm_shutdown_protocol_connection (&gdm_protocol_data);
++ return;
++ case GDM_LOGOUT_ACTION_HIBERNATE:
++ response = gdm_send_protocol_msg (&gdm_protocol_data, GDM_PROTOCOL_MSG_SET_HIBERNATE);
++ g_free (response);
++ gdm_protocol_data.last_update = 0;
++ gdm_shutdown_protocol_connection (&gdm_protocol_data);
++ return;
+ }
+
+ msg = g_strdup_printf (GDM_PROTOCOL_MSG_SET_ACTION " %s", action_str);
+diff -Nur gnome-session-2.11.1.orig/gnome-session/gdm-logout-action.h gnome-session-2.11.1/gnome-session/gdm-logout-action.h
+--- gnome-session-2.11.1.orig/gnome-session/gdm-logout-action.h 2005-01-10 16:58:33.000000000 +0100
++++ gnome-session-2.11.1/gnome-session/gdm-logout-action.h 2005-05-19 12:01:19.153117568 +0200
+@@ -38,7 +38,8 @@
+ GDM_LOGOUT_ACTION_NONE = 0,
+ GDM_LOGOUT_ACTION_SHUTDOWN = 1 << 0,
+ GDM_LOGOUT_ACTION_REBOOT = 1 << 1,
+- GDM_LOGOUT_ACTION_SUSPEND = 1 << 2
++ GDM_LOGOUT_ACTION_SUSPEND = 1 << 2,
++ GDM_LOGOUT_ACTION_HIBERNATE = 1 << 3
+ } GdmLogoutAction;
+
+ gboolean gdm_supports_logout_action (GdmLogoutAction action);
+diff -Nur gnome-session-2.11.1.orig/gnome-session/logout.c gnome-session-2.11.1/gnome-session/logout.c
+--- gnome-session-2.11.1.orig/gnome-session/logout.c 2005-05-06 12:17:12.000000000 +0200
++++ gnome-session-2.11.1/gnome-session/logout.c 2005-05-19 12:02:52.657902680 +0200
+@@ -329,13 +329,19 @@
+ gint response;
+ GtkWidget *halt = NULL;
+ GtkWidget *reboot = NULL;
++ GtkWidget *suspend = NULL;
++ GtkWidget *hibernate = NULL;
+ GtkWidget *invisible;
+ gboolean halt_supported = FALSE;
+ gboolean reboot_supported = FALSE;
++ gboolean suspend_supported = FALSE;
++ gboolean hibernate_supported = FALSE;
+ gboolean retval = FALSE;
+ gboolean save_active = FALSE;
+ gboolean halt_active = FALSE;
+ gboolean reboot_active = FALSE;
++ gboolean suspend_active = FALSE;
++ gboolean hibernate_active = FALSE;
+ GdmLogoutAction logout_action = GDM_LOGOUT_ACTION_NONE;
+ gboolean a11y_enabled;
+ GError *error = NULL;
+@@ -431,8 +437,10 @@
+
+ halt_supported = gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN);
+ reboot_supported = gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT);
++ suspend_supported = gdm_supports_logout_action (GDM_LOGOUT_ACTION_SUSPEND);
++ hibernate_supported = gdm_supports_logout_action (GDM_LOGOUT_ACTION_HIBERNATE);
+
+- if (halt_supported || reboot_supported)
++ if (halt_supported || reboot_supported || suspend_supported || hibernate_supported)
+ {
+ GtkWidget *title, *spacer;
+ GtkWidget *action_vbox, *hbox;
+@@ -482,6 +490,21 @@
+ gtk_box_pack_start (GTK_BOX (action_vbox), r, FALSE, FALSE, 0);
+ gtk_widget_show (r);
+ }
++
++ if (suspend_supported)
++ {
++ r = suspend = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (r), _("_Suspend the computer"));
++ gtk_box_pack_start (GTK_BOX (action_vbox), r, FALSE, FALSE, 0);
++ gtk_widget_show (r);
++ }
++
++ if (hibernate_supported)
++ {
++ r = hibernate = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (r), _("_Hibernate the computer"));
++ gtk_box_pack_start (GTK_BOX (action_vbox), r, FALSE, FALSE, 0);
++ gtk_widget_show (r);
++ }
++
+ }
+
+ gsm_center_window_on_screen (GTK_WINDOW (box), screen, monitor);
+@@ -517,6 +540,12 @@
+ if (reboot)
+ reboot_active = GTK_TOGGLE_BUTTON (reboot)->active;
+
++ if (suspend)
++ suspend_active = GTK_TOGGLE_BUTTON (suspend)->active;
++
++ if (hibernate)
++ hibernate_active = GTK_TOGGLE_BUTTON (hibernate)->active;
++
+ if (toggle_button)
+ save_active = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+@@ -551,6 +580,16 @@
+ logout_action = GDM_LOGOUT_ACTION_SHUTDOWN;
+ else if (reboot_active)
+ logout_action = GDM_LOGOUT_ACTION_REBOOT;
++ else if (suspend_active) {
++ logout_action = GDM_LOGOUT_ACTION_SUSPEND;
++ retval = FALSE;
++ break;
++ }
++ else if (hibernate_active) {
++ logout_action = GDM_LOGOUT_ACTION_HIBERNATE;
++ retval = FALSE;
++ break;
++ }
+ set_default_option (selected_option);
+ retval = TRUE;
+ break;
Modified: desktop/unstable/gnome-session/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/series?rev=13636&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/series (original)
+++ desktop/unstable/gnome-session/debian/patches/series Tue Nov 27 12:17:16 2007
@@ -1,5 +1,6 @@
01_ignore-gdm-lang.patch
02_gsd-spawn.patch
+03_powermanagement.patch
09_splash_hide.patch
10_update_notifier.patch
90_autoconf.patch
More information about the pkg-gnome-commits
mailing list