shell: Add a new weston.ini to control the startup animation

The new key startup-animation in the [shell] section lets you
control the startup animation.  Default is fade, but with this patch
we can also do none, which just show the desktop as fast as possible.
This commit is contained in:
Kristian Høgsberg 2013-10-16 11:38:24 -07:00
parent 991810c1b3
commit 724c8d9e7c
3 changed files with 21 additions and 6 deletions

View File

@ -150,8 +150,15 @@ enables screen locking (boolean).
.BI "animation=" zoom .BI "animation=" zoom
sets the effect used for opening new windows (string). Can be sets the effect used for opening new windows (string). Can be
.B zoom, .B zoom,
.B fade. .B fade,
Otherwise, no animation is used. .B none.
By default, no animation is used.
.TP 7
.BI "startup-animation=" fade
sets the effect used for opening new windows (string). Can be
.B fade,
.B none.
By default, the fade animation is used.
.TP 7 .TP 7
.BI "binding-modifier=" ctrl .BI "binding-modifier=" ctrl
sets the modifier key used for common bindings (string), such as moving sets the modifier key used for common bindings (string), such as moving

View File

@ -163,6 +163,7 @@ struct desktop_shell {
uint32_t binding_modifier; uint32_t binding_modifier;
enum animation_type win_animation_type; enum animation_type win_animation_type;
enum animation_type startup_animation_type;
}; };
enum shell_surface_type { enum shell_surface_type {
@ -414,9 +415,6 @@ get_modifier(char *modifier)
static enum animation_type static enum animation_type
get_animation_type(char *animation) get_animation_type(char *animation)
{ {
if (!animation)
return ANIMATION_NONE;
if (!strcmp("zoom", animation)) if (!strcmp("zoom", animation))
return ANIMATION_ZOOM; return ANIMATION_ZOOM;
else if (!strcmp("fade", animation)) else if (!strcmp("fade", animation))
@ -448,6 +446,10 @@ shell_configuration(struct desktop_shell *shell)
weston_config_section_get_string(section, "animation", &s, "none"); weston_config_section_get_string(section, "animation", &s, "none");
shell->win_animation_type = get_animation_type(s); shell->win_animation_type = get_animation_type(s);
free(s); free(s);
weston_config_section_get_string(section,
"startup-animation", &s, "fade");
shell->startup_animation_type = get_animation_type(s);
free(s);
weston_config_section_get_uint(section, "num-workspaces", weston_config_section_get_uint(section, "num-workspaces",
&shell->workspaces.num, &shell->workspaces.num,
DEFAULT_NUM_WORKSPACES); DEFAULT_NUM_WORKSPACES);
@ -3317,7 +3319,12 @@ do_shell_fade_startup(void *data)
{ {
struct desktop_shell *shell = data; struct desktop_shell *shell = data;
shell_fade(shell, FADE_IN); if (shell->startup_animation_type == ANIMATION_FADE)
shell_fade(shell, FADE_IN);
else if (shell->startup_animation_type == ANIMATION_NONE) {
weston_surface_destroy(shell->fade.surface);
shell->fade.surface = NULL;
}
} }
static void static void

View File

@ -9,6 +9,7 @@ background-type=tile
panel-color=0x90ff0000 panel-color=0x90ff0000
locking=true locking=true
animation=zoom animation=zoom
startup-animation=fade
#binding-modifier=ctrl #binding-modifier=ctrl
#num-workspaces=6 #num-workspaces=6
#cursor-theme=whiteglass #cursor-theme=whiteglass