[PATCH 1/9] animation, shell: add kbd focus change animation

Bryce W. Harrington b.harrington at samsung.com
Mon Nov 18 19:27:36 PST 2013


On Fri, Nov 15, 2013 at 05:53:30PM +0100, Emilio Pozuelo Monfort wrote:
> From: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
> 
> When enabled, this will make all but the keyboard-focused window dim.
> Also the background gets dimmed, if there are any windows open. The
> panel is not dimmed.
> 
> When the keyboard focus changes, the change in dimming is animated.
> 
> The dimming is implemented with transparent solid-color surfaces, two at
> most. The net effect of two overlapping dim surfaces is kept constant
> during animations (stable fade animation).
> 
> There is a new weston.ini option "focus-animation", that defaults to
> none, and can be set to "dim-layer" to enable the focus change
> animation.
> 
> [pq: Sliced, squashed, and rebased the patch series. Fixed surface alpha
> interaction with the switcher. Wrote the commit message.]
> 
> [pochu: rebased, ported to weston_view]
> ---

...

> @@ -542,10 +649,21 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
>  	if (main_surface != state->keyboard_focus)
>  		next = main_surface;
>  
> +	shell = state->seat->compositor->shell_interface.shell;
>  	if (next) {
> -		shell = state->seat->compositor->shell_interface.shell;
> +		state->keyboard_focus = NULL;
>  		activate(shell, next, state->seat);
>  	} else {
> +		if (shell->focus_animation_type == ANIMATION_DIM_LAYER) {
> +			if (state ->ws->focus_animation)

Is the space after state intentional?

> +				weston_view_animation_destroy(state->ws->focus_animation);
> +
> +			state->ws->focus_animation = weston_fade_run(
> +				state->ws->fsurf_front->view,
> +				state->ws->fsurf_front->view->alpha, 0.0, 300,
> +				focus_animation_done, state->ws);
> +		}
> +
>  		wl_list_remove(&state->link);
>  		focus_state_destroy(state);
>  	}

Bryce


More information about the wayland-devel mailing list