[PATCH weston 04/11] shell: Specify workspace when ensuring that a focus state exists

Jonas Ådahl jadahl at gmail.com
Sat Jan 26 06:33:34 PST 2013


Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 src/shell.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index 29459ea..c5bb9c4 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -450,9 +450,10 @@ focus_state_create(struct weston_seat *seat, struct workspace *ws)
 }
 
 static struct focus_state *
-ensure_focus_state(struct desktop_shell *shell, struct weston_seat *seat)
+ensure_focus_state(struct desktop_shell *shell,
+		   struct workspace *ws,
+		   struct weston_seat *seat)
 {
-	struct workspace *ws = get_current_workspace(shell);
 	struct focus_state *state;
 
 	wl_list_for_each(state, &ws->focus_list, link)
@@ -1012,7 +1013,7 @@ take_surface_to_workspace_by_seat(struct desktop_shell *shell,
 
 	broadcast_current_workspace_state(shell);
 
-	state = ensure_focus_state(shell, seat);
+	state = ensure_focus_state(shell, to, seat);
 	if (state != NULL)
 		state->keyboard_focus = surface;
 }
@@ -2734,7 +2735,8 @@ activate(struct desktop_shell *shell, struct weston_surface *es,
 
 	weston_surface_activate(es, seat);
 
-	state = ensure_focus_state(shell, seat);
+	ws = get_current_workspace(shell);
+	state = ensure_focus_state(shell, ws, seat);
 	if (state == NULL)
 		return;
 
@@ -2750,7 +2752,6 @@ activate(struct desktop_shell *shell, struct weston_surface *es,
 		shell_configure_fullscreen(get_shell_surface(es));
 		break;
 	default:
-		ws = get_current_workspace(shell);
 		workspace_restack_surface(ws, shsurf);
 		break;
 	}
-- 
1.7.10.4



More information about the wayland-devel mailing list