Add/reintroduce setting to enable suspend on lid-close with external monitors attached

Bug #1793918 reported by Cornelius
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
gnome-desktop3 (Ubuntu)
Confirmed
Low
Unassigned
gnome-settings-daemon (Ubuntu)
Confirmed
Low
Unassigned
gnome-tweaks (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

With Ubuntu 18.04 my laptop does not suspend when lid is closed while external monitors are attached. This might be a good behavior for many users but I want to have my laptop suspend again when I close it.

Some time ago there was an option in gsettings scheme org.gnome.settings-daemon.plugins.power named lid-close-suspend-with-external-monitor (introduced in https://bugzilla.gnome.org/show_bug.cgi?id=657201). This settings seems to have no effect anymore and seems to be removed in the current scheme (repatched in ubuntu's version only).

This is realy anoying because at the moment the laptop does not suspend at all with lid-close action because the nvidia driver discover the internal built-in display under DP-4. That makes gnome think that there is an external monitor connected. Is this a bug in nvidia driver or a problem of gnome-desktop's gnome-rr which thinks that only monitors with "LVDS|Lvds|LCD|eDP|DSI" in it's name could be an internal display? However this might be another bug. I want to suspend with realy external monitors attached anyhow because I always use my laptop as second/third monitor.

Tags: bionic
Cornelius (7-cornelius)
description: updated
Cornelius (7-cornelius)
description: updated
Cornelius (7-cornelius)
information type: Public → Public Security
information type: Public Security → Public
summary: - Setting to enable suspend on lid-close with external monitors attached
+ Add/reintroduce setting to enable suspend on lid-close with external
+ monitors attached
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-desktop (Ubuntu):
status: New → Confirmed
Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
Changed in gnome-tweaks (Ubuntu):
status: New → Confirmed
tags: added: bionic
affects: gnome-desktop (Ubuntu) → gnome-desktop3 (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Comment from the new duplicate

'This most trivial (untested) patch to use this settings seems to be:

diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index c7a16e8d..9b7a99b5 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1196,7 +1196,7 @@ upower_kbd_toggle (GsdPowerManager *manager,
 static gboolean
 suspend_on_lid_close (GsdPowerManager *manager)
 {
- return !external_monitor_is_connected (manager->rr_screen);
+ return g_settings_get_boolean (manager->settings, "lid-close-suspend-with-external-monitor") || !external_monitor_is_connected (manager->rr_screen);
 }

 static gboolean'

Changed in gnome-desktop3 (Ubuntu):
importance: Undecided → Low
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Low
Changed in gnome-tweaks (Ubuntu):
importance: Undecided → Low
Revision history for this message
Andrei Borzenkov (arvidjaar-s) wrote :

> (untested) patch

I built gsd with this patch and it works for me - it suspends with external monitor connected.

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.