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_input *input = data;
struct wayland_compositor *c = input->compositor; 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 = { static const struct wl_pointer_listener pointer_listener = {

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

@ -1706,7 +1706,8 @@ notify_button(struct wl_seat *seat, uint32_t time, int32_t button,
} }
WL_EXPORT void 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_seat *ws = (struct weston_seat *) seat;
struct weston_compositor *compositor = ws->compositor; 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) if (value)
weston_compositor_run_binding(compositor, ws, weston_compositor_run_binding(compositor, ws,
time, 0, 0, axis, value); time, 0, 0, axis,
wl_fixed_to_int(value));
else else
return; return;
if (seat->pointer->focus_resource) if (seat->pointer->focus_resource)
wl_resource_post_event(seat->pointer->focus_resource, wl_pointer_send_axis(seat->pointer->focus_resource, time, axis,
WL_POINTER_AXIS, time, axis, value); wl_fixed_to_int(value));
} }
static int static int

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

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

Loading…
Cancel
Save