[PATCH weston 2/4] shell: Add config options to set the client shell

Tiago Vignatti tiago.vignatti at intel.com
Thu Apr 4 14:07:38 PDT 2013


We're now able to set "client-path=path" in "shell-plugin" section for picking
a particular shell client.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 man/weston.ini.man |    3 +++
 src/shell.c        |    9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/man/weston.ini.man b/man/weston.ini.man
index e403cb2..59bc461 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -106,6 +106,9 @@ section is used to customize the compositor.
 .PP
 The entries that can appear in this section are:
 .TP 7
+.BI "client-path=" path
+sets the path to the shell client that the plugin will be spawning (string).
+.TP 7
 .BI "animation=" zoom
 sets the effect used for opening new windows (string). Can be
 .B zoom,
diff --git a/src/shell.c b/src/shell.c
index f9110a6..246d342 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -99,6 +99,7 @@ struct desktop_shell {
 	struct weston_surface *grab_surface;
 
 	struct {
+		char *path;
 		struct weston_process process;
 		struct wl_client *client;
 		struct wl_resource *desktop_shell;
@@ -370,12 +371,14 @@ static void
 shell_configuration(struct desktop_shell *shell, const char *config_file)
 {
 	char *path = NULL;
+	char *client_path = LIBEXECDIR "/weston-desktop-shell";
 	int duration = 60;
 	unsigned int num_workspaces = DEFAULT_NUM_WORKSPACES;
 	char *modifier = NULL;
 	char *win_animation = NULL;
 
 	struct config_key shell_keys[] = {
+		{ "client-path",        CONFIG_KEY_STRING, &client_path },
 		{ "binding-modifier",   CONFIG_KEY_STRING, &modifier },
 		{ "animation",          CONFIG_KEY_STRING, &win_animation},
 		{ "num-workspaces",
@@ -394,6 +397,7 @@ shell_configuration(struct desktop_shell *shell, const char *config_file)
 
 	parse_config_file(config_file, cs, ARRAY_LENGTH(cs), shell);
 
+	shell->child.path = client_path;
 	shell->screensaver.path = path;
 	shell->screensaver.duration = duration * 1000;
 	shell->binding_modifier = get_modifier(modifier);
@@ -3355,15 +3359,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->child.path,
 						 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->child.path);
 }
 
 static void
-- 
1.7.9.5



More information about the wayland-devel mailing list