Inhibitor falsely claims "Multiple displays attached"
Submitted by Robie Basak
When the lid switch is inhibited by having the "lid-close-ac-action" gsetting set to "nothing", "systemd-inhibit --list" shows a block on handle-lid-switch with "Why" set to "Multiple displays attached". This led me down a wild goose chase trying to figure out why gnome-settings-daemon thought I had multiple monitors when on AC power.
Expected: "Why" is set to something that tells me exactly why the lid switch is being ignored, such as "On AC power and disabled by lid close action setting".
Steps to reproduce:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action nothing sleep 10 systemd-inhibit --list
I suggest that the code be simplified by using two separate inhibitors: one for inhibiting based on the setting, and a separate one for inhibiting on multiple monitors attached. Then the inhibitor descriptions would be clear, making debugging much easier.
Version: 3.24.3 Using Ubuntu Artful with gnome-settings-daemon 3.24.3-0ubuntu3
As an aside, to my knowledge I'd never set my lid-close-ac-action. I don't have gnome-tweak-tool installed, had never previously used gsettings on this system, and the UI doesn't let me set this setting AFAICT. IIRC, my suspend on lid close stopped working quite recently, well after Ubuntu Artful switched to GNOME. But because I've been following Artful I had Unity installed previously, so perhaps that had influenced something.