[PATCH weston 06/17] desktop-shell: Make activate_binding take a view instead of surface

Jonas Ådahl jadahl at gmail.com
Tue Dec 2 05:49:14 PST 2014


In preparation for further refactoring.

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

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 4a0cb99..4b8724c 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -4927,12 +4927,14 @@ is_black_surface (struct weston_surface *es, struct weston_surface **fs_surface)
 static void
 activate_binding(struct weston_seat *seat,
 		 struct desktop_shell *shell,
-		 struct weston_surface *focus)
+		 struct weston_view *focus_view)
 {
+	struct weston_surface *focus;
 	struct weston_surface *main_surface;
 
-	if (!focus)
+	if (!focus_view)
 		return;
+	focus = focus_view->surface;
 
 	if (is_black_surface(focus, &main_surface))
 		focus = main_surface;
@@ -4945,7 +4947,8 @@ activate_binding(struct weston_seat *seat,
 }
 
 static void
-click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t button,
+click_to_activate_binding(struct weston_seat *seat,
+			  uint32_t time, uint32_t button,
 			  void *data)
 {
 	if (seat->pointer->grab != &seat->pointer->default_grab)
@@ -4953,7 +4956,7 @@ click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t butt
 	if (seat->pointer->focus == NULL)
 		return;
 
-	activate_binding(seat, data, seat->pointer->focus->surface);
+	activate_binding(seat, data, seat->pointer->focus);
 }
 
 static void
@@ -4964,7 +4967,7 @@ touch_to_activate_binding(struct weston_seat *seat, uint32_t time, void *data)
 	if (seat->touch->focus == NULL)
 		return;
 
-	activate_binding(seat, data, seat->touch->focus->surface);
+	activate_binding(seat, data, seat->touch->focus);
 }
 
 static void
-- 
1.8.5.1



More information about the wayland-devel mailing list