[Vivid] laptop do not suspend if lid is closed before the AC is unplugged

Bug #1456745 reported by Kim Nguyễn
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-settings-daemon (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Consider the following PM configuration, set by the user from the control-center

* on Battery, when lid is closed, suspend
* on AC, when lif is closed, do nothing

On Trusty and Utopic, if the user first closes the lid and then unplugs its laptop, gsd-power-mangager correctly applies the "lid closed" policy in response to the AC unplug event

On Vivid, the laptop does not suspend.

I have tested it straight from the live-usb images. I booted on Trusty and Utopic, changed the default policy (which is to suspend even on AC on lid closed), closed the lid and then unplugged.

The same test with a Vivid live-usb images exhibits the bad behaviour.

After some digging I worked my way from ACPI events to Logind to Upower to unity-settings-manager.

I belive the change in behaviour occurend when gsd-power-manager was updated to UPower 0.99, that is:

http://bazaar.launchpad.net/~unity-settings-daemon-team/unity-settings-daemon/trunk/revision/4060

The solution (at least a proof of concept) seems to also trigger the lid callback on AC events.

I'm attaching a trivial patch (lightly tested) which restores the expected behaviour. I'll upload it to my ppa for wider testing.

Note that this problem might also affect gnome-settings-daemon although I'm not sure whether gnome relies more on logind for power policy and therefore is not affected…

Tags: patch

Related branches

Revision history for this message
Kim Nguyễn (kim.nguyen) wrote :
Revision history for this message
Kim Nguyễn (kim.nguyen) wrote :

A patched unity-settings-daemon is available in my ppa.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch that restores the correct beahviour" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in unity-settings-daemon (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Terry (mterry) wrote :

Thank you for the patch! I've tested it and it works great. I converted the patch into a bzr branch which will be easier to land:
https://code.launchpad.net/~mterry/unity-settings-daemon/lid-power-event/+merge/271383

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-settings-daemon - 15.04.1+15.10.20150917-0ubuntu1

---------------
unity-settings-daemon (15.04.1+15.10.20150917-0ubuntu1) wily; urgency=medium

  [ Michael Terry ]
  * Notice when unplugging a closed laptop and apply the correct policy.
    (LP: #1456745)

 -- Iain Lane <email address hidden> Thu, 17 Sep 2015 09:49:32 +0000

Changed in unity-settings-daemon (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.