button-test: Use wl_display_roundtrip instead of yield()
[profile/ivi/weston.git] / clients / flower.c
index 84f8e6c..dac52d5 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <linux/input.h>
 #include <wayland-client.h>
-#include <wayland-cursor.h>
 #include "window.h"
 
 struct flower {
@@ -134,28 +133,28 @@ static int
 motion_handler(struct widget *widget, struct input *input,
               uint32_t time, float x, float y, void *data)
 {
-       return WL_CURSOR_HAND1;
+       return CURSOR_HAND1;
 }
 
 static void
 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 flower *flower = data;
 
        switch (button) {
        case BTN_LEFT:
-               if (state)
+               if (state == WL_POINTER_BUTTON_STATE_PRESSED)
                        window_move(flower->window, input,
                                    display_get_serial(flower->display));
                break;
        case BTN_MIDDLE:
-               if (state)
+               if (state == WL_POINTER_BUTTON_STATE_PRESSED)
                        widget_schedule_redraw(widget);
                break;
        case BTN_RIGHT:
-               if (state)
+               if (state == WL_POINTER_BUTTON_STATE_PRESSED)
                        window_show_frame_menu(flower->window, input, time);
                break;
        }
@@ -181,6 +180,7 @@ int main(int argc, char *argv[])
        flower.display = d;
        flower.window = window_create(d);
        flower.widget = window_add_widget(flower.window, &flower);
+       window_set_title(flower.window, "Flower");
 
        widget_set_resize_handler(flower.widget, resize_handler);
        widget_set_redraw_handler(flower.widget, redraw_handler);