[PATCH 2/2] clients: Maximize window when double touch on title bar

Zhang, Xiong Y xiong.y.zhang at intel.com
Tue Sep 9 03:11:51 PDT 2014


> > > Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com>
> > ---
> >  clients/window.c    | 26 ++++++++++++++++++++++++--
> >  shared/cairo-util.h |  7 +++++++
> >  shared/frame.c      | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 80 insertions(+), 2 deletions(-)
> >
> > diff --git a/clients/window.c b/clients/window.c index 
> > 7c9c518..a608a84 100644
> > --- a/clients/window.c
> > +++ b/clients/window.c
> > @@ -363,6 +363,7 @@ struct window_frame {
> >
> >       uint32_t last_time;
> >       uint32_t did_double, double_click;
> > +     int32_t last_id, double_id;
> >  };
> >
> >  struct menu {
> > @@ -2380,7 +2381,23 @@ frame_touch_down_handler(struct widget 
> > *widget, struct input *input,  {
> >       struct window_frame *frame = data;
> >
> > -     frame_touch_down(frame->frame, input, id, x, y);
> > +     frame->double_click = 0;
> > +     if (time - frame->last_time <= DOUBLE_CLICK_PERIOD &&
> > +         frame->last_id == id) {
> > +             frame->double_click = 1;
> > +             frame->did_double = 1;
> > +             frame->double_id = id;
> > +     } else
> > +             frame->did_double = 0;
> > +
> > +     frame->last_time = time;
> > +     frame->last_id = id;
> > +
> > +     if (frame->double_click)
> > +             frame_double_touch_down(frame->frame, input, id, x, y);
> > +     else
> > +             frame_touch_down(frame->frame, input, id, x, y);
> > +
> >       frame_handle_status(frame, input, time, 
> > THEME_LOCATION_CLIENT_AREA);
> 
> >Hi,
> 
> >hmm, should this perhaps be restricted to the case, where you start 
> >with no touches down, then one touch id does down-up, then again 
> >down-up, and only interpret that as a double-touch?
> 
> In order to support multi touch, I didn't do this restriction.
> 
> >With your current code, isn't is possible to keep, say, one finger 
> >down while double-touching with another finger? Is that intended?
> >Thanks,
> >pq
> 
> It is my intend to keep one finger down while double-touching with another finger.
> So that we can operate with both hands and support multi touch.

>But touch points are never independent, are they?
>Doesn't putting one finger down take an implicit grab, which causes all additional fingers to be restricted to the 
>surface with the grab?
Yes, I agree with you.

>You cannot distinguish left hand from right, fingers all create just arbitrary touch points.

>In src/input.c it is written around line 1523:
>		/* the first finger down picks the view, and all further go
>		 * to that view for the remainder of the touch session i.e.
>		 * until all touch points are up again. */

>So that means that you cannot hold a finger down on one window, and then double-tap another window.
So this means that all touch points must be in one window in order to support multi touch. Weston have given us such limitation.

>Does it really make sense to be able to hold one finger down on the same window, and double-tap with another?

>If I hold a finger down on the window, can I usually use another finger to push button widgets on the same
>window? By "usually" I mean in whatever touch interfaces there are on the market / in the wild.
In a virtual key board, one finger could hold Shift key and another finger could single or double touch other key to enter capital like physical key board.

>How would you distinguish a "left thumb down on something, drag & drop something else with right index 
>finger" from the "zoom pinch gesture"?

If all touch points are in one window at the same time, each touch point has a unique touch ID. Using this ID, APP could identify them. Left thumb's drog & dorp and Right index finger 's zoom gesture are independent.

My current code is compatible with your proposal restriction, and it could also add multi touch support in one window.
>Thanks,
>pq


More information about the wayland-devel mailing list