summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-01-18 15:58:17 +1000
committerJonas Ådahl <jadahl@gmail.com>2016-01-19 10:53:16 +0800
commit89b6a4931ef40e4524fec9bfc05627be9a974758 (patch)
treed61650122be0c665badc772ea044edfdbd4a48cb /desktop-shell
parent60fb1c4ce8aa7b0bfd804e9a7a6631a528aaeb50 (diff)
Add a weston_pointer_axis_event
Use an event struct to pass axis events around. This helps dealing with the upcoming axis discrete changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/exposay.c2
-rw-r--r--desktop-shell/shell.c17
2 files changed, 11 insertions, 8 deletions
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
index 8bd55fbf..f8378590 100644
--- a/desktop-shell/exposay.c
+++ b/desktop-shell/exposay.c
@@ -387,7 +387,7 @@ exposay_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button,
static void
exposay_axis(struct weston_pointer_grab *grab,
- uint32_t time, uint32_t axis, wl_fixed_t value)
+ uint32_t time, struct weston_pointer_axis_event *event)
{
}
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 6f1c1672..6e746556 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1598,7 +1598,7 @@ noop_grab_focus(struct weston_pointer_grab *grab)
static void
noop_grab_axis(struct weston_pointer_grab *grab,
- uint32_t time, uint32_t axis, wl_fixed_t value)
+ uint32_t time, struct weston_pointer_axis_event *event)
{
}
@@ -3207,9 +3207,10 @@ popup_grab_button(struct weston_pointer_grab *grab,
static void
popup_grab_axis(struct weston_pointer_grab *grab,
- uint32_t time, uint32_t axis, wl_fixed_t value)
+ uint32_t time,
+ struct weston_pointer_axis_event *event)
{
- weston_pointer_send_axis(grab->pointer, time, axis, value);
+ weston_pointer_send_axis(grab->pointer, time, event);
}
static void
@@ -4720,7 +4721,8 @@ resize_binding(struct weston_pointer *pointer, uint32_t time,
static void
surface_opacity_binding(struct weston_pointer *pointer, uint32_t time,
- uint32_t axis, wl_fixed_t value, void *data)
+ struct weston_pointer_axis_event *event,
+ void *data)
{
float step = 0.005;
struct shell_surface *shsurf;
@@ -4736,7 +4738,7 @@ surface_opacity_binding(struct weston_pointer *pointer, uint32_t time,
if (!shsurf)
return;
- shsurf->view->alpha -= wl_fixed_to_double(value) * step;
+ shsurf->view->alpha -= wl_fixed_to_double(event->value) * step;
if (shsurf->view->alpha > 1.0)
shsurf->view->alpha = 1.0;
@@ -4799,9 +4801,10 @@ do_zoom(struct weston_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
static void
zoom_axis_binding(struct weston_pointer *pointer, uint32_t time,
- uint32_t axis, wl_fixed_t value, void *data)
+ struct weston_pointer_axis_event *event,
+ void *data)
{
- do_zoom(pointer->seat, time, 0, axis, value);
+ do_zoom(pointer->seat, time, 0, event->axis, event->value);
}
static void