gsd-xrandr: Add new follow-lid behavior and tie gsd-power lid-close to gsd-xrandr
There are two problems in the implementation of "turn off laptop screen when lid closed", First, it is not enabled at startup. Second, it conflicts with the gsd-power option to never use external monitors with the lid closed. To fix this, unify the gsd-xrandr default-monitors-setup setting with the aforementioned gsd-power option. The default-monitors-option now has four settings. The new follow-lid mode is the default and matches earlier behavior, plus it also checks the laptop lid state at startup. The follow-lid and clone mode still turn off the laptop screen when the lid is closed, the dock and do-nothing mode leave it apart. With this in place, gsd-power does not need anymore the special option for lid-close-suspend-with-external-monitor. It can just look at the default-monitors-setup setting, and only suspend if that setting is "do-nothing". All other settings imply that you want to keep working on the external monitor.
parent
a15f3d83