[gnome-settings-daemon/docking-stations] Connect to 'changed' on UpClient to detect changes in the lid state
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/docking-stations] Connect to 'changed' on UpClient to detect changes in the lid state
- Date: Wed, 16 Nov 2011 20:40:55 +0000 (UTC)
commit c169f723f6830c0f9961eaabd862fe022340b658
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 16 08:28:08 2011 -0600
Connect to 'changed' on UpClient to detect changes in the lid state
When you open/close the lid, we *do* get a 'changed' signal, but not
a 'notify::lid-is-closed'. So, we'll connect to the changed signal
instead and assume that the (lack of the) latter is a bug.
Signed-off-by: Federico Mena Quintero <federico gnome org>
plugins/xrandr/gsd-xrandr-manager.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index dd6e81b..0b08981 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -1911,7 +1911,7 @@ turn_off_laptop_display (GsdXrandrManager *manager, guint32 timestamp)
}
static void
-power_client_notify_lid_is_closed_cb (GObject *object, GParamSpec *pspec, gpointer data)
+power_client_changed_cb (UpClient *client, gpointer data)
{
GsdXrandrManager *manager = data;
GsdXrandrManagerPrivate *priv = manager->priv;
@@ -1952,7 +1952,7 @@ gsd_xrandr_manager_start (GsdXrandrManager *manager,
g_signal_connect (manager->priv->rw_screen, "changed", G_CALLBACK (on_randr_event), manager);
manager->priv->upower_client = up_client_new ();
- g_signal_connect (manager->priv->upower_client, "notify::lid-is-closed", G_CALLBACK (power_client_notify_lid_is_closed_cb), manager);
+ g_signal_connect (manager->priv->upower_client, "changed", G_CALLBACK (power_client_changed_cb), manager);
manager->priv->laptop_lid_is_closed = up_client_get_lid_is_closed (manager->priv->upower_client);
log_msg ("State of screen at startup:\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]