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

Submitted by Jonas Ådahl on Dec. 2, 2014, 1:49 p.m.

Details

Message ID 1417528165-9319-7-git-send-email-jadahl@gmail.com
State Superseded
Delegated to: Daniel Stone
Headers show

Not browsing as part of any series.

Commit Message

Jonas Ådahl Dec. 2, 2014, 1:49 p.m.
In preparation for further refactoring.

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

Patch hide | download patch | download mbox

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