[PATCH v2 weston 05/13] tablet: handle tablet cursors in the compositor

Peter Hutterer peter.hutterer at who-t.net
Mon May 9 06:41:24 UTC 2016


On Sat, Apr 30, 2016 at 05:58:32PM +0800, Jonas Ã…dahl wrote:
> On Wed, Feb 03, 2016 at 03:28:09PM +1000, Peter Hutterer wrote:
> > From: Stephen Chandler Paul <thatslyude at gmail.com>
> > 
> > The tablet is given a separate cursor. Most tablet interaction is an absolute
> > interaction and shouldn't need a cursor at all, but usually the cursor is used
> > to indicate the type of virtual tool currently assigned.
> > 
> > Co-authored-by: Peter Hutterer <peter.hutterer at who-t.net>
> > Signed-off-by: Stephen Chandler Paul <thatslyude at gmail.com>
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  src/compositor.c |   6 +++
> >  src/compositor.h |  13 +++++
> >  src/input.c      | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  3 files changed, 175 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/compositor.c b/src/compositor.c
> > index cbdb14c..f419818 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -1866,6 +1866,7 @@ weston_view_unmap(struct weston_view *view)
> >  		struct weston_pointer *pointer = weston_seat_get_pointer(seat);
> >  		struct weston_keyboard *keyboard =
> >  			weston_seat_get_keyboard(seat);
> > +		struct weston_tablet_tool *tool;
> >  
> >  		if (keyboard && keyboard->focus == view->surface)
> >  			weston_keyboard_set_focus(keyboard, NULL);
> > @@ -1873,6 +1874,11 @@ weston_view_unmap(struct weston_view *view)
> >  			weston_pointer_clear_focus(pointer);
> >  		if (touch && touch->focus == view)
> >  			weston_touch_set_focus(touch, NULL);
> > +
> > +		wl_list_for_each(tool, &seat->tablet_tool_list, link) {
> > +			if (tool->focus == view)
> > +				weston_tablet_tool_set_focus(tool, NULL, 0);
> > +		}
> 
> Hmm. Should this be part of some other patch?

I don't think so since we don't need to worry about weston_views
until now. The cursor stuff adds the views, so we need unmap them correctly.

Cheers,
   Peter



More information about the wayland-devel mailing list