[PATCH weston v2 02/21] input: Make pointer grab motion callbacks take an event struct
Jasper St. Pierre
jstpierre at mecheye.net
Tue Oct 27 11:05:10 PDT 2015
Agreed. Absolute input needs to be handled separately. The usage pattern on
an absolute input device is that the cursor warps to the new position, it
didn't simply move from the old to the new.
As an example, pointer barriers shouldn't take effect on absolute input.
On Tue, Oct 27, 2015, 10:40 AM Daniel Stone <daniel at fooishbar.org> wrote:
> Hi Jonas,
>
> On 13 May 2015 at 11:26, Jonas Ã…dahl <jadahl at gmail.com> wrote:
> > @@ -3182,18 +3182,20 @@ popup_grab_focus(struct weston_pointer_grab
> *grab)
> >
> > static void
> > popup_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
> > - wl_fixed_t x, wl_fixed_t y)
> > + struct weston_pointer_motion_event *event)
> > {
> > struct weston_pointer *pointer = grab->pointer;
> > struct wl_resource *resource;
> > + wl_fixed_t x, y;
> > wl_fixed_t sx, sy;
> >
> > if (pointer->focus) {
> > + weston_pointer_motion_to_abs(pointer, event, &x, &y);
> > weston_view_from_global_fixed(pointer->focus, x, y,
> > &pointer->sx,
> &pointer->sy);
> > }
> >
> > - weston_pointer_move(pointer, x, y);
> > + weston_pointer_move(pointer, event);
> >
> > wl_resource_for_each(resource, &pointer->focus_resource_list) {
> > weston_view_from_global_fixed(pointer->focus,
> > diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
> > index bad2418..5cd5ac9 100644
> > --- a/ivi-shell/hmi-controller.c
> > +++ b/ivi-shell/hmi-controller.c
> > @@ -1360,16 +1360,19 @@ layer_set_pos(struct ivi_layout_layer *layer,
> wl_fixed_t pos_x,
> >
> > static void
> > pointer_move_grab_motion(struct weston_pointer_grab *grab, uint32_t
> time,
> > - wl_fixed_t x, wl_fixed_t y)
> > + struct weston_pointer_motion_event *event)
> > {
> > struct pointer_move_grab *pnt_move_grab =
> > (struct pointer_move_grab *)grab;
> > - wl_fixed_t pointer_pos[2] = {x, y};
> > + wl_fixed_t pointer_pos[2] = {
> > + wl_fixed_from_double(event->x),
> > + wl_fixed_from_double(event->y),
> > + };
>
> Should this also be weston_pointer_motion_to_abs()?
>
> > diff --git a/src/compositor-x11.c b/src/compositor-x11.c
> > index 5129e85..57a7d11 100644
> > --- a/src/compositor-x11.c
> > +++ b/src/compositor-x11.c
> > @@ -1105,8 +1106,14 @@ x11_compositor_deliver_motion_event(struct
> x11_compositor *c,
> >
> wl_fixed_from_int(motion_notify->event_y),
> > &x, &y);
> >
> > + event = (struct weston_pointer_motion_event) {
> > + .mask = WESTON_POINTER_MOTION_REL,
> > + .dx = wl_fixed_to_double(x - c->prev_x),
> > + .dy = wl_fixed_to_double(y - c->prev_y)
> > + };
> > +
>
> To be honest, I'm somewhat skeptical of faking relative motion from
> abs in general.
>
> Cheers,
> Daniel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151027/782c303e/attachment-0001.html>
More information about the wayland-devel
mailing list