[PATCH 1/2] shell: add a client config entry

pochu27 at gmail.com pochu27 at gmail.com
Wed Nov 20 04:22:29 PST 2013


From: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>

---
 man/weston.ini.man |  4 ++++
 src/shell.c        | 15 ++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/man/weston.ini.man b/man/weston.ini.man
index 4ff313d..bbb1d15 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -139,6 +139,10 @@ different shell plugins.
 .PP
 The entries that can appear in this section are:
 .TP 7
+.BI "client=" file
+sets the path for the shell client to run. If not specified
+weston-desktop-shell is launched (string).
+.TP 7
 .BI "background-image=" file
 sets the path for the background image file (string).
 .TP 7
diff --git a/src/shell.c b/src/shell.c
index 82c3cd8..0d386cf 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -229,6 +229,8 @@ struct desktop_shell {
 
 	struct wl_listener output_create_listener;
 	struct wl_list output_list;
+
+	char *client;
 };
 
 enum shell_surface_type {
@@ -536,6 +538,9 @@ shell_configuration(struct desktop_shell *shell)
 	section = weston_config_get_section(shell->compositor->config,
 					    "shell", NULL, NULL);
 	weston_config_section_get_string(section,
+					 "client", &s, LIBEXECDIR "/weston-desktop-shell");
+	shell->client = s;
+	weston_config_section_get_string(section,
 					 "binding-modifier", &s, "super");
 	shell->binding_modifier = get_modifier(s);
 	free(s);
@@ -4436,11 +4441,11 @@ desktop_shell_sigchld(struct weston_process *process, int status)
 
 	shell->child.deathcount++;
 	if (shell->child.deathcount > 5) {
-		weston_log("weston-desktop-shell died, giving up.\n");
+		weston_log("%s died, giving up.\n", shell->client);
 		return;
 	}
 
-	weston_log("weston-desktop-shell died, respawning...\n");
+	weston_log("%s died, respawning...\n", shell->client);
 	launch_desktop_shell_process(shell);
 	shell_fade_startup(shell);
 }
@@ -4449,15 +4454,14 @@ static void
 launch_desktop_shell_process(void *data)
 {
 	struct desktop_shell *shell = data;
-	const char *shell_exe = LIBEXECDIR "/weston-desktop-shell";
 
 	shell->child.client = weston_client_launch(shell->compositor,
 						 &shell->child.process,
-						 shell_exe,
+						 shell->client,
 						 desktop_shell_sigchld);
 
 	if (!shell->child.client)
-		weston_log("not able to start %s\n", shell_exe);
+		weston_log("not able to start %s\n", shell->client);
 }
 
 static void
@@ -5851,6 +5855,7 @@ shell_destroy(struct wl_listener *listener, void *data)
 	wl_array_release(&shell->workspaces.array);
 
 	free(shell->screensaver.path);
+	free(shell->client);
 	free(shell);
 }
 
-- 
1.8.4.rc3



More information about the wayland-devel mailing list