Convert notify_axis to wl_fixed_t

In preparation for the rest of the axis code changing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
dev
Daniel Stone 13 years ago committed by Kristian Høgsberg
parent b21046836f
commit 878f0b77a8
  1. 2
      src/compositor-wayland.c
  2. 12
      src/compositor-x11.c
  3. 10
      src/compositor.c
  4. 2
      src/compositor.h
  5. 6
      src/evdev.c

@ -564,7 +564,7 @@ input_handle_axis(void *data, struct wl_pointer *pointer,
struct wayland_input *input = data;
struct wayland_compositor *c = input->compositor;
notify_axis(&c->base.seat->seat, time, axis, value);
notify_axis(&c->base.seat->seat, time, axis, wl_fixed_from_int(value));
}
static const struct wl_pointer_listener pointer_listener = {

@ -502,25 +502,29 @@ x11_compositor_deliver_button_event(struct x11_compositor *c,
if (state)
notify_axis(&c->base.seat->seat,
weston_compositor_get_time(),
WL_POINTER_AXIS_VERTICAL_SCROLL, 1);
WL_POINTER_AXIS_VERTICAL_SCROLL,
wl_fixed_from_int(1));
return;
case 5:
if (state)
notify_axis(&c->base.seat->seat,
weston_compositor_get_time(),
WL_POINTER_AXIS_VERTICAL_SCROLL, -1);
WL_POINTER_AXIS_VERTICAL_SCROLL,
wl_fixed_from_int(-1));
return;
case 6:
if (state)
notify_axis(&c->base.seat->seat,
weston_compositor_get_time(),
WL_POINTER_AXIS_HORIZONTAL_SCROLL, 1);
WL_POINTER_AXIS_HORIZONTAL_SCROLL,
wl_fixed_from_int(1));
return;
case 7:
if (state)
notify_axis(&c->base.seat->seat,
weston_compositor_get_time(),
WL_POINTER_AXIS_HORIZONTAL_SCROLL, -1);
WL_POINTER_AXIS_HORIZONTAL_SCROLL,
wl_fixed_from_int(-1));
return;
}

@ -1706,7 +1706,8 @@ notify_button(struct wl_seat *seat, uint32_t time, int32_t button,
}
WL_EXPORT void
notify_axis(struct wl_seat *seat, uint32_t time, uint32_t axis, int32_t value)
notify_axis(struct wl_seat *seat, uint32_t time, uint32_t axis,
wl_fixed_t value)
{
struct weston_seat *ws = (struct weston_seat *) seat;
struct weston_compositor *compositor = ws->compositor;
@ -1721,13 +1722,14 @@ notify_axis(struct wl_seat *seat, uint32_t time, uint32_t axis, int32_t value)
if (value)
weston_compositor_run_binding(compositor, ws,
time, 0, 0, axis, value);
time, 0, 0, axis,
wl_fixed_to_int(value));
else
return;
if (seat->pointer->focus_resource)
wl_resource_post_event(seat->pointer->focus_resource,
WL_POINTER_AXIS, time, axis, value);
wl_pointer_send_axis(seat->pointer->focus_resource, time, axis,
wl_fixed_to_int(value));
}
static int

@ -481,7 +481,7 @@ notify_button(struct wl_seat *seat, uint32_t time, int32_t button,
enum wl_pointer_button_state state);
void
notify_axis(struct wl_seat *seat, uint32_t time, uint32_t axis,
int32_t value);
wl_fixed_t value);
void
notify_key(struct wl_seat *seat, uint32_t time, uint32_t key,
enum wl_keyboard_key_state state);

@ -168,12 +168,14 @@ evdev_process_relative(struct evdev_input_device *device,
case REL_WHEEL:
notify_axis(&device->master->base.seat,
time,
WL_POINTER_AXIS_VERTICAL_SCROLL, e->value);
WL_POINTER_AXIS_VERTICAL_SCROLL,
wl_fixed_from_int(e->value));
break;
case REL_HWHEEL:
notify_axis(&device->master->base.seat,
time,
WL_POINTER_AXIS_HORIZONTAL_SCROLL, e->value);
WL_POINTER_AXIS_HORIZONTAL_SCROLL,
wl_fixed_from_int(e->value));
break;
}
}

Loading…
Cancel
Save