desktop-shell: add close-animation config option for destroying surfaces
At the moment when surfaces are destroyed they are faded out but let's
make it configurable!
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 7370972..d756076 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -535,6 +535,9 @@
weston_config_section_get_string(section, "animation", &s, "none");
shell->win_animation_type = get_animation_type(s);
free(s);
+ weston_config_section_get_string(section, "close-animation", &s, "fade");
+ shell->win_close_animation_type = get_animation_type(s);
+ free(s);
weston_config_section_get_string(section,
"startup-animation", &s, "fade");
shell->startup_animation_type = get_animation_type(s);
@@ -3220,8 +3223,12 @@
pixman_region32_init(&shsurf->surface->pending.input);
pixman_region32_fini(&shsurf->surface->input);
pixman_region32_init(&shsurf->surface->input);
- weston_fade_run(shsurf->view, 1.0, 0.0, 300.0,
- fade_out_done, shsurf);
+ if (shsurf->shell->win_close_animation_type == ANIMATION_FADE) {
+ weston_fade_run(shsurf->view, 1.0, 0.0, 300.0,
+ fade_out_done, shsurf);
+ } else {
+ weston_surface_destroy(shsurf->surface);
+ }
}
static void
diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
index 6e63785..e994cdb 100644
--- a/desktop-shell/shell.h
+++ b/desktop-shell/shell.h
@@ -194,6 +194,7 @@
uint32_t binding_modifier;
uint32_t exposay_modifier;
enum animation_type win_animation_type;
+ enum animation_type win_close_animation_type;
enum animation_type startup_animation_type;
enum animation_type focus_animation_type;