Description: Make gpm_button_is_lid_closed return a current value from DeviceKit
 instead of its own locally stored (outdated) value
Author: Chow Loong Jin <hyperair@ubuntu.com>
Forwarded: yes
Bug-Ubuntu: https://bugs.launchpad.net/bugs/425411
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=604362
Index: gnome-power-manager-2.28.1/src/gpm-button.c
===================================================================
--- gnome-power-manager-2.28.1.orig/src/gpm-button.c	2010-01-23 17:19:50.121879142 +0800
+++ gnome-power-manager-2.28.1/src/gpm-button.c	2010-01-23 17:22:19.369381263 +0800
@@ -255,8 +255,14 @@
 gboolean
 gpm_button_is_lid_closed (GpmButton *button)
 {
+	gboolean lid_is_closed;
+
 	g_return_val_if_fail (GPM_IS_BUTTON (button), FALSE);
-	return button->priv->lid_is_closed;
+
+	g_object_get (button->priv->client,
+		      "lid-is-closed", &lid_is_closed,
+		      NULL);
+	return lid_is_closed;
 }
 
 /**
