[PATCH weston] shell: Eliminate unneeded function.

Scott Moreau oreaus at gmail.com
Mon Aug 13 08:58:41 PDT 2012


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.
---

This patch replaces [PATCH weston 2/2] shell: Damage on workspace switch if workspace surface list is empty.

 src/shell.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index 4633049..51480ce 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -577,15 +577,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,
 				   struct workspace *from,
@@ -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
-- 
1.7.11.2



More information about the wayland-devel mailing list