Bug 82485 - RFE: Allow handling of laptop lid switch even if multiple monitors are detected
Summary: RFE: Allow handling of laptop lid switch even if multiple monitors are detected
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
: 80309 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-12 00:30 UTC by Ben Wolsieffer
Modified: 2014-10-09 12:29 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Adds a HandleLidSwitchDocked option to logind.conf (6.79 KB, patch)
2014-08-18 20:46 UTC, Ben Wolsieffer
Details | Splinter Review
Adds a HandleLidSwitchDocked option to logind.conf + documentation (10.47 KB, patch)
2014-08-19 01:37 UTC, Ben Wolsieffer
Details | Splinter Review

Description Ben Wolsieffer 2014-08-12 00:30:10 UTC
Recently, the change was made to prevent laptops using systemd from suspending when the lid is closed if an external monitor was detected. This behavior is useful if one wants to use a docking station.

I would like to propose that this feature should become configurable so that users  can allow the laptop to sleep even if it is docked if they want to.

This seems fairly easy to implement; an boolean option with a name like "LidSwitchSuspendIfDocked" could be added with the default being "no", so the current functionality will remain for users who want it, but it would still be possible to suspend regardless of docking state (w/o using things like acpid).
Comment 1 Ben Wolsieffer 2014-08-18 20:46:17 UTC
Created attachment 104843 [details] [review]
Adds a HandleLidSwitchDocked option to logind.conf

This patch makes it possible to define the lid switch closing behavior when the laptop is docked.

By default the value of "HandleLidSwitchDocked" is "ignore", which maintains the current behavior of not suspending when the lid is closed, but it can be changed to any value that the other "HandleXxx" options support (suspend, hibernate, etc.).
Comment 2 Lennart Poettering 2014-08-18 21:44:37 UTC
Patch looks incomplete, you never invoke the new call you added?

Also, please update the man page for this.

I'd prefer if the item could be named slightly more generically. Maybe "LidSwitchIgnoreDocked=" or so.
Comment 3 Lennart Poettering 2014-08-18 21:44:52 UTC
*** Bug 80309 has been marked as a duplicate of this bug. ***
Comment 4 Ben Wolsieffer 2014-08-19 01:37:44 UTC
Created attachment 104854 [details] [review]
Adds a HandleLidSwitchDocked option to logind.conf + documentation

Sorry about that, I missed a file in the patch.

I also added the man page to the patch, see if you think it's clear enough.

The option name can be changed, but the one you suggested doesn't really fit. This option does not do what I originally suggested in my request, but instead allows the user to define any action to occur when the lid is closed and the laptop is docked. I chose this design (rather than just a boolean to enable suspending while docked) because it allows for more flexibility.

Another note: when GNOME 3 is running on the system, it still won't suspend because GNOME also inhibits suspending when multiple monitors are attached and they don't want to add a way to disable it. Here is my bug report with more info: https://bugzilla.gnome.org/show_bug.cgi?id=734964
Comment 5 Lennart Poettering 2014-08-26 20:09:20 UTC
Thanks! Applied!

(next time, please attach a proper git-format-patch formatted patch, thanks!)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.