<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 6, 2014 at 9:46 PM, Boyan Ding <span dir="ltr"><<a href="mailto:stu_dby@126.com" target="_blank">stu_dby@126.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 shared/cairo-util.h |  3 +++<br>
 shared/frame.c      | 24 ++++++++++++++++++++++++<br>
 2 files changed, 27 insertions(+)<br>
<br>
diff --git a/shared/cairo-util.h b/shared/cairo-util.h<br>
index 4493b0d..7aebb65 100644<br>
--- a/shared/cairo-util.h<br>
+++ b/shared/cairo-util.h<br>
@@ -211,6 +211,9 @@ void<br>
 frame_touch_up(struct frame *frame, void *data, int32_t id);<br>
<br>
 void<br>
+frame_touch_motion(struct frame *frame, void *data, int32_t id, int x, int y);<br>
+<br>
+void<br>
 frame_repaint(struct frame *frame, cairo_t *cr);<br>
<br>
 #endif<br>
diff --git a/shared/frame.c b/shared/frame.c<br>
index 35e6b65..df51eca 100644<br>
--- a/shared/frame.c<br>
+++ b/shared/frame.c<br>
@@ -837,6 +837,30 @@ frame_touch_up(struct frame *frame, void *data, int32_t id)<br>
 }<br>
<br>
 void<br>
+frame_touch_motion(struct frame *frame, void *data, int32_t id, int x, int y)<br>
+{<br>
+       struct frame_touch *touch = frame_touch_get(frame, data);<br>
+       struct frame_button *button = frame_find_button(frame, x, y);<br>
+<br>
+       if (id > 0 || !touch)<br>
+               return;<br>
+<br>
+       touch->x = x;<br>
+       touch->y = y;<br>
+<br>
+       if (touch->button == button)<br>
+               return ;<br>
+<br>
+       if (touch->button)<br>
+               frame_button_release(touch->button);<br>
+<br>
+       touch->button = button;<br>
+<br>
+       if (touch->button)<br>
+               frame_button_press(touch->button);<br>
</blockquote><div><br></div><div>Are you sure that these are the semantics we want?  Most touch interfaces, don't let you slide onto a button.  For instance, given the way this is written, if you put your finger down, slide onto the close button and then slide off without picking up your finger, the close button will see a press and a release and the window will close.  I think what we want to do here is to mirror what is done for a mouse pointer.  Only press the button on finger down and then, on finger up either release or cancel the button depending on whether the finger is still on the button or not.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+}<br>
+<br>
+void<br>
 frame_repaint(struct frame *frame, cairo_t *cr)<br>
 {<br>
        struct frame_button *button;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.2<br>
<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div></div>