summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2023-04-14 16:46:06 +0300
committerMarius Vlad <marius.vlad@collabora.com>2023-05-03 18:46:15 +0300
commitb80044887e97509433eb19945ce8feab68151044 (patch)
tree379905a812ccebc927728b2be6f484df348f4895
parent456f3fed4ff45bbaf7f60c78ffb0ae0289002dfe (diff)
src: Send out the output name for the remote role
A while ago we switched to activation-by-default turned off which passes the responsability of activating applications to the shell client. The shell client uses the app_id to indentify the application to display, and the output. The output would normally be hard-coded to the first available output but there is nothing that prevents the shell to display it on other outputs. This patch does just that, it would allow the user use configurable option in the ini file, under the [output], agl-shell-app-id=app_id, by re-using the event from the compositor sent to the shell client to pick up a different output, the one specified in the section entry. Bug-AGL: SPEC-4529 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ieea1a28fe6776ecc691fd38da9b4c3495ac5a5ea
-rw-r--r--src/desktop.c4
-rw-r--r--src/ivi-compositor.h4
-rw-r--r--src/shell.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/src/desktop.c b/src/desktop.c
index 361c5b4..54eac5b 100644
--- a/src/desktop.c
+++ b/src/desktop.c
@@ -211,8 +211,10 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata)
app_id = weston_desktop_surface_get_app_id(dsurface);
- if ((active_output = ivi_layout_find_with_app_id(app_id, ivi)))
+ if ((active_output = ivi_layout_find_with_app_id(app_id, ivi))) {
ivi_set_pending_desktop_surface_remote(active_output, app_id);
+ shell_send_app_on_output(ivi, app_id, active_output->output->name);
+ }
/* reset any caps to make sure we apply the new caps */
ivi_seat_reset_caps_sent(ivi);
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h
index 49d38de..fb5a0fa 100644
--- a/src/ivi-compositor.h
+++ b/src/ivi-compositor.h
@@ -515,4 +515,8 @@ get_default_output(struct weston_compositor *compositor);
struct weston_output *
get_focused_output(struct weston_compositor *compositor);
+void
+shell_send_app_on_output(struct ivi_compositor *ivi, const char *app_id,
+ const char *output_name);
+
#endif
diff --git a/src/shell.c b/src/shell.c
index c18017b..ac20b4f 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1172,7 +1172,8 @@ void
shell_send_app_on_output(struct ivi_compositor *ivi, const char *app_id,
const char *output_name)
{
- if (app_id && wl_resource_get_version(ivi->shell_client.resource) >=
+ if (app_id && ivi->shell_client.resource &&
+ wl_resource_get_version(ivi->shell_client.resource) >=
AGL_SHELL_APP_ON_OUTPUT_SINCE_VERSION) {
agl_shell_send_app_on_output(ivi->shell_client.resource,