After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622026 - Laptop suspends when I connect/disconnect AC
Laptop suspends when I connect/disconnect AC
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-06-18 19:32 UTC by David Tombs
Modified: 2010-06-22 08:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Tombs 2010-06-18 19:32:54 UTC
Originally reported at:
  https://bugs.launchpad.net/bugs/481312

The underlying problem here is that upower always reports lid closed for these particular laptops. (Upower report coming...) What makes this worse is that g-p-m initially assumes the lid is open, so it performs the lid closed action the first time it notices that it's closed.

WORKAROUND: change lid-closed action to Blank Screen in Power Management properties.

FIX is something like:

--- src/gpm-button.c
+++ src/gpm-button.c
@@ -322,8 +322,11 @@
 	button->priv->last_button = NULL;
 	button->priv->timer = g_timer_new ();
 
-	button->priv->lid_is_closed = FALSE;
 	button->priv->client = dkp_client_new ();
+	// sometimes lid is closed now, don't assume it's open (LP #481312)
+	g_object_get (button->priv->client,
+		      "lid-is-closed", &button->priv->lid_is_closed,
+		      NULL);
 	g_signal_connect (button->priv->client, "changed",
 			  G_CALLBACK (gpm_button_client_changed_cb), button);

So far my patch is untested, but I'll post here if it does fix the issue.
Comment 1 David Tombs 2010-06-22 00:04:55 UTC
An affected user reports that this patch fixes the issue.
Comment 2 Richard Hughes 2010-06-22 08:14:03 UTC
commit df44925b580ff0aa4a4f0619f3d50987c939506d
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Jun 22 09:13:29 2010 +0100

    Do not assume the lid is open at boot. Fixes #622026
    
    Inspired from a patch by David Tombs, many thanks.