[PATCH] Make the default desktop shell client configurable

pochu27 at gmail.com pochu27 at gmail.com
Mon Dec 2 03:53:32 PST 2013


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

The default can be set by passing WESTON_SHELL_CLIENT as an argument
to configure, similarly to WESTON_NATIVE_BACKEND.
---
 configure.ac       | 9 +++++++++
 man/Makefile.am    | 1 +
 man/weston.ini.man | 3 ++-
 src/shell.c        | 2 +-
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index a460d3b..bd8ff44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,8 @@ LT_INIT([disable-static])
 
 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
            [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
+AC_ARG_VAR([WESTON_SHELL_CLIENT],
+           [Set the default desktop shell client to load if none is specified in weston.ini. @<:@default=weston-desktop-shell@:>@])
 
 PKG_PROG_PKG_CONFIG()
 
@@ -456,6 +458,13 @@ AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
 		   [The default backend to load, if not wayland nor x11.])
 
+if test "x$WESTON_SHELL_CLIENT" = "x"; then
+	WESTON_SHELL_CLIENT="weston-desktop-shell"
+fi
+AC_MSG_NOTICE([Weston's default desktop shell client: $WESTON_SHELL_CLIENT])
+AC_DEFINE_UNQUOTED([WESTON_SHELL_CLIENT], ["$WESTON_SHELL_CLIENT"],
+		   [The default desktop shell client to load.])
+
 AC_ARG_ENABLE(demo-clients,
               AS_HELP_STRING([--enable-demo-clients],
                              [install demo clients built with weston]),,
diff --git a/man/Makefile.am b/man/Makefile.am
index e4abd8c..5fb030a 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -7,6 +7,7 @@ endif
 MAN_SUBSTS = \
 	-e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \
 	-e 's|__weston_modules_dir__|$(pkglibdir)|g' \
+	-e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g' \
 	-e 's|__version__|$(PACKAGE_VERSION)|g'
 
 SUFFIXES = .1 .5 .7 .man
diff --git a/man/weston.ini.man b/man/weston.ini.man
index cc88ca8..6be90bf 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -141,7 +141,8 @@ 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).
+.I __weston_shell_client__
+is launched (string).
 .TP 7
 .BI "background-image=" file
 sets the path for the background image file (string).
diff --git a/src/shell.c b/src/shell.c
index 605f090..7146aad 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -541,7 +541,7 @@ 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");
+					 "client", &s, LIBEXECDIR "/" WESTON_SHELL_CLIENT);
 	shell->client = s;
 	weston_config_section_get_string(section,
 					 "binding-modifier", &s, "super");
-- 
1.8.4.rc3



More information about the wayland-devel mailing list