[PATCH 3/9] one pointer exist in only one output

Xiong Zhang xiong.y.zhang at intel.com
Tue Sep 17 20:50:58 PDT 2013


one pointer can exist in only one output, once find the output, break
the loop

Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com>
---
 src/input.c | 7 +++++--
 src/shell.c | 2 ++
 src/zoom.c  | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/input.c b/src/input.c
index 85b772f..6b26f3c 100644
--- a/src/input.c
+++ b/src/input.c
@@ -614,11 +614,14 @@ move_pointer(struct weston_seat *seat, wl_fixed_t x, wl_fixed_t y)
 	ix = wl_fixed_to_int(x);
 	iy = wl_fixed_to_int(y);
 
-	wl_list_for_each(output, &ec->output_list, link)
+	wl_list_for_each(output, &ec->output_list, link) {
 		if (output->zoom.active &&
 		    pixman_region32_contains_point(&output->region,
-						   ix, iy, NULL))
+						   ix, iy, NULL)) {
 			weston_output_update_zoom(output, ZOOM_FOCUS_POINTER);
+			break;
+		}
+	}
 
 	if (pointer->sprite) {
 		weston_surface_set_position(pointer->sprite,
diff --git a/src/shell.c b/src/shell.c
index 0efdd1d..7ff8697 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2875,6 +2875,8 @@ do_zoom(struct weston_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
 			output->zoom.spring_z.target = output->zoom.level;
 
 			weston_output_update_zoom(output, output->zoom.type);
+
+			break;
 		}
 	}
 }
diff --git a/src/zoom.c b/src/zoom.c
index 220b2b6..7f28862 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -115,6 +115,7 @@ weston_text_cursor_position_notify(struct weston_surface *surface,
 			output->zoom.text_cursor.x = global_x;
 			output->zoom.text_cursor.y = global_y;
 			weston_output_update_zoom(output, ZOOM_FOCUS_TEXT);
+			break;
 		}
 }
 
-- 
1.8.3.2



More information about the wayland-devel mailing list