From 602a41c22ac2df33b4b5e5083719c1cfaf58acf9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Jun 2015 00:24:05 +0200 Subject: 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. --- src/login/logind-button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/login/logind-button.c') diff --git a/src/login/logind-button.c b/src/login/logind-button.c index 8079d0b5aa..210b889c4f 100644 --- a/src/login/logind-button.c +++ b/src/login/logind-button.c @@ -100,7 +100,7 @@ static void button_lid_switch_handle_action(Manager *manager, bool is_edge) { assert(manager); /* If we are docked, handle the lid switch differently */ - if (manager_is_docked_or_multiple_displays(manager)) + if (manager_is_docked_or_external_displays(manager)) handle_action = manager->handle_lid_switch_docked; else handle_action = manager->handle_lid_switch; -- cgit v1.2.3-54-g00ecf