mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-09-06 09:56:14 +00:00
shell: add a client config entry
This commit is contained in:
parent
fcb6bf43a4
commit
46ce798d28
|
@ -139,6 +139,10 @@ different shell plugins.
|
||||||
.PP
|
.PP
|
||||||
The entries that can appear in this section are:
|
The entries that can appear in this section are:
|
||||||
.TP 7
|
.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
|
.BI "background-image=" file
|
||||||
sets the path for the background image file (string).
|
sets the path for the background image file (string).
|
||||||
.TP 7
|
.TP 7
|
||||||
|
|
15
src/shell.c
15
src/shell.c
|
@ -229,6 +229,8 @@ struct desktop_shell {
|
||||||
|
|
||||||
struct wl_listener output_create_listener;
|
struct wl_listener output_create_listener;
|
||||||
struct wl_list output_list;
|
struct wl_list output_list;
|
||||||
|
|
||||||
|
char *client;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum shell_surface_type {
|
enum shell_surface_type {
|
||||||
|
@ -535,6 +537,9 @@ shell_configuration(struct desktop_shell *shell)
|
||||||
|
|
||||||
section = weston_config_get_section(shell->compositor->config,
|
section = weston_config_get_section(shell->compositor->config,
|
||||||
"shell", NULL, NULL);
|
"shell", NULL, NULL);
|
||||||
|
weston_config_section_get_string(section,
|
||||||
|
"client", &s, LIBEXECDIR "/weston-desktop-shell");
|
||||||
|
shell->client = s;
|
||||||
weston_config_section_get_string(section,
|
weston_config_section_get_string(section,
|
||||||
"binding-modifier", &s, "super");
|
"binding-modifier", &s, "super");
|
||||||
shell->binding_modifier = get_modifier(s);
|
shell->binding_modifier = get_modifier(s);
|
||||||
|
@ -4436,11 +4441,11 @@ desktop_shell_sigchld(struct weston_process *process, int status)
|
||||||
|
|
||||||
shell->child.deathcount++;
|
shell->child.deathcount++;
|
||||||
if (shell->child.deathcount > 5) {
|
if (shell->child.deathcount > 5) {
|
||||||
weston_log("weston-desktop-shell died, giving up.\n");
|
weston_log("%s died, giving up.\n", shell->client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
weston_log("weston-desktop-shell died, respawning...\n");
|
weston_log("%s died, respawning...\n", shell->client);
|
||||||
launch_desktop_shell_process(shell);
|
launch_desktop_shell_process(shell);
|
||||||
shell_fade_startup(shell);
|
shell_fade_startup(shell);
|
||||||
}
|
}
|
||||||
|
@ -4449,15 +4454,14 @@ static void
|
||||||
launch_desktop_shell_process(void *data)
|
launch_desktop_shell_process(void *data)
|
||||||
{
|
{
|
||||||
struct desktop_shell *shell = data;
|
struct desktop_shell *shell = data;
|
||||||
const char *shell_exe = LIBEXECDIR "/weston-desktop-shell";
|
|
||||||
|
|
||||||
shell->child.client = weston_client_launch(shell->compositor,
|
shell->child.client = weston_client_launch(shell->compositor,
|
||||||
&shell->child.process,
|
&shell->child.process,
|
||||||
shell_exe,
|
shell->client,
|
||||||
desktop_shell_sigchld);
|
desktop_shell_sigchld);
|
||||||
|
|
||||||
if (!shell->child.client)
|
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
|
static void
|
||||||
|
@ -5851,6 +5855,7 @@ shell_destroy(struct wl_listener *listener, void *data)
|
||||||
wl_array_release(&shell->workspaces.array);
|
wl_array_release(&shell->workspaces.array);
|
||||||
|
|
||||||
free(shell->screensaver.path);
|
free(shell->screensaver.path);
|
||||||
|
free(shell->client);
|
||||||
free(shell);
|
free(shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue