From 4272e639912cac247a04c49ce2a6216100aab65a Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Mon, 13 Aug 2012 09:58:41 -0600 Subject: [PATCH] shell: Eliminate unneeded function. Replace all occurrences of workspace_damage_all_surfaces() with weston_compositor_schedule_repaint(). This fixes a bug exposed by 982387011ff where trying to switch workspaces while there are no surfaces on the current workspace fails to start the animation. --- src/shell.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/shell.c b/src/shell.c index 4633049a..51480ce4 100644 --- a/src/shell.c +++ b/src/shell.c @@ -576,15 +576,6 @@ workspace_translate_in(struct workspace *ws, double fraction) } } -static void -workspace_damage_all_surfaces(struct workspace *ws) -{ - struct weston_surface *surface; - - wl_list_for_each(surface, &ws->layer.surface_list, layer_link) - weston_surface_damage(surface); -} - static void reverse_workspace_change_animation(struct desktop_shell *shell, unsigned int index, @@ -600,8 +591,7 @@ reverse_workspace_change_animation(struct desktop_shell *shell, restore_focus_state(shell, to); - workspace_damage_all_surfaces(from); - workspace_damage_all_surfaces(to); + weston_compositor_schedule_repaint(shell->compositor); } static void @@ -623,8 +613,7 @@ finish_workspace_change_animation(struct desktop_shell *shell, struct workspace *from, struct workspace *to) { - workspace_damage_all_surfaces(from); - workspace_damage_all_surfaces(to); + weston_compositor_schedule_repaint(shell->compositor); wl_list_remove(&shell->workspaces.animation.link); workspace_deactivate_transforms(from); @@ -673,15 +662,13 @@ animate_workspace_change_frame(struct weston_animation *animation, y = sin(x); if (t < DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH) { - workspace_damage_all_surfaces(from); - workspace_damage_all_surfaces(to); + weston_compositor_schedule_repaint(shell->compositor); workspace_translate_out(from, shell->workspaces.anim_dir * y); workspace_translate_in(to, shell->workspaces.anim_dir * y); shell->workspaces.anim_current = y; - workspace_damage_all_surfaces(from); - workspace_damage_all_surfaces(to); + weston_compositor_schedule_repaint(shell->compositor); } else finish_workspace_change_animation(shell, from, to); @@ -721,8 +708,7 @@ animate_workspace_change(struct desktop_shell *shell, restore_focus_state(shell, to); - workspace_damage_all_surfaces(from); - workspace_damage_all_surfaces(to); + weston_compositor_schedule_repaint(shell->compositor); } static void