[PATCH 1/9] animation, shell: add kbd focus change animation
Emilio Pozuelo Monfort
pochu27 at gmail.com
Tue Nov 19 01:09:48 PST 2013
On 19/11/13 04:27, Bryce W. Harrington wrote:
> 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?
Oops, typo! Though it doesn't affect the code. Should be amended before
committing though.
Thanks for spotting it.
Emilio
>
>> + 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