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

Pekka Paalanen ppaalanen at gmail.com
Tue Sep 9 00:06:49 PDT 2014


On Tue, 9 Sep 2014 06:14:34 +0000
"Zhang, Xiong Y" <xiong.y.zhang at intel.com> wrote:

> On Thu, 12 Jun 2014 11:06:26 +0800
> Xiong Zhang <xiong.y.zhang at intel.com> wrote:
> 
> > 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?

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.

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.

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


Thanks,
pq


More information about the wayland-devel mailing list