summaryrefslogtreecommitdiff
path: root/src/login/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-06-17 00:24:05 +0200
committerLennart Poettering <lennart@poettering.net>2015-06-17 15:41:25 +0200
commit602a41c22ac2df33b4b5e5083719c1cfaf58acf9 (patch)
treed1877e76a8cd999f96e7ed014de1ad71b8f733c9 /src/login/logind-dbus.c
parent203e81db24ccb9b4dcb0b1bad0ba554116267d20 (diff)
logind: rework display counting when detecting whether the system is docked
Previously, we'd just count connected displays, and if there was 2 or more we assumed a "docked" state. With this change we now: - Only count external displays, ignore internal ones (which we detect by checking the connector name against a whitelist of known external plug types) - We ignore connectors which are explicitly disabled - We then compare the count with >= 1 rather than >= 2 as before This new logic has the benefit that systems that disconnect the internal display when the lid is closed are better supported. Also, explicitly disabled ports do not confuse the algorithm anymore. This new algorithm has been suggested here: http://lists.freedesktop.org/archives/intel-gfx/2015-June/068821.html This also makes two functions static, that are not used outside of their .c files.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r--src/login/logind-dbus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index e6f9ec7845..8ebcd3f5ca 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -258,7 +258,7 @@ static int property_get_docked(
assert(reply);
assert(m);
- return sd_bus_message_append(reply, "b", manager_is_docked_or_multiple_displays(m));
+ return sd_bus_message_append(reply, "b", manager_is_docked_or_external_displays(m));
}
static int method_get_session(sd_bus_message *message, void *userdata, sd_bus_error *error) {