summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2014-10-04 16:28:29 +0200
committerJonas Ådahl <jadahl@gmail.com>2015-11-02 14:30:16 +0800
commit0336ca0cc5542a0d65f0f278f89e8d926a720a29 (patch)
tree23881f60288f64ae677b3c9f99c8bd78759a6ff8 /desktop-shell
parent22faea11c8745c46c043a268eec3073b0922ccd0 (diff)
downloadweston-0336ca0cc5542a0d65f0f278f89e8d926a720a29.tar.gz
input: Pass axis events through pointer grab interfaces
Don't only send motions and buttons but also axis events through the pointer grab interface. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/exposay.c7
-rw-r--r--desktop-shell/shell.c24
2 files changed, 31 insertions, 0 deletions
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
index 08b86a3e..eb4070e2 100644
--- a/desktop-shell/exposay.c
+++ b/desktop-shell/exposay.c
@@ -386,6 +386,12 @@ 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)
+{
+}
+
+static void
exposay_pointer_grab_cancel(struct weston_pointer_grab *grab)
{
struct desktop_shell *shell =
@@ -398,6 +404,7 @@ static const struct weston_pointer_grab_interface exposay_ptr_grab = {
exposay_focus,
exposay_motion,
exposay_button,
+ exposay_axis,
exposay_pointer_grab_cancel,
};
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index d507d189..52d1195d 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1701,6 +1701,12 @@ 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)
+{
+}
+
+static void
constrain_position(struct weston_move_grab *move, int *cx, int *cy)
{
struct shell_surface *shsurf = move->base.shsurf;
@@ -1782,6 +1788,7 @@ static const struct weston_pointer_grab_interface move_grab_interface = {
noop_grab_focus,
move_grab_motion,
move_grab_button,
+ noop_grab_axis,
move_grab_cancel,
};
@@ -1945,6 +1952,7 @@ static const struct weston_pointer_grab_interface resize_grab_interface = {
noop_grab_focus,
resize_grab_motion,
resize_grab_button,
+ noop_grab_axis,
resize_grab_cancel,
};
@@ -2109,6 +2117,7 @@ static const struct weston_pointer_grab_interface busy_cursor_grab_interface = {
busy_cursor_grab_focus,
busy_cursor_grab_motion,
busy_cursor_grab_button,
+ noop_grab_axis,
busy_cursor_grab_cancel,
};
@@ -3291,6 +3300,19 @@ 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)
+{
+ struct weston_pointer *pointer = grab->pointer;
+ struct wl_resource *resource;
+ struct wl_list *resource_list;
+
+ resource_list = &pointer->focus_resource_list;
+ wl_resource_for_each(resource, resource_list)
+ wl_pointer_send_axis(resource, time, axis, value);
+}
+
+static void
popup_grab_cancel(struct weston_pointer_grab *grab)
{
popup_grab_end(grab->pointer);
@@ -3300,6 +3322,7 @@ static const struct weston_pointer_grab_interface popup_grab_interface = {
popup_grab_focus,
popup_grab_motion,
popup_grab_button,
+ popup_grab_axis,
popup_grab_cancel,
};
@@ -5000,6 +5023,7 @@ static const struct weston_pointer_grab_interface rotate_grab_interface = {
noop_grab_focus,
rotate_grab_motion,
rotate_grab_button,
+ noop_grab_axis,
rotate_grab_cancel,
};