summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2018-08-30 17:41:42 +0200
committerDaniel Stone <daniel@fooishbar.org>2018-09-23 09:18:00 +0000
commitb9454fde9fb864539548fbdeb076a3c560f95c5b (patch)
tree8df1d8b5d5b398079328880abcaaf0948e307946
parent61dc4ca92ec885cff0dabb88a5fda5567a489316 (diff)
weston: keep non-desktop displays turned off by default
Keep non-desktop heads representing e.g. head mounted displays turned off by default. When using the DRM backend they can still be enabled by setting an explicit [output] mode (or "mode=preferred") in weston.ini. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
-rw-r--r--compositor/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/compositor/main.c b/compositor/main.c
index 14ad241a..4ede185d 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1411,13 +1411,15 @@ simple_heads_changed(struct wl_listener *listener, void *arg)
bool connected;
bool enabled;
bool changed;
+ bool non_desktop;
while ((head = weston_compositor_iterate_heads(wet->compositor, head))) {
connected = weston_head_is_connected(head);
enabled = weston_head_is_enabled(head);
changed = weston_head_is_device_changed(head);
+ non_desktop = weston_head_is_non_desktop(head);
- if (connected && !enabled) {
+ if (connected && !enabled && !non_desktop) {
simple_head_enable(wet, head);
} else if (!connected && enabled) {
simple_head_disable(head);
@@ -1715,14 +1717,16 @@ drm_head_prepare_enable(struct wet_compositor *wet,
section = drm_config_find_controlling_output_section(wet->config, name);
if (section) {
- /* skip outputs that are explicitly off, the backend turns
- * them off automatically.
+ /* skip outputs that are explicitly off, or non-desktop and not
+ * explicitly enabled. The backend turns them off automatically.
*/
weston_config_section_get_string(section, "mode", &mode, NULL);
if (mode && strcmp(mode, "off") == 0) {
free(mode);
return;
}
+ if (!mode && weston_head_is_non_desktop(head))
+ return;
free(mode);
weston_config_section_get_string(section, "name",