[Pkg-utopia-commits] r1102 -
packages/unstable/gnome-power-manager/debian/patches
Riccardo Setti
giskard-guest at costa.debian.org
Tue Oct 24 18:52:45 UTC 2006
Author: giskard-guest
Date: 2006-10-24 18:52:45 +0000 (Tue, 24 Oct 2006)
New Revision: 1102
Added:
packages/unstable/gnome-power-manager/debian/patches/55-lid-state-tracking.patch
packages/unstable/gnome-power-manager/debian/patches/56-disable-session-save-on-shutdown.patch
Log:
added the patches
Added: packages/unstable/gnome-power-manager/debian/patches/55-lid-state-tracking.patch
===================================================================
--- packages/unstable/gnome-power-manager/debian/patches/55-lid-state-tracking.patch (rev 0)
+++ packages/unstable/gnome-power-manager/debian/patches/55-lid-state-tracking.patch 2006-10-24 18:52:45 UTC (rev 1102)
@@ -0,0 +1,120 @@
+diff -Nur gnome-power-manager-2.15.90/src/gpm-hal.c gnome-power-manager-2.15.90.new/src/gpm-hal.c
+--- gnome-power-manager-2.15.90/src/gpm-hal.c 2006-07-22 16:38:40.000000000 +0200
++++ gnome-power-manager-2.15.90.new/src/gpm-hal.c 2006-07-24 15:18:11.000000000 +0200
+@@ -214,6 +214,40 @@
+ return can_suspend;
+ }
+
++/** Finds out if HAL indicates it can monitor lid status
++ *
++ * @return TRUE if hal has state information for the lid
++ */
++gboolean
++gpm_hal_lid_is_closed_capable (GpmHal *hal)
++{
++ gboolean exists;
++ gboolean can_monitor;
++ exists = gpm_hal_device_get_bool (hal, HAL_ACPI_LID_SWITCH,
++ "button.has_state",
++ &can_monitor);
++ return exists && can_monitor;
++}
++
++/** Assuming we can monitor, returns the status of the lid switch
++ *
++ * @return TRUE if lid is closed
++ */
++gboolean
++gpm_hal_lid_is_closed (GpmHal *hal)
++{
++ gboolean exists;
++ gboolean lid_state;
++ exists = gpm_hal_device_get_bool (hal, HAL_ACPI_LID_SWITCH,
++ "button.state.value",
++ &lid_state);
++ if (!exists)
++ gpm_warning ("gpm_hal_lid_is_closed: button.state.value does not exist in acpi_LID object");
++ gpm_debug ("Lid status: %s", (exists && lid_state)?"closed":"open");
++ return exists && lid_state;
++}
++
++
+ /**
+ * gpm_hal_can_hibernate:
+ *
+diff -Nur gnome-power-manager-2.15.90/src/gpm-hal.h gnome-power-manager-2.15.90.new/src/gpm-hal.h
+--- gnome-power-manager-2.15.90/src/gpm-hal.h 2006-07-12 00:19:30.000000000 +0200
++++ gnome-power-manager-2.15.90.new/src/gpm-hal.h 2006-07-24 15:18:11.000000000 +0200
+@@ -33,6 +33,7 @@
+ #define HAL_DBUS_INTERFACE_LAPTOP_PANEL "org.freedesktop.Hal.Device.LaptopPanel"
+ #define HAL_DBUS_INTERFACE_POWER "org.freedesktop.Hal.Device.SystemPowerManagement"
+ #define HAL_ROOT_COMPUTER "/org/freedesktop/Hal/devices/computer"
++#define HAL_ACPI_LID_SWITCH "/org/freedesktop/Hal/devices/acpi_LID"
+
+ #define GPM_TYPE_HAL (gpm_hal_get_type ())
+ #define GPM_HAL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GPM_TYPE_HAL, GpmHal))
+@@ -96,6 +97,8 @@
+ gboolean gpm_hal_is_running (GpmHal *hal);
+ gboolean gpm_hal_is_laptop (GpmHal *hal);
+ gboolean gpm_hal_is_on_ac (GpmHal *hal);
++gboolean gpm_hal_lid_is_closed (GpmHal *hal);
++gboolean gpm_hal_lid_is_closed_capable (GpmHal *hal);
+ gboolean gpm_hal_can_suspend (GpmHal *hal);
+ gboolean gpm_hal_suspend (GpmHal *hal,
+ gint wakeup);
+diff -Nur gnome-power-manager-2.15.90/src/gpm-manager.c gnome-power-manager-2.15.90.new/src/gpm-manager.c
+--- gnome-power-manager-2.15.90/src/gpm-manager.c 2006-07-24 15:18:10.000000000 +0200
++++ gnome-power-manager-2.15.90.new/src/gpm-manager.c 2006-07-24 15:44:33.000000000 +0200
+@@ -126,6 +126,7 @@
+
+ gboolean use_time_to_notify;
+ gboolean lid_is_closed;
++ gboolean lid_can_use_hal;
+ gboolean done_notify_fully_charged;
+ gboolean enable_beeping;
+ gboolean ignore_inhibits;
+@@ -359,6 +360,15 @@
+ return TRUE;
+ }
+
++static gboolean
++gpm_manager_lid_is_closed(GpmManager *manager)
++{
++ /* Can we use hal? */
++ if (manager->priv->lid_can_use_hal)
++ return gpm_hal_lid_is_closed (manager->priv->hal);
++ return manager->priv->lid_is_closed;
++}
++
+ /**
+ * get_stock_id:
+ * @manager: This manager class instance
+@@ -1351,7 +1361,7 @@
+ the screen when the user moves the mouse on systems that do not
+ support hardware blanking.
+ Details are here: https://launchpad.net/malone/bugs/22522 */
+- if (manager->priv->lid_is_closed) {
++ if (gpm_manager_lid_is_closed(manager)) {
+ gpm_debug ("lid is closed, so we are ignoring idle state changes");
+ return;
+ }
+@@ -1715,7 +1725,7 @@
+ gboolean event_when_closed;
+ event_when_closed = gconf_client_get_bool (manager->priv->gconf_client,
+ GPM_PREF_BATT_EVENT_WHEN_CLOSED, NULL);
+- if (event_when_closed && (!on_ac) && manager->priv->lid_is_closed) {
++ if (event_when_closed && (!on_ac) && gpm_manager_lid_is_closed (manager)) {
+ manager_policy_do (manager,
+ GPM_PREF_BATTERY_BUTTON_LID,
+ _("the lid has been closed, and the ac adapter "
+@@ -2575,6 +2585,10 @@
+
+ /* FIXME: We shouldn't assume the lid is open at startup */
+ manager->priv->lid_is_closed = FALSE;
++ manager->priv->lid_can_use_hal = gpm_hal_lid_is_closed_capable (manager->priv->hal);
++ if (manager->priv->lid_can_use_hal)
++ gpm_debug("Using hal to monitor lid status");
++ manager->priv->lid_is_closed = gpm_manager_lid_is_closed (manager);
+
+ /* we need these to refresh the tooltip and icon */
+ g_signal_connect (manager->priv->power, "battery-removed",
Added: packages/unstable/gnome-power-manager/debian/patches/56-disable-session-save-on-shutdown.patch
===================================================================
--- packages/unstable/gnome-power-manager/debian/patches/56-disable-session-save-on-shutdown.patch (rev 0)
+++ packages/unstable/gnome-power-manager/debian/patches/56-disable-session-save-on-shutdown.patch 2006-10-24 18:52:45 UTC (rev 1102)
@@ -0,0 +1,29 @@
+diff -Nur gnome-power-manager-2.15.90/src/gpm-manager.c gnome-power-manager-2.15.90.new/src/gpm-manager.c
+--- gnome-power-manager-2.15.90/src/gpm-manager.c 2006-07-24 17:16:28.000000000 +0200
++++ gnome-power-manager-2.15.90.new/src/gpm-manager.c 2006-07-24 17:19:11.000000000 +0200
+@@ -1047,10 +1049,11 @@
+ return FALSE;
+ }
+
++ /* This confuses too many people, so we commented it out
+ gnome_client_request_save (gnome_master_client (),
+ GNOME_SAVE_GLOBAL,
+ FALSE, GNOME_INTERACT_NONE, FALSE, TRUE);
+-
++ */
+ gpm_hal_shutdown (manager->priv->hal);
+ ret = TRUE;
+
+@@ -1080,10 +1083,11 @@
+ return FALSE;
+ }
+
++ /* This confuses too many people, so we commented it out
+ gnome_client_request_save (gnome_master_client (),
+ GNOME_SAVE_GLOBAL,
+ FALSE, GNOME_INTERACT_NONE, FALSE, TRUE);
+-
++ */
+ gpm_hal_reboot (manager->priv->hal);
+ ret = TRUE;
+
More information about the Pkg-utopia-commits
mailing list