summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2021-01-06 18:24:01 +0200
committerMarius Vlad <marius.vlad@collabora.com>2021-01-06 23:53:58 +0200
commitc5d2c447df7c0709fbfb727254888f43cef50040 (patch)
tree383f2d7d75caf7d911d0456933eb0846b1d5edac
parentbdd8dd718496dc8e4330209c46c196442bcf7d3e (diff)
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 <marius.vlad@collabora.com> Change-Id: I6e826a6715b9a348181df80ed53ffaa6b65b7d2b
-rw-r--r--src/ivi-compositor.h1
-rw-r--r--src/layout.c6
-rw-r--r--src/main.c1
3 files changed, 8 insertions, 0 deletions
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);