Change key/button grab bindings to take unsigned state
'state' here meaning 'is it up or down?', obviously.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/clients/clickdot.c b/clients/clickdot.c
index 3b7210e..1930dfe 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -110,7 +110,7 @@
static void
button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct clickdot *clickdot = data;
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index df4494e..0a6341a 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -256,7 +256,7 @@
static void
panel_launcher_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct panel_launcher *launcher;
@@ -269,7 +269,7 @@
static void
panel_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct panel *panel = data;
@@ -481,7 +481,7 @@
static void
unlock_dialog_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct unlock_dialog *dialog = data;
struct desktop *desktop = dialog->desktop;
diff --git a/clients/dnd.c b/clients/dnd.c
index a7ac66f..1d1f592 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -361,7 +361,7 @@
static void
dnd_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct dnd *dnd = data;
int32_t x, y;
diff --git a/clients/eventdemo.c b/clients/eventdemo.c
index 0848fc8..bda9630 100644
--- a/clients/eventdemo.c
+++ b/clients/eventdemo.c
@@ -211,7 +211,7 @@
*/
static void
button_handler(struct widget *widget, struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
int32_t x, y;
diff --git a/clients/flower.c b/clients/flower.c
index 2d13f9e..7e8cba7 100644
--- a/clients/flower.c
+++ b/clients/flower.c
@@ -142,7 +142,7 @@
static void
button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct flower *flower = data;
diff --git a/clients/gears.c b/clients/gears.c
index c432bc5..4dea8f2 100644
--- a/clients/gears.c
+++ b/clients/gears.c
@@ -251,7 +251,7 @@
static void
button_handler(struct widget *widget, struct input *input,
- uint32_t time, int button, int state, void *data)
+ uint32_t time, int button, uint32_t state, void *data)
{
struct gears *gears = data;
diff --git a/clients/resizor.c b/clients/resizor.c
index 67d4899..37c400b 100644
--- a/clients/resizor.c
+++ b/clients/resizor.c
@@ -178,7 +178,7 @@
static void
button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct resizor *resizor = data;
diff --git a/clients/tablet-shell.c b/clients/tablet-shell.c
index 4f4eec5..9ba9701 100644
--- a/clients/tablet-shell.c
+++ b/clients/tablet-shell.c
@@ -217,7 +217,7 @@
static void
lockscreen_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct lockscreen *lockscreen = data;
diff --git a/clients/terminal.c b/clients/terminal.c
index 106e3d1..659763f 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -2213,7 +2213,7 @@
static void
button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct terminal *terminal = data;
diff --git a/clients/view.c b/clients/view.c
index 1264207..c17bb12 100644
--- a/clients/view.c
+++ b/clients/view.c
@@ -138,7 +138,7 @@
static void
button_handler(struct widget *widget, struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct view *view = data;
diff --git a/clients/window.c b/clients/window.c
index 2dcf421..ce67e69 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1220,7 +1220,7 @@
static void
frame_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct frame *frame = data;
@@ -2363,7 +2363,7 @@
static void
menu_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data)
+ int button, uint32_t state, void *data)
{
struct menu *menu = data;
diff --git a/clients/window.h b/clients/window.h
index a2a7880..d2abb3d 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -190,7 +190,8 @@
int32_t x, int32_t y, void *data);
typedef void (*widget_button_handler_t)(struct widget *widget,
struct input *input, uint32_t time,
- int button, int state, void *data);
+ int button, uint32_t state,
+ void *data);
struct window *
window_create(struct display *display);
diff --git a/src/compositor.c b/src/compositor.c
index 235b4a2..f508745 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1604,7 +1604,7 @@
WL_EXPORT void
notify_button(struct wl_input_device *device,
- uint32_t time, int32_t button, int32_t state)
+ uint32_t time, int32_t button, uint32_t state)
{
struct weston_input_device *wd = (struct weston_input_device *) device;
struct weston_compositor *compositor = wd->compositor;
diff --git a/src/compositor.h b/src/compositor.h
index 3722d32..fac07c7 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -416,7 +416,7 @@
uint32_t time, int x, int y);
void
notify_button(struct wl_input_device *device,
- uint32_t time, int32_t button, int32_t state);
+ uint32_t time, int32_t button, uint32_t state);
void
notify_axis(struct wl_input_device *device,
uint32_t time, uint32_t axis, int32_t value);
diff --git a/src/shell.c b/src/shell.c
index 8c35ae8..738f6c8 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -327,7 +327,7 @@
static void
move_grab_button(struct wl_pointer_grab *grab,
- uint32_t time, uint32_t button, int32_t state)
+ uint32_t time, uint32_t button, uint32_t state)
{
struct shell_grab *shell_grab = container_of(grab, struct shell_grab,
grab);
@@ -587,7 +587,7 @@
static void
resize_grab_button(struct wl_pointer_grab *grab,
- uint32_t time, uint32_t button, int32_t state)
+ uint32_t time, uint32_t button, uint32_t state)
{
struct weston_resize_grab *resize = (struct weston_resize_grab *) grab;
struct wl_input_device *device = grab->input_device;
@@ -1062,7 +1062,7 @@
static void
popup_grab_button(struct wl_pointer_grab *grab,
- uint32_t time, uint32_t button, int32_t state)
+ uint32_t time, uint32_t button, uint32_t state)
{
struct wl_resource *resource;
struct shell_surface *shsurf =
@@ -1711,7 +1711,7 @@
static void
rotate_grab_button(struct wl_pointer_grab *grab,
- uint32_t time, uint32_t button, int32_t state)
+ uint32_t time, uint32_t button, uint32_t state)
{
struct rotate_grab *rotate =
container_of(grab, struct rotate_grab, base.grab);
@@ -2403,7 +2403,7 @@
static void
switcher_key(struct wl_keyboard_grab *grab,
- uint32_t time, uint32_t key, int32_t state)
+ uint32_t time, uint32_t key, uint32_t state)
{
struct switcher *switcher = container_of(grab, struct switcher, grab);
struct weston_input_device *device =
diff --git a/src/util.c b/src/util.c
index 9943820..78f6980 100644
--- a/src/util.c
+++ b/src/util.c
@@ -249,7 +249,7 @@
static void
binding_key(struct wl_keyboard_grab *grab,
- uint32_t time, uint32_t key, int32_t state)
+ uint32_t time, uint32_t key, uint32_t state)
{
struct binding_keyboard_grab *b =
container_of(grab, struct binding_keyboard_grab, grab);