summaryrefslogtreecommitdiff
path: root/clients/dnd.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-05-30 16:31:51 +0100
committerKristian Høgsberg <krh@bitplanet.net>2012-05-31 15:42:47 -0400
commit4dbadb1556f296cf148ed91a1044004ec6c80707 (patch)
tree1bc7caaadce31fca754d003c379b5b026c31d6e0 /clients/dnd.c
parent11d7139989860a1405124b889db2fbad087a5a09 (diff)
downloadweston-4dbadb1556f296cf148ed91a1044004ec6c80707.tar.gz
weston-4dbadb1556f296cf148ed91a1044004ec6c80707.tar.bz2
weston-4dbadb1556f296cf148ed91a1044004ec6c80707.zip
Use enum wl_pointer_button_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire, where that's still the call signature), use the new wl_pointer_button_state enum, and explicit comparisons. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'clients/dnd.c')
-rw-r--r--clients/dnd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clients/dnd.c b/clients/dnd.c
index c6f0f183..b6720f07 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -358,7 +358,8 @@ create_drag_cursor(struct dnd_drag *dnd_drag,
static void
dnd_button_handler(struct widget *widget,
struct input *input, uint32_t time,
- uint32_t button, uint32_t state, void *data)
+ uint32_t button, enum wl_pointer_button_state state,
+ void *data)
{
struct dnd *dnd = data;
int32_t x, y;
@@ -378,7 +379,7 @@ dnd_button_handler(struct widget *widget,
x -= allocation.x;
y -= allocation.y;
- if (item && state == 1) {
+ if (item && state == WL_POINTER_BUTTON_STATE_PRESSED) {
dnd_drag = malloc(sizeof *dnd_drag);
dnd_drag->dnd = dnd;
dnd_drag->input = input;