From c5d2c447df7c0709fbfb727254888f43cef50040 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 6 Jan 2021 18:24:01 +0200 Subject: [PATCH] main: Add activate_by_default ini option Displaying the application surface as soon as started required activating the surface by default. With this patch, we give the possibility to do it conditionally, as it helps CI with cases where we don't really want other applications change the active surface. With applications that start by default, this interferes with the ability to take a screenshot with just the background. Signed-off-by: Marius Vlad Change-Id: I6e826a6715b9a348181df80ed53ffaa6b65b7d2b --- src/ivi-compositor.h | 1 + src/layout.c | 6 ++++++ src/main.c | 1 + 3 files changed, 8 insertions(+) diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index efa6373..b2342eb 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -54,6 +54,7 @@ struct ivi_compositor { bool init_failed; bool hide_cursor; + bool activate_by_default; /* * Options parsed from command line arugments. diff --git a/src/layout.c b/src/layout.c index 0363af7..b1d8b3d 100644 --- a/src/layout.c +++ b/src/layout.c @@ -328,6 +328,12 @@ ivi_layout_desktop_committed(struct ivi_surface *surf) return; } + if (!surf->ivi->activate_by_default) { + weston_log("Refusing to activate surface role %d, app_id %s\n", + surf->role, app_id); + return; + } + /* use the output of the bg to activate the app on start-up by * default */ if (surf->view && r_output) { diff --git a/src/main.c b/src/main.c index 4a2ffca..482558a 100644 --- a/src/main.c +++ b/src/main.c @@ -1527,6 +1527,7 @@ int main(int argc, char *argv[]) } /* from [core] */ weston_config_section_get_bool(section, "hide-cursor", &ivi.hide_cursor, false); + weston_config_section_get_bool(section, "activate-by-default", &ivi.activate_by_default, true); display = wl_display_create(); loop = wl_display_get_event_loop(display); -- 2.16.6