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 734964 - Remove (duplicated) external displays handling
Remove (duplicated) external displays handling
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: power
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-17 21:36 UTC by benwolsieffer
Modified: 2019-03-20 11:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds an option to allow suspending with multiple monitors on lid close (632 bytes, patch)
2014-08-18 17:04 UTC, benwolsieffer
none Details | Review
Adds an option to allow suspending with multiple monitors on lid close (2.43 KB, patch)
2014-08-18 17:10 UTC, benwolsieffer
reviewed Details | Review

Description benwolsieffer 2014-08-17 21:36:39 UTC
Currently, gnome-settings-manager creates a systemd inhibitor that block suspending when the laptop lid is closed if multiple displays are attached. Since gnome no longer manages the lid switch, but instead lets systemd do it, gnome should not create this inhibitor. Also, the inhibitor is redundant, because systemd already prevents lid switch suspension if an external display or docking station is attached.
Comment 1 Bastien Nocera 2014-08-17 21:59:53 UTC
(In reply to comment #0)
<snip>
>Also, the inhibitor is redundant,
> because systemd already prevents lid switch suspension if an external display
> or docking station is attached.

Citation needed.
Comment 2 benwolsieffer 2014-08-17 22:02:43 UTC
From the man page (http://www.freedesktop.org/software/systemd/man/logind.conf.html):

"Note that the lid switch is ignored if the system is inserted in a docking station, or if more than one display is connected."
Comment 3 Bastien Nocera 2014-08-17 22:17:45 UTC
I guess that would be:
http://cgit.freedesktop.org/systemd/systemd/tree/src/login/logind-action.c#n73
which calls:
http://cgit.freedesktop.org/systemd/systemd/tree/src/login/logind-core.c#n493

Except that it doesn't work for drivers that don't use drm (that's unfortunately still the case for the NVidia drivers).

Look at the log for logind-action.c, in particular:
commit d36d90933a832bd1e1eb8e3d16b3de73f91636b4
Author: Mantas Mikulėnas <grawity@gmail.com>
Date:   Mon Apr 28 00:58:56 2014 +0300

    logind: allow suspending if there are no displays
    
    With proprietary graphics drivers, there won't be any 'drm' devices in
    sysfs, so logind will never suspend the system upon closing the lid,
    even if only one (internal) display is connected. This has been reported
    by multiple users so far.
    
    IMHO, it's better to suspend the system in this case for safety reasons,
    to avoid having nvidia blob users' laptops overheat, for the same reason
    that sleep inhibitors are overridden (LidSwitchIgnoreInhibited=yes).

So GNOME will still need to do its work, unfortunately.
Comment 4 benwolsieffer 2014-08-18 00:57:04 UTC
Thanks, that makes sense.

Still, would it be possible to add an (dconf?) option to disable this feature? I am interested in this because I am working on patching systemd to allow suspending even if multiple monitors are connected. My patch works, except that it is being inhibited by gnome-setting-daemon. Perhaps it would be possible to bring back the "lid-close-suspend-with-external-monitor" option?
Comment 5 Bastien Nocera 2014-08-18 11:10:45 UTC
Not in gnome-settings-daemon, no. The code is fragile enough that I don't want to add another variable into the mix. We'll probably finally remove that when we use only Wayland...
Comment 6 benwolsieffer 2014-08-18 17:04:54 UTC
Created attachment 283796 [details] [review]
Adds an option to allow suspending with multiple monitors on lid close

This patch is for users who want to patch their copy of gnome-settings-daemon to enable this functionality and I don't expect it to be accepted.
Comment 7 benwolsieffer 2014-08-18 17:10:30 UTC
Created attachment 283800 [details] [review]
Adds an option to allow suspending with multiple monitors on lid close

Oops, I uploaded the wrong file the first time. :(

This patch is for users who want to patch their copy of gnome-settings-daemon
to enable this functionality and I don't expect it to be accepted. I don't know if it works perfectly, but it seems to work for me. It adds the "lid-close-suspend-with-external-monitor" to allow the computer so suspend on lid close if multiple monitors are connected.
Comment 8 Bastien Nocera 2014-08-18 17:23:59 UTC
Review of attachment 283800 [details] [review]:

I'll mark this as reviewed, and I won't accept it, but I should note that the comments are not truthful. They should mention that systemd, by default, will take care of looking at the external displays.
Comment 9 Bastien Nocera 2014-08-18 17:26:39 UTC
Reopening. We can remove that code when we stop caring about external displays that don't use drm in the kernel (or we have some other way of detecting them).
Comment 10 GNOME Infrastructure Team 2019-03-20 11:17:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/248.